Default Layout NavBar
This commit is contained in:
+67
-5
@@ -1,4 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
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() {
|
void main() {
|
||||||
runApp(const MyApp());
|
runApp(const MyApp());
|
||||||
@@ -10,12 +13,71 @@ class MyApp extends StatelessWidget {
|
|||||||
// This widget is the root of your application.
|
// This widget is the root of your application.
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return MaterialApp(
|
return MultiProvider(
|
||||||
theme: ThemeData(
|
providers: [
|
||||||
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
|
ChangeNotifierProvider(
|
||||||
useMaterial3: true,
|
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 {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -75,6 +75,14 @@ packages:
|
|||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
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:
|
leak_tracker:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ dependencies:
|
|||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
provider: ^6.1.2
|
provider: ^6.1.2
|
||||||
|
google_nav_bar: ^5.0.7
|
||||||
|
|
||||||
|
|
||||||
# The following adds the Cupertino Icons font to your application.
|
# The following adds the Cupertino Icons font to your application.
|
||||||
|
|||||||
Reference in New Issue
Block a user