Skip to content

Commit d46c379

Browse files
committed
Make some code fixes
1 parent eeaf371 commit d46c379

File tree

1 file changed

+17
-32
lines changed

1 file changed

+17
-32
lines changed

lib/src/widgets/bottom_bar_with_sheet_item.dart

Lines changed: 17 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -39,48 +39,33 @@ class BottomBarWithSheetItemWidget extends StatelessWidget {
3939

4040
List<Widget> get _items {
4141
final items = <Widget>[
42-
if (theme.isVerticalItemLabel) Spacer(),
42+
if (!theme.isVerticalItemLabel) Spacer(),
4343
Icon(
4444
model.icon,
4545
color: isSelected ? theme.selectedItemIconColor : theme.itemIconColor,
4646
size: isSelected ? theme.selectedItemIconSize : theme.itemIconSize,
4747
),
48-
];
49-
50-
if (model.label != null) {
51-
if (theme.isVerticalItemLabel) {
52-
items.addAll(
53-
[
54-
SizedBox(
55-
height: 2,
56-
),
57-
Text(
48+
if (model.label != null)
49+
if (theme.isVerticalItemLabel) ...[
50+
SizedBox(height: 2),
51+
Text(
52+
model.label!,
53+
style:
54+
isSelected ? theme.selectedItemTextStyle : theme.itemTextStyle,
55+
),
56+
] else ...[
57+
SizedBox(width: 2),
58+
Expanded(
59+
flex: 2,
60+
child: Text(
5861
model.label!,
5962
style: isSelected
6063
? theme.selectedItemTextStyle
6164
: theme.itemTextStyle,
6265
),
63-
],
64-
);
65-
} else {
66-
items.addAll(
67-
[
68-
SizedBox(
69-
width: 2,
70-
),
71-
Expanded(
72-
flex: 2,
73-
child: Text(
74-
model.label!,
75-
style: isSelected
76-
? theme.selectedItemTextStyle
77-
: theme.itemTextStyle,
78-
),
79-
),
80-
],
81-
);
82-
}
83-
}
66+
),
67+
],
68+
];
8469

8570
return items;
8671
}

0 commit comments

Comments
 (0)