Default Layout NavBar

This commit is contained in:
Jonas Braus
2024-11-21 11:11:45 +01:00
parent 497fefd17c
commit 412d111b10
6 changed files with 82 additions and 6 deletions
+67 -5
View File
@@ -1,4 +1,7 @@
import 'package:flutter/material.dart';
import 'package:google_nav_bar/google_nav_bar.dart';
import 'package:mensaapp/providers/pageProvider.dart';
import 'package:provider/provider.dart';
void main() {
runApp(const MyApp());
@@ -10,12 +13,71 @@ class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
return MultiProvider(
providers: [
ChangeNotifierProvider(
create: (context) => PageProvider(),
)
],
child: MaterialApp(
theme: ThemeData(
colorScheme: const ColorScheme(
primary: Color.fromRGBO(236, 92, 61, 1),
onPrimary: Color.fromRGBO(240, 240, 240, 1),
secondary: Color.fromRGBO(203, 203, 203, 1),
onSecondary: Color.fromRGBO(60, 60, 60, 1),
error: Colors.red,
onError: Colors.white,
surface: Colors.white,
onSurface: Color.fromRGBO(60, 60, 60, 1),
brightness: Brightness.light,
tertiary: Color.fromRGBO(251, 216, 17, 0),
onTertiary: Color.fromRGBO(60, 60, 60, 1)
),
useMaterial3: true,
),
home: const MyHome()
),
home: const Placeholder(),
);
}
}
class MyHome extends StatelessWidget {
const MyHome({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: Container(),
bottomNavigationBar: GNav(
onTabChange: (index) {
},
gap: 8,
backgroundColor: Theme.of(context).colorScheme.secondary,
color: Theme.of(context).colorScheme.onSurface,
activeColor: Theme.of(context).colorScheme.onPrimary,
tabBackgroundColor: Theme.of(context).colorScheme.primary,
tabs: const [
GButton(
icon: Icons.food_bank,
text: "Essen",
),GButton(
icon: Icons.room,
text: "Ambiente",
),GButton(
icon: Icons.person,
text: "Service",
),GButton(
icon: Icons.question_mark,
text: "Verschläge",
), GButton(
icon: Icons.add_rounded,
text: "Verbesserungen",
),
],
),
);
}
}
View File
+5
View File
@@ -0,0 +1,5 @@
import 'package:flutter/material.dart';
class PageProvider extends ChangeNotifier {
}
View File
+8
View File
@@ -75,6 +75,14 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
google_nav_bar:
dependency: "direct main"
description:
name: google_nav_bar
sha256: bb12dd21514ee1b041ab3127673e2fd85e693337df308f7f2b75cd1e8e92eaf4
url: "https://pub.dev"
source: hosted
version: "5.0.7"
leak_tracker:
dependency: transitive
description:
+1
View File
@@ -31,6 +31,7 @@ dependencies:
flutter:
sdk: flutter
provider: ^6.1.2
google_nav_bar: ^5.0.7
# The following adds the Cupertino Icons font to your application.