Merge branch 'SendDeleteButton' into 'main'
Implemented Send and Delete See merge request brausjonas/mensaapp!7
This commit is contained in:
+84
-33
@@ -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<PageProvider>( // Consumer verwenden, um den dynamischen Titel anzuzeigen
|
||||
title: Consumer<PageProvider>(
|
||||
// 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<PageProvider>(
|
||||
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<PageProvider>(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<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",
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user