mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 15:57:25 +00:00
improve android navigation bar
This commit is contained in:
@@ -16,7 +16,14 @@ class SmoothCustomScrollView extends StatelessWidget {
|
||||
return CustomScrollView(
|
||||
controller: controller,
|
||||
physics: physics,
|
||||
slivers: slivers,
|
||||
slivers: [
|
||||
...slivers,
|
||||
SliverPadding(
|
||||
padding: EdgeInsets.only(
|
||||
bottom: context.padding.bottom,
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
@@ -87,7 +94,7 @@ class _SmoothScrollProviderState extends State<SmoothScrollProvider> {
|
||||
_controller.position.minScrollExtent,
|
||||
_controller.position.maxScrollExtent,
|
||||
);
|
||||
if(_futurePosition == old) return;
|
||||
if (_futurePosition == old) return;
|
||||
_controller.animateTo(_futurePosition!,
|
||||
duration: _fastAnimationDuration, curve: Curves.linear);
|
||||
}
|
||||
|
@@ -178,11 +178,13 @@ class _SystemUiProvider extends StatelessWidget {
|
||||
systemUiStyle = SystemUiOverlayStyle.dark.copyWith(
|
||||
statusBarColor: Colors.transparent,
|
||||
systemNavigationBarColor: Colors.transparent,
|
||||
systemNavigationBarIconBrightness: Brightness.dark,
|
||||
);
|
||||
} else {
|
||||
systemUiStyle = SystemUiOverlayStyle.light.copyWith(
|
||||
statusBarColor: Colors.transparent,
|
||||
systemNavigationBarColor: Colors.transparent,
|
||||
systemNavigationBarIconBrightness: Brightness.light,
|
||||
);
|
||||
}
|
||||
return AnnotatedRegion<SystemUiOverlayStyle>(
|
||||
|
@@ -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(
|
||||
|
Reference in New Issue
Block a user