Skip to content

Commit 22accf8

Browse files
authored
Merge pull request #524 from EnsembleUI/bottom-nav-bar-with-fab
Removed empty sized box for floating button when floating is false
2 parents ae69b2a + 88e1d71 commit 22accf8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/framework/view/bottom_nav_page_group.dart

+5
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ class _BottomNavPageGroupState extends State<BottomNavPageGroup> {
194194
notchedShape: const CircularNotchedRectangle(),
195195
onTabSelected: widget.onTabSelected,
196196
items: navItems,
197+
isFloating: fabMenuItem != null,
197198
floatingAlignment: floatingAlignment,
198199
floatingMargin: floatingMargin,
199200
);
@@ -224,6 +225,7 @@ class EnsembleBottomAppBar extends StatefulWidget {
224225
required this.selectedColor,
225226
required this.notchedShape,
226227
required this.onTabSelected,
228+
required this.isFloating,
227229
required this.floatingAlignment,
228230
this.onFabTapped,
229231
this.floatingMargin,
@@ -237,6 +239,7 @@ class EnsembleBottomAppBar extends StatefulWidget {
237239
final Color backgroundColor;
238240
final Color color;
239241
final Color selectedColor;
242+
final bool isFloating;
240243
final FloatingAlignment floatingAlignment;
241244
final NotchedShape notchedShape;
242245
final VoidCallback? onFabTapped;
@@ -258,6 +261,8 @@ class EnsembleBottomAppBarState extends State<EnsembleBottomAppBar> {
258261
}
259262

260263
int? getFabIndex() {
264+
if (!widget.isFloating) return null;
265+
261266
switch (widget.floatingAlignment) {
262267
case FloatingAlignment.center:
263268
switch (widget.items.length) {

0 commit comments

Comments
 (0)