improve android navigation bar

This commit is contained in:
nyne
2024-10-31 11:42:17 +08:00
parent a09fb0e81c
commit a508d85ce6
3 changed files with 18 additions and 5 deletions

View File

@@ -107,6 +107,11 @@ class _ReaderScaffoldState extends State<_ReaderScaffold> {
}
void openOrClose() {
if(!_isOpen) {
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
} else {
SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersive);
}
setState(() {
_isOpen = !_isOpen;
});
@@ -142,10 +147,9 @@ class _ReaderScaffoldState extends State<_ReaderScaffold> {
),
AnimatedPositioned(
duration: const Duration(milliseconds: 180),
bottom: _isOpen ? 0 : -(kBottomBarHeight + context.padding.bottom),
bottom: _isOpen ? 0 : -kBottomBarHeight,
left: 0,
right: 0,
height: kBottomBarHeight + context.padding.bottom,
child: buildBottom(),
),
],
@@ -200,7 +204,7 @@ class _ReaderScaffoldState extends State<_ReaderScaffold> {
}
Widget child = SizedBox(
height: kBottomBarHeight + MediaQuery.of(context).padding.bottom,
height: kBottomBarHeight,
child: Column(
children: [
const SizedBox(