Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions modules/ensemble/lib/layout/tab/tab_bar_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class TabBarController extends BoxController {

int selectedIndex = 0;

bool persistentTabBar = false;

List<TabItem> _originalItems = [];
List<TabItem> _visibleItems = [];

Expand Down
11 changes: 9 additions & 2 deletions modules/ensemble/lib/layout/tab_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ abstract class BaseTabBar extends StatefulWidget
EnsembleAction.from(action, initiator: this),
'onTabSelectionHaptic': (value) =>
_controller.onTabSelectionHaptic = Utils.optionalString(value),
'persistentTabBar': (value) =>
_controller.persistentTabBar = Utils.getBool(value, fallback: false),
};
}
}
Expand Down Expand Up @@ -282,7 +284,12 @@ class TabBarState extends BaseTabBarState {
// builder gives us dynamic height control vs TabBarView, but
// is sub-optimal since it recreates the tab content on each pass.
// This means onLoad API may be called multiple times in debug mode
tabContent

widget._controller.persistentTabBar
? Expanded(
child: SingleChildScrollView(
child: tabContent))
: tabContent,

// This cause Expanded child to fail
// Padding(
Expand Down Expand Up @@ -320,4 +327,4 @@ class TabBarState extends BaseTabBarState {
}
return const Text("Unknown widget for this Tab");
}
}
}
Loading