Merge branch 'alis_dev_branch' into 'main'

AppBar Version 1

See merge request brausjonas/mensaapp!2
This commit is contained in:
Jonas Braus
2024-11-21 11:49:53 +00:00
5 changed files with 111 additions and 54 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

+81 -25
View File
@@ -32,12 +32,10 @@ class MyApp extends StatelessWidget {
onSurface: Color.fromRGBO(60, 60, 60, 1), onSurface: Color.fromRGBO(60, 60, 60, 1),
brightness: Brightness.light, brightness: Brightness.light,
tertiary: Color.fromRGBO(251, 216, 17, 0), tertiary: Color.fromRGBO(251, 216, 17, 0),
onTertiary: Color.fromRGBO(60, 60, 60, 1) onTertiary: Color.fromRGBO(60, 60, 60, 1)),
),
useMaterial3: true, useMaterial3: true,
), ),
home: const MyHome() home: const MyHome()),
),
); );
} }
} }
@@ -48,44 +46,102 @@ class MyHome extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: AppBar(), appBar: AppBar(
body: Consumer<PageProvider>( leading: IconButton(
builder: (context, pageProvider, child) { icon: Icon(
return pageProvider.pages[pageProvider.selectedPage]; Icons.home,
size: 36,
color: Theme.of(context).colorScheme.onPrimary,
),
onPressed: () {
// Aktion für diesen Button
}, },
), ),
bottomNavigationBar: Padding( title: Container(
padding: EdgeInsets.all(5), height: 40,
child: GNav( decoration: BoxDecoration(
onTabChange: (index) { color: Theme.of(context)
Provider.of<PageProvider>(context, listen: false).changePage(index); .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,
),
),
),
backgroundColor: Theme.of(context).colorScheme.primary,
actions: [
IconButton(
icon: Image.asset(
'assets/flags/de.png',
width: 34,
height: 24,
fit: BoxFit.cover,
), // Erster Button rechts
onPressed: () {
// Aktion für diesen Button
}, },
),
IconButton(
icon: Image.asset(
'assets/flags/fr.png',
width: 34,
height: 24,
fit: BoxFit.cover,
), // Zweiter Button rechts
onPressed: () {
// Aktion für diesen Button
},
),
IconButton(
icon: Image.asset(
'assets/flags/en.png',
width: 34,
height: 24,
fit: BoxFit.cover,
), // Dritter Button rechts
onPressed: () {
// Aktion für diesen Button
},
),
],
),
body: Container(),
bottomNavigationBar: GNav(
onTabChange: (index) {},
gap: 8, gap: 8,
style: GnavStyle.google, backgroundColor: Theme.of(context).colorScheme.secondary,
backgroundColor: Theme.of(context).colorScheme.surface,
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,
tabs: const [ tabs: const [
GButton( GButton(
icon: Icons.fastfood_outlined, icon: Icons.food_bank,
text: "Essen", text: "Essen",
),GButton( ),
icon: Icons.landscape, GButton(
icon: Icons.room,
text: "Ambiente", text: "Ambiente",
),GButton( ),
icon: Icons.mood, GButton(
icon: Icons.person,
text: "Service", text: "Service",
),GButton( ),
icon: Icons.feedback, GButton(
icon: Icons.question_mark,
text: "Verschläge", text: "Verschläge",
), GButton( ),
icon: Icons.comment, GButton(
icon: Icons.add_rounded,
text: "Verbesserungen", text: "Verbesserungen",
), ),
], ],
), ),
)
); );
} }
} }
+2 -1
View File
@@ -54,7 +54,8 @@ dev_dependencies:
# The following section is specific to Flutter packages. # The following section is specific to Flutter packages.
flutter: flutter:
assets:
- assets/flags/
# The following line ensures that the Material Icons font is # The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in # included with your application, so that you can use the icons in
# the material Icons class. # the material Icons class.