From bfece9ae7dadd997ebd36090beb41388f57eb28d Mon Sep 17 00:00:00 2001 From: lollipopkit Date: Mon, 25 Mar 2024 00:41:34 -0600 Subject: [PATCH] opt.: ssh tab top padding --- lib/core/utils/platform/auth.dart | 6 +++--- lib/view/page/home.dart | 5 ++++- lib/view/page/ssh/tab.dart | 4 +++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/core/utils/platform/auth.dart b/lib/core/utils/platform/auth.dart index 0016b287..a53b5f9e 100644 --- a/lib/core/utils/platform/auth.dart +++ b/lib/core/utils/platform/auth.dart @@ -14,7 +14,7 @@ import 'package:toolbox/data/res/store.dart'; abstract final class BioAuth { static final _auth = LocalAuthentication(); - static bool get isPlatformSupported => isAndroid || isIOS || isWindows; + static final isPlatformSupported = isAndroid || isIOS || isWindows; static bool _isAuthing = false; @@ -41,8 +41,8 @@ abstract final class BioAuth { case AuthResult.success: // wait for animation Future.delayed( - count >= 3 - ? const Duration(milliseconds: 500) + isIOS + ? const Duration(milliseconds: 1300) : const Duration(seconds: 1), () => _isAuthing = false, ); diff --git a/lib/view/page/home.dart b/lib/view/page/home.dart index 9e70bc70..298f5843 100644 --- a/lib/view/page/home.dart +++ b/lib/view/page/home.dart @@ -375,7 +375,10 @@ final class _AppBar extends CustomAppBar { valueListenable: selectIndex, builder: (_, idx, __) { if (idx == AppTab.ssh.index) { - return SizedBox(height: CustomAppBar.barHeight); + return SizedBox( + height: CustomAppBar.barHeight ?? + 0 + MediaQuery.of(context).padding.top, + ); } return super.build(context); }, diff --git a/lib/view/page/ssh/tab.dart b/lib/view/page/ssh/tab.dart index 658a351e..84ba2cea 100644 --- a/lib/view/page/ssh/tab.dart +++ b/lib/view/page/ssh/tab.dart @@ -136,7 +136,9 @@ class _SSHTabPageState extends State }, ); _refreshTabs(); - _tabController.animateTo(_tabIds.length - 1); + final idx = _tabIds.length - 1; + _tabController.animateTo(idx); + _fabRN.value = idx; }, ), );