mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-16 14:54:34 +01:00
opt.: bio auth settings
This commit is contained in:
@@ -2,5 +2,4 @@ arb-dir: lib/l10n
|
||||
template-arb-file: app_en.arb
|
||||
output-localization-file: l10n.dart
|
||||
output-dir: lib/generated/l10n
|
||||
synthetic-package: false
|
||||
untranslated-messages-file: untranlated.json
|
||||
11
lib/app.dart
11
lib/app.dart
@@ -3,7 +3,7 @@ import 'package:fl_lib/fl_lib.dart';
|
||||
import 'package:fl_lib/generated/l10n/lib_l10n.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:icons_plus/icons_plus.dart';
|
||||
import 'package:responsive_framework/responsive_framework.dart';
|
||||
import 'package:responsive_framework/responsive_framework.dart' hide ResponsiveUtils;
|
||||
import 'package:server_box/core/extension/context/locale.dart';
|
||||
import 'package:server_box/data/res/build_data.dart';
|
||||
import 'package:server_box/data/res/store.dart';
|
||||
@@ -79,14 +79,7 @@ class MyApp extends StatelessWidget {
|
||||
|
||||
return MaterialApp(
|
||||
key: ValueKey(locale),
|
||||
builder: (context, child) => ResponsiveBreakpoints.builder(
|
||||
child: child ?? UIs.placeholder,
|
||||
breakpoints: const [
|
||||
Breakpoint(start: 0, end: 600, name: MOBILE),
|
||||
Breakpoint(start: 600, end: 1199, name: TABLET),
|
||||
Breakpoint(start: 1199, end: 3840, name: DESKTOP),
|
||||
],
|
||||
),
|
||||
builder: ResponsivePoints.builder,
|
||||
locale: locale,
|
||||
localizationsDelegates: const [LibLocalizations.delegate, ...AppLocalizations.localizationsDelegates],
|
||||
supportedLocales: AppLocalizations.supportedLocales,
|
||||
|
||||
@@ -4,23 +4,27 @@ import 'package:server_box/data/res/store.dart';
|
||||
|
||||
abstract final class PlatformPublicSettings {
|
||||
static Widget get buildBioAuth {
|
||||
return ExpandTile(title: Text(libL10n.bioAuth), children: [_buildBioAuth(), _buildBioAuthDelay()]);
|
||||
return ExpandTile(
|
||||
leading: const Icon(Icons.fingerprint),
|
||||
title: Text(libL10n.bioAuth),
|
||||
children: [_buildBioAuth(), _buildBioAuthDelay()],
|
||||
);
|
||||
}
|
||||
|
||||
static Widget _buildBioAuthDelay() {
|
||||
return FutureWidget<bool>(
|
||||
future: LocalAuth.isAvail,
|
||||
loading: ListTile(
|
||||
title: Text(libL10n.delay),
|
||||
title: Text('${libL10n.delay} (${libL10n.second})'),
|
||||
subtitle: const Text('...', style: UIs.textGrey),
|
||||
),
|
||||
error: (e, _) => ListTile(
|
||||
title: Text(libL10n.delay),
|
||||
title: Text('${libL10n.delay} (${libL10n.second})'),
|
||||
subtitle: Text('${libL10n.fail}: $e', style: UIs.textGrey),
|
||||
),
|
||||
success: (can) {
|
||||
return ListTile(
|
||||
title: Text(libL10n.delay),
|
||||
title: Text('${libL10n.delay} (${libL10n.second})'),
|
||||
trailing: can == true ? Stores.setting.delayBioAuthLock.fieldWidget() : null,
|
||||
);
|
||||
},
|
||||
@@ -31,7 +35,6 @@ abstract final class PlatformPublicSettings {
|
||||
return FutureWidget<bool>(
|
||||
future: LocalAuth.isAvail,
|
||||
loading: ListTile(
|
||||
leading: const Icon(Icons.fingerprint),
|
||||
title: Text(libL10n.switch_),
|
||||
subtitle: const Text('...', style: UIs.textGrey),
|
||||
),
|
||||
@@ -42,7 +45,6 @@ abstract final class PlatformPublicSettings {
|
||||
success: (can) {
|
||||
can ??= false;
|
||||
return ListTile(
|
||||
leading: const Icon(Icons.fingerprint),
|
||||
title: Text(libL10n.switch_),
|
||||
subtitle: can ? null : Text(libL10n.notExistFmt(libL10n.bioAuth), style: UIs.textGrey),
|
||||
trailing: can
|
||||
|
||||
@@ -497,8 +497,8 @@ packages:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: "."
|
||||
ref: "v1.0.336"
|
||||
resolved-ref: "403ec409389521b12f5ab278a7f306daab0504d3"
|
||||
ref: "v1.0.338"
|
||||
resolved-ref: d681131c436fa346bfb4675bca5c37cd38b1fdc2
|
||||
url: "https://github.com/lppcg/fl_lib"
|
||||
source: git
|
||||
version: "0.0.1"
|
||||
|
||||
@@ -63,7 +63,7 @@ dependencies:
|
||||
fl_lib:
|
||||
git:
|
||||
url: https://github.com/lppcg/fl_lib
|
||||
ref: v1.0.336
|
||||
ref: v1.0.338
|
||||
|
||||
dependency_overrides:
|
||||
# webdav_client_plus:
|
||||
|
||||
Reference in New Issue
Block a user