new bottom navigation
This commit is contained in:
+29
-43
@@ -14,7 +14,6 @@ import '../providers/spezielleErnaehrungProvider.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:restart_app/restart_app.dart';
|
||||
|
||||
|
||||
class SpaceRate extends StatelessWidget {
|
||||
const SpaceRate({super.key});
|
||||
|
||||
@@ -62,8 +61,7 @@ class SpaceRate extends StatelessWidget {
|
||||
.resetAllFields();
|
||||
Provider.of<PageProvider>(context, listen: false)
|
||||
.resetSelectedEssen();
|
||||
Provider.of<PageProvider>(context, listen: false)
|
||||
.changePage(0);
|
||||
Provider.of<PageProvider>(context, listen: false).changePage(0);
|
||||
Provider.of<SpaceProvider>(context, listen: false)
|
||||
.setSelectedSpace(0);
|
||||
Provider.of<LanguageProvider>(context, listen: false)
|
||||
@@ -95,7 +93,7 @@ class SpaceRate extends StatelessWidget {
|
||||
),
|
||||
title: Text("Backend-IP ändern"),
|
||||
content: TextField(
|
||||
controller: _ipController,// IP-Format unterstützen
|
||||
controller: _ipController, // IP-Format unterstützen
|
||||
decoration: InputDecoration(
|
||||
border: OutlineInputBorder(),
|
||||
labelText: 'Neue Backend-IP (z. B. 192.168.1.1)',
|
||||
@@ -109,7 +107,8 @@ class SpaceRate extends StatelessWidget {
|
||||
if (newIp.isEmpty) {
|
||||
// Falls das Feld leer ist, gib eine Warnung aus
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text("Die IP-Adresse darf nicht leer sein!")),
|
||||
SnackBar(
|
||||
content: Text("Die IP-Adresse darf nicht leer sein!")),
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -197,9 +196,6 @@ class SpaceRate extends StatelessWidget {
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Consumer<LanguageProvider>(builder: (context, languageProvider, x) {
|
||||
@@ -341,9 +337,7 @@ class SpaceRate extends StatelessWidget {
|
||||
),
|
||||
FloatingActionButton.extended(
|
||||
onPressed: () {
|
||||
DatabaseService().getAllRatings(
|
||||
context
|
||||
);
|
||||
DatabaseService().getAllRatings(context);
|
||||
|
||||
/*DatabaseService.getAllRatings(
|
||||
Provider.of<ServiceProvider>(context), Provider.of<EssenProvider>(context), Provider.of<SpezielleErnaehrungProvider>(context)); // Passe den Kontext an, falls nötig
|
||||
@@ -361,39 +355,31 @@ class SpaceRate extends StatelessWidget {
|
||||
),
|
||||
bottomNavigationBar: Container(
|
||||
color: Theme.of(context).colorScheme.secondary,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(5),
|
||||
child: GNav(
|
||||
onTabChange: (index) {
|
||||
Provider.of<PageProvider>(context, listen: false)
|
||||
.changePage(index);
|
||||
},
|
||||
gap: 8,
|
||||
style: GnavStyle.google,
|
||||
backgroundColor: Colors.transparent,
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
activeColor: Theme.of(context).colorScheme.onPrimary,
|
||||
tabBackgroundColor: Theme.of(context).colorScheme.primary,
|
||||
tabs: [
|
||||
GButton(
|
||||
icon: Icons.fastfood_outlined,
|
||||
text: Provider.of<LanguageProvider>(context).languageData[
|
||||
Provider.of<LanguageProvider>(context).language]
|
||||
["navBar"]["0"],
|
||||
),
|
||||
GButton(
|
||||
icon: Icons.mood,
|
||||
text: Provider.of<LanguageProvider>(context).languageData[
|
||||
Provider.of<LanguageProvider>(context).language]
|
||||
["navBar"]["1"],
|
||||
),
|
||||
GButton(
|
||||
icon: Icons.favorite,
|
||||
text: Provider.of<LanguageProvider>(context).languageData[
|
||||
Provider.of<LanguageProvider>(context).language]
|
||||
["navBar"]["2"],
|
||||
),
|
||||
child: Consumer<PageProvider>(
|
||||
builder: (context, pageProv, child) => BottomNavigationBar(
|
||||
items: [
|
||||
BottomNavigationBarItem(
|
||||
icon: const Icon(Icons.fastfood_outlined),
|
||||
label: Provider.of<LanguageProvider>(context).languageData[
|
||||
Provider.of<LanguageProvider>(context).language]
|
||||
["navBar"]["0"]),
|
||||
BottomNavigationBarItem(
|
||||
icon: const Icon(Icons.mood),
|
||||
label: Provider.of<LanguageProvider>(context).languageData[
|
||||
Provider.of<LanguageProvider>(context).language]
|
||||
["navBar"]["1"]),
|
||||
BottomNavigationBarItem(
|
||||
icon: const Icon(Icons.favorite),
|
||||
backgroundColor: Colors.black,
|
||||
label: Provider.of<LanguageProvider>(context).languageData[
|
||||
Provider.of<LanguageProvider>(context).language]
|
||||
["navBar"]["2"])
|
||||
],
|
||||
backgroundColor: const Color.fromARGB(255, 220, 220, 220),
|
||||
elevation: 0,
|
||||
landscapeLayout: BottomNavigationBarLandscapeLayout.linear,
|
||||
currentIndex: pageProv.selectedPage,
|
||||
onTap: (value) => pageProv.changePage(value),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user