diff --git a/lib/main.dart b/lib/main.dart index e0e0002..f084cdb 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -111,36 +111,42 @@ class MyHome extends StatelessWidget { ), ], ), - body: Container(), - bottomNavigationBar: GNav( - onTabChange: (index) {}, - gap: 8, - backgroundColor: Theme.of(context).colorScheme.secondary, - color: Theme.of(context).colorScheme.onSurface, - activeColor: Theme.of(context).colorScheme.onPrimary, - tabBackgroundColor: Theme.of(context).colorScheme.primary, - tabs: const [ - GButton( - icon: Icons.food_bank, - text: "Essen", - ), - GButton( - icon: Icons.room, - text: "Ambiente", - ), - GButton( - icon: Icons.person, - text: "Service", - ), - GButton( - icon: Icons.question_mark, - text: "Verschläge", - ), - GButton( - icon: Icons.add_rounded, - text: "Verbesserungen", - ), - ], + body: Consumer( + builder: (context, pageProvider, child) { + return pageProvider.pages[pageProvider.selectedPage]; + }, + ), + bottomNavigationBar: Padding( + padding: EdgeInsets.all(5), + child: GNav( + onTabChange: (index) { + Provider.of(context, listen: false).changePage(index); + }, + gap: 8, + style: GnavStyle.google, + backgroundColor: Theme.of(context).colorScheme.surface, + color: Theme.of(context).colorScheme.onSurface, + activeColor: Theme.of(context).colorScheme.onPrimary, + tabBackgroundColor: Theme.of(context).colorScheme.primary, + tabs: const [ + GButton( + icon: Icons.fastfood_outlined, + text: "Essen", + ),GButton( + icon: Icons.landscape, + text: "Ambiente", + ),GButton( + icon: Icons.mood, + text: "Service", + ),GButton( + icon: Icons.feedback, + text: "Verschläge", + ), GButton( + icon: Icons.comment, + text: "Verbesserungen", + ), + ], + ), ), ); }