Skip to content
This repository has been archived by the owner on Feb 25, 2024. It is now read-only.

Commit

Permalink
refactor: removed else
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLiux committed Oct 6, 2023
1 parent 2b408f4 commit d85580f
Showing 1 changed file with 26 additions and 26 deletions.
52 changes: 26 additions & 26 deletions example/lib/src/home/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,33 +113,33 @@ class HomePageState extends State<HomePage> {
),
],
);
} else {
return Column(
children: [
Expanded(
child: Center(
child: _items.entries.elementAt(_selectedIndex).key,
),
),
const Divider(
height: 0.0,
),
NavigationBar(
destinations: [
for (final item in _items.entries)
NavigationDestination(
icon: item.value.$1,
selectedIcon: item.value.$2,
label: item.value.$3,
),
],
selectedIndex: _selectedIndex,
onDestinationSelected: (index) =>
setState(() => _selectedIndex = index),
),
],
);
}

return Column(
children: [
Expanded(
child: Center(
child: _items.entries.elementAt(_selectedIndex).key,
),
),
const Divider(
height: 0.0,
),
NavigationBar(
destinations: [
for (final item in _items.entries)
NavigationDestination(
icon: item.value.$1,
selectedIcon: item.value.$2,
label: item.value.$3,
),
],
selectedIndex: _selectedIndex,
onDestinationSelected: (index) =>
setState(() => _selectedIndex = index),
),
],
);
},
),
);
Expand Down

0 comments on commit d85580f

Please sign in to comment.