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
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
super.build(context);
|
super.build(context);
|
||||||
return Scaffold(body: _buildBody);
|
return Scaffold(body: SafeArea(child: _buildBody));
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget get _buildBody {
|
Widget get _buildBody {
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class _PrivateKeyListState extends ConsumerState<PrivateKeysListPage> with After
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: _buildBody(),
|
body: SafeArea(child: _buildBody()),
|
||||||
floatingActionButton: FloatingActionButton(
|
floatingActionButton: FloatingActionButton(
|
||||||
child: const Icon(Icons.add),
|
child: const Icon(Icons.add),
|
||||||
onPressed: () => PrivateKeyEditPage.route.go(context),
|
onPressed: () => PrivateKeyEditPage.route.go(context),
|
||||||
|
|||||||
@@ -11,9 +11,10 @@ final class _AppAboutPageState extends State<_AppAboutPage> with AutomaticKeepAl
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
super.build(context);
|
super.build(context);
|
||||||
return ListView(
|
return SafeArea(
|
||||||
padding: const EdgeInsets.all(13),
|
child: ListView(
|
||||||
children: [
|
padding: const EdgeInsets.all(13),
|
||||||
|
children: [
|
||||||
UIs.height13,
|
UIs.height13,
|
||||||
ConstrainedBox(constraints: const BoxConstraints(maxHeight: 47, maxWidth: 47), child: UIs.appIcon),
|
ConstrainedBox(constraints: const BoxConstraints(maxHeight: 47, maxWidth: 47), child: UIs.appIcon),
|
||||||
const Text('${BuildData.name}\nv${BuildData.build}', textAlign: TextAlign.center, style: UIs.text15),
|
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,
|
).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() {
|
Widget _buildBottom() {
|
||||||
return AnimatedPadding(
|
return SafeArea(
|
||||||
padding: _media.viewInsets,
|
top: false,
|
||||||
duration: const Duration(milliseconds: 23),
|
child: AnimatedPadding(
|
||||||
curve: Curves.fastOutSlowIn,
|
padding: _media.viewInsets,
|
||||||
child: Container(
|
duration: const Duration(milliseconds: 23),
|
||||||
color: _terminalTheme.background,
|
curve: Curves.fastOutSlowIn,
|
||||||
height: _virtKeysHeight + _media.padding.bottom,
|
child: Container(
|
||||||
child: Consumer(
|
color: _terminalTheme.background,
|
||||||
builder: (context, ref, child) {
|
height: _virtKeysHeight,
|
||||||
final virtKeyState = ref.watch(virtKeyboardProvider);
|
child: Consumer(
|
||||||
final virtKeyNotifier = ref.read(virtKeyboardProvider.notifier);
|
builder: (context, ref, child) {
|
||||||
|
final virtKeyState = ref.watch(virtKeyboardProvider);
|
||||||
// Set the terminal input handler
|
final virtKeyNotifier = ref.read(virtKeyboardProvider.notifier);
|
||||||
_terminal.inputHandler = virtKeyNotifier;
|
|
||||||
|
// Set the terminal input handler
|
||||||
return _buildVirtualKey(virtKeyState, virtKeyNotifier);
|
_terminal.inputHandler = virtKeyNotifier;
|
||||||
},
|
|
||||||
|
return _buildVirtualKey(virtKeyState, virtKeyNotifier);
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user