Default Layout NavBar
This commit is contained in:
+68
-6
@@ -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",
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class PageProvider extends ChangeNotifier {
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user