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