Pages Added + Provider Function Extented
Missing Pages were added (currently no content) Provider changes the title to the right one
This commit is contained in:
+22
-19
@@ -46,6 +46,7 @@ class MyHome extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
|
||||
appBar: AppBar(
|
||||
leading: IconButton(
|
||||
icon: Icon(
|
||||
@@ -57,22 +58,24 @@ class MyHome extends StatelessWidget {
|
||||
// Aktion für diesen Button
|
||||
},
|
||||
),
|
||||
title: Container(
|
||||
height: 40,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context)
|
||||
.colorScheme
|
||||
.primaryContainer, // Hintergrundfarbe des Textfelds
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
"Placeholder",
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.onPrimary,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
title: Consumer<PageProvider>( // Consumer verwenden, um den dynamischen Titel anzuzeigen
|
||||
builder: (context, pageProvider, child) {
|
||||
return Container(
|
||||
height: 40,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).colorScheme.primaryContainer,
|
||||
borderRadius: BorderRadius.circular(15),
|
||||
),
|
||||
alignment: Alignment.centerLeft,
|
||||
child: Text(
|
||||
pageProvider.selectedPageTitle, // Hier wird der dynamische Titel angezeigt
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.onPrimary,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
backgroundColor: Theme.of(context).colorScheme.primary,
|
||||
actions: [
|
||||
@@ -140,10 +143,10 @@ class MyHome extends StatelessWidget {
|
||||
text: "Service",
|
||||
),GButton(
|
||||
icon: Icons.feedback,
|
||||
text: "Verschläge",
|
||||
text: "Anmerkungen",
|
||||
), GButton(
|
||||
icon: Icons.comment,
|
||||
text: "Verbesserungen",
|
||||
icon: Icons.grass,
|
||||
text: "Spezielle Ernährung",
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user