File tree Expand file tree Collapse file tree
modules/ensemble/lib/layout Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ class TabBarController extends BoxController {
3131
3232 int selectedIndex = 0 ;
3333
34+ bool persistentTabBar = false ;
35+
3436 List <TabItem > _originalItems = [];
3537 List <TabItem > _visibleItems = [];
3638
Original file line number Diff line number Diff line change @@ -90,6 +90,8 @@ abstract class BaseTabBar extends StatefulWidget
9090 EnsembleAction .from (action, initiator: this ),
9191 'onTabSelectionHaptic' : (value) =>
9292 _controller.onTabSelectionHaptic = Utils .optionalString (value),
93+ 'persistentTabBar' : (value) =>
94+ _controller.persistentTabBar = Utils .getBool (value, fallback: false ),
9395 };
9496 }
9597}
@@ -282,7 +284,12 @@ class TabBarState extends BaseTabBarState {
282284 // builder gives us dynamic height control vs TabBarView, but
283285 // is sub-optimal since it recreates the tab content on each pass.
284286 // This means onLoad API may be called multiple times in debug mode
285- tabContent
287+
288+ widget._controller.persistentTabBar
289+ ? Expanded (
290+ child: SingleChildScrollView (
291+ child: tabContent))
292+ : tabContent,
286293
287294 // This cause Expanded child to fail
288295 // Padding(
@@ -320,4 +327,4 @@ class TabBarState extends BaseTabBarState {
320327 }
321328 return const Text ("Unknown widget for this Tab" );
322329 }
323- }
330+ }
You can’t perform that action at this time.
0 commit comments