Implemented Send and Delete

Floating Action Button + Semi floating action button
This commit is contained in:
Jonas Braus
2024-11-21 16:07:16 +01:00
parent 5dd69624b2
commit 488abbbb53
+63 -12
View File
@@ -51,7 +51,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(
@@ -63,7 +62,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,
@@ -73,7 +73,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,
@@ -121,18 +122,63 @@ 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,
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( child: GNav(
onTabChange: (index) { onTabChange: (index) {
Provider.of<PageProvider>(context, listen: false).changePage(index); Provider.of<PageProvider>(context, listen: false)
.changePage(index);
}, },
gap: 8, gap: 8,
style: GnavStyle.google, style: GnavStyle.google,
backgroundColor: Theme.of(context).colorScheme.surface, backgroundColor: Colors.transparent,
color: Theme.of(context).colorScheme.onSurface, color: Theme.of(context).colorScheme.onSurface,
activeColor: Theme.of(context).colorScheme.onPrimary, activeColor: Theme.of(context).colorScheme.onPrimary,
tabBackgroundColor: Theme.of(context).colorScheme.primary, tabBackgroundColor: Theme.of(context).colorScheme.primary,
@@ -140,22 +186,27 @@ class MyHome extends StatelessWidget {
GButton( GButton(
icon: Icons.fastfood_outlined, icon: Icons.fastfood_outlined,
text: "Essen", text: "Essen",
),GButton( ),
GButton(
icon: Icons.landscape, icon: Icons.landscape,
text: "Ambiente", text: "Ambiente",
),GButton( ),
GButton(
icon: Icons.mood, icon: Icons.mood,
text: "Service", text: "Service",
),GButton( ),
GButton(
icon: Icons.feedback, icon: Icons.feedback,
text: "Anmerkungen", text: "Anmerkungen",
), GButton( ),
GButton(
icon: Icons.grass, icon: Icons.grass,
text: "Spezielle Ernährung", text: "Spezielle Ernährung",
), ),
], ],
), ),
), ),
),
); );
} }
} }