Skip to content

Commit

Permalink
The Main Scaffold only extends its body if necessary (full overlap or…
Browse files Browse the repository at this point in the history
… hidden navbar) to prevent unnecessary padding (equal to navbar height)
  • Loading branch information
jb3rndt committed Mar 24, 2024
1 parent 419e30f commit 0ac67b3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/components/persistent_tab_view_scaffold.dart
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class PersistentTabViewScaffold extends StatefulWidget {

class _PersistentTabViewScaffoldState extends State<PersistentTabViewScaffold>
with TickerProviderStateMixin {
late bool _navBarFullyShown;
late bool _navBarFullyShown = !widget.hideNavigationBar;
late final AnimationController _hideNavBarAnimationController =
AnimationController(
vsync: this,
Expand All @@ -91,7 +91,6 @@ class _PersistentTabViewScaffoldState extends State<PersistentTabViewScaffold>
@override
void initState() {
super.initState();
_navBarFullyShown = !widget.hideNavigationBar;
if (widget.hideNavigationBar) {
_hideNavBarAnimationController.value = 1.0;
}
Expand Down Expand Up @@ -149,7 +148,7 @@ class _PersistentTabViewScaffoldState extends State<PersistentTabViewScaffold>
key: widget.controller.scaffoldKey,
resizeToAvoidBottomInset: widget.resizeToAvoidBottomInset,
backgroundColor: widget.backgroundColor,
extendBody: true,
extendBody: widget.navBarOverlap.overlap != 0 || !_navBarFullyShown,
floatingActionButton: widget.floatingActionButton,
floatingActionButtonLocation: widget.floatingActionButtonLocation,
drawerEdgeDragWidth: widget.drawerEdgeDragWidth,
Expand Down

0 comments on commit 0ac67b3

Please sign in to comment.