Merge branch 'SendDeleteButton' into 'main'

Implemented Send and Delete

See merge request brausjonas/mensaapp!7
This commit is contained in:
Jonas Braus
2024-11-21 15:19:36 +00:00
+84 -33
View File
@@ -55,7 +55,6 @@ class MyHome extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
leading: IconButton( leading: IconButton(
icon: Icon( icon: Icon(
@@ -67,7 +66,8 @@ class MyHome extends StatelessWidget {
// Aktion für diesen Button // Aktion für diesen Button
}, },
), ),
title: Consumer<PageProvider>( // Consumer verwenden, um den dynamischen Titel anzuzeigen title: Consumer<PageProvider>(
// Consumer verwenden, um den dynamischen Titel anzuzeigen
builder: (context, pageProvider, child) { builder: (context, pageProvider, child) {
return Container( return Container(
height: 40, height: 40,
@@ -77,7 +77,8 @@ class MyHome extends StatelessWidget {
), ),
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: Text( child: Text(
pageProvider.titleString[pageProvider.selectedPage], // Hier wird der dynamische Titel angezeigt pageProvider.titleString[pageProvider.selectedPage],
// Hier wird der dynamische Titel angezeigt
style: TextStyle( style: TextStyle(
color: Theme.of(context).colorScheme.onPrimary, color: Theme.of(context).colorScheme.onPrimary,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@@ -125,39 +126,89 @@ class MyHome extends StatelessWidget {
), ),
body: Consumer<PageProvider>( body: Consumer<PageProvider>(
builder: (context, pageProvider, child) { 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( floatingActionButton: Column(
padding: EdgeInsets.all(5), mainAxisSize: MainAxisSize.min,
child: GNav( children: [
onTabChange: (index) { const Text(
Provider.of<PageProvider>(context, listen: false).changePage(index); "* Pflichtfeld",
}, style: TextStyle(fontSize: 15),
gap: 8, ),
style: GnavStyle.google, const SizedBox(
backgroundColor: Theme.of(context).colorScheme.surface, height: 10,
color: Theme.of(context).colorScheme.onSurface, ),
activeColor: Theme.of(context).colorScheme.onPrimary, FloatingActionButton.extended(
tabBackgroundColor: Theme.of(context).colorScheme.primary, onPressed: () {},
tabs: const [ label: const Text(
GButton( "Absenden",
icon: Icons.fastfood_outlined, style: TextStyle(fontSize: 20),
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",
), ),
], 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<PageProvider>(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",
),
],
),
), ),
), ),
); );