diff --git a/lib/main.dart b/lib/main.dart index 4fcc918..855f281 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -55,7 +55,6 @@ class MyHome extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - appBar: AppBar( leading: IconButton( icon: Icon( @@ -67,7 +66,8 @@ class MyHome extends StatelessWidget { // Aktion für diesen Button }, ), - title: Consumer( // Consumer verwenden, um den dynamischen Titel anzuzeigen + title: Consumer( + // Consumer verwenden, um den dynamischen Titel anzuzeigen builder: (context, pageProvider, child) { return Container( height: 40, @@ -77,7 +77,8 @@ class MyHome extends StatelessWidget { ), alignment: Alignment.centerLeft, child: Text( - pageProvider.titleString[pageProvider.selectedPage], // Hier wird der dynamische Titel angezeigt + pageProvider.titleString[pageProvider.selectedPage], + // Hier wird der dynamische Titel angezeigt style: TextStyle( color: Theme.of(context).colorScheme.onPrimary, fontWeight: FontWeight.bold, @@ -125,39 +126,89 @@ class MyHome extends StatelessWidget { ), body: Consumer( builder: (context, pageProvider, child) { - return pageProvider.pages[pageProvider.selectedPage]; + return Stack( + children: [ + pageProvider.pages[pageProvider.selectedPage], + Positioned( + left: 10, + bottom: 10, + child: IconButton.filled( + padding: const EdgeInsets.all(15), + onPressed: () {}, + icon: const Icon( + Icons.delete, + size: 30, + ), + style: ButtonStyle( + shape: WidgetStateProperty.all(RoundedRectangleBorder( + borderRadius: BorderRadius.circular(17))), + backgroundColor: WidgetStateProperty.all( + Theme.of(context).colorScheme.primary, + )), + ), + ) + ], + ); }, ), - 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: "Anmerkungen", - ), GButton( - icon: Icons.grass, - text: "Spezielle Ernährung", + floatingActionButton: Column( + mainAxisSize: MainAxisSize.min, + children: [ + const Text( + "* Pflichtfeld", + style: TextStyle(fontSize: 15), + ), + const SizedBox( + height: 10, + ), + FloatingActionButton.extended( + onPressed: () {}, + label: const Text( + "Absenden", + style: TextStyle(fontSize: 20), ), - ], + icon: const Icon(Icons.send), + ) + ], + ), + bottomNavigationBar: Container( + color: Theme.of(context).colorScheme.secondary, + child: Padding( + padding: const EdgeInsets.all(5), + child: GNav( + onTabChange: (index) { + Provider.of(context, listen: false) + .changePage(index); + }, + gap: 8, + style: GnavStyle.google, + backgroundColor: Colors.transparent, + 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: "Anmerkungen", + ), + GButton( + icon: Icons.grass, + text: "Spezielle Ernährung", + ), + ], + ), ), ), );