Skip to content

Instantly share code, notes, and snippets.

@sbis04
Created October 27, 2020 09:34
Show Gist options
  • Save sbis04/147965fba8cc1a99131c2b4f2e869543 to your computer and use it in GitHub Desktop.
Save sbis04/147965fba8cc1a99131c2b4f2e869543 to your computer and use it in GitHub Desktop.
class _HomeViewLargeState extends State<HomeViewLarge> {
int _index = 0;
@override
Widget build(BuildContext context) {
return Container(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
flex: 2,
child: MenuWidget(
selectedIndex: _index,
onTapped: (selectedIndex) {
setState(() {
_index = selectedIndex;
});
},
),
),
Expanded(
flex: 3,
child: IndexedStack(
index: _index,
children: allDestinations.map<Widget>((Destination destination) {
return DestinationView(destination);
}).toList(),
),
),
],
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment