mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2026-01-31 05:14:56 +01:00
fix: settings page and SSH virtual keys bottom overflow (#1015)
* fix: Add SafeArea to the page to prevent content from being obscured Add the SafeArea component to multiple pages to ensure that content is not obscured by the device status bar or navigation bar, thereby enhancing the user experience * fix(ssh page): Fix the issue of the virtual keyboard area being displayed within the security zone Wrap the virtual keyboard area within the SafeArea to prevent it from being obscured by the system UI, and remove any unnecessary bottom padding
This commit is contained in:
@@ -41,7 +41,7 @@ final class _BackupPageState extends ConsumerState<BackupPage> with AutomaticKee
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
super.build(context);
|
||||
return Scaffold(body: _buildBody);
|
||||
return Scaffold(body: SafeArea(child: _buildBody));
|
||||
}
|
||||
|
||||
Widget get _buildBody {
|
||||
|
||||
@@ -23,7 +23,7 @@ class _PrivateKeyListState extends ConsumerState<PrivateKeysListPage> with After
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: _buildBody(),
|
||||
body: SafeArea(child: _buildBody()),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
child: const Icon(Icons.add),
|
||||
onPressed: () => PrivateKeyEditPage.route.go(context),
|
||||
|
||||
@@ -11,9 +11,10 @@ final class _AppAboutPageState extends State<_AppAboutPage> with AutomaticKeepAl
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
super.build(context);
|
||||
return ListView(
|
||||
padding: const EdgeInsets.all(13),
|
||||
children: [
|
||||
return SafeArea(
|
||||
child: ListView(
|
||||
padding: const EdgeInsets.all(13),
|
||||
children: [
|
||||
UIs.height13,
|
||||
ConstrainedBox(constraints: const BoxConstraints(maxHeight: 47, maxWidth: 47), child: UIs.appIcon),
|
||||
const Text('${BuildData.name}\nv${BuildData.build}', textAlign: TextAlign.center, style: UIs.text15),
|
||||
@@ -59,6 +60,7 @@ ${l10n.madeWithLove('[lollipopkit](${Urls.myGithub})')}
|
||||
''',
|
||||
).paddingAll(13).cardx,
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ class _SettingsPageState extends ConsumerState<SettingsPage> with SingleTickerPr
|
||||
),
|
||||
],
|
||||
),
|
||||
body: TabBarView(controller: _tabCtrl, children: SettingsTabs.pages),
|
||||
body: SafeArea(child: TabBarView(controller: _tabCtrl, children: SettingsTabs.pages)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,23 +268,26 @@ class SSHPageState extends ConsumerState<SSHPage>
|
||||
}
|
||||
|
||||
Widget _buildBottom() {
|
||||
return AnimatedPadding(
|
||||
padding: _media.viewInsets,
|
||||
duration: const Duration(milliseconds: 23),
|
||||
curve: Curves.fastOutSlowIn,
|
||||
child: Container(
|
||||
color: _terminalTheme.background,
|
||||
height: _virtKeysHeight + _media.padding.bottom,
|
||||
child: Consumer(
|
||||
builder: (context, ref, child) {
|
||||
final virtKeyState = ref.watch(virtKeyboardProvider);
|
||||
final virtKeyNotifier = ref.read(virtKeyboardProvider.notifier);
|
||||
|
||||
// Set the terminal input handler
|
||||
_terminal.inputHandler = virtKeyNotifier;
|
||||
|
||||
return _buildVirtualKey(virtKeyState, virtKeyNotifier);
|
||||
},
|
||||
return SafeArea(
|
||||
top: false,
|
||||
child: AnimatedPadding(
|
||||
padding: _media.viewInsets,
|
||||
duration: const Duration(milliseconds: 23),
|
||||
curve: Curves.fastOutSlowIn,
|
||||
child: Container(
|
||||
color: _terminalTheme.background,
|
||||
height: _virtKeysHeight,
|
||||
child: Consumer(
|
||||
builder: (context, ref, child) {
|
||||
final virtKeyState = ref.watch(virtKeyboardProvider);
|
||||
final virtKeyNotifier = ref.read(virtKeyboardProvider.notifier);
|
||||
|
||||
// Set the terminal input handler
|
||||
_terminal.inputHandler = virtKeyNotifier;
|
||||
|
||||
return _buildVirtualKey(virtKeyState, virtKeyNotifier);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user