Merge branch 'selectEssenPage' into 'main'
Essen auswählen See merge request brausjonas/mensaapp!10
This commit is contained in:
@@ -11,12 +11,12 @@ android {
|
|||||||
ndkVersion = flutter.ndkVersion
|
ndkVersion = flutter.ndkVersion
|
||||||
|
|
||||||
compileOptions {
|
compileOptions {
|
||||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
sourceCompatibility = JavaVersion.VERSION_17
|
||||||
targetCompatibility = JavaVersion.VERSION_1_8
|
targetCompatibility = JavaVersion.VERSION_17
|
||||||
}
|
}
|
||||||
|
|
||||||
kotlinOptions {
|
kotlinOptions {
|
||||||
jvmTarget = JavaVersion.VERSION_1_8
|
jvmTarget = 17
|
||||||
}
|
}
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
|
|||||||
+1
-1
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
|
|||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ pluginManagement {
|
|||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
|
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
|
||||||
id "com.android.application" version "8.1.0" apply false
|
id "com.android.application" version "8.3.2" apply false
|
||||||
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
|
id "org.jetbrains.kotlin.android" version "2.0.20" apply false
|
||||||
}
|
}
|
||||||
|
|
||||||
include ":app"
|
include ":app"
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ class MyHome extends StatelessWidget {
|
|||||||
Provider.of<AmbienteProvider>(context, listen: false).resetAllFields();
|
Provider.of<AmbienteProvider>(context, listen: false).resetAllFields();
|
||||||
Provider.of<ServiceProvider>(context, listen: false).resetAllFields();
|
Provider.of<ServiceProvider>(context, listen: false).resetAllFields();
|
||||||
Provider.of<SpezielleErnaehrungProvider>(context, listen: false).resetAllFields();
|
Provider.of<SpezielleErnaehrungProvider>(context, listen: false).resetAllFields();
|
||||||
|
Provider.of<PageProvider>(context, listen: false).resetSelectedEssen();
|
||||||
|
|
||||||
// Hier Aktion für Löschen ausführen
|
// Hier Aktion für Löschen ausführen
|
||||||
Navigator.of(context).pop(); // Dialog schließen
|
Navigator.of(context).pop(); // Dialog schließen
|
||||||
|
|||||||
@@ -0,0 +1,75 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:http/http.dart' as http;
|
||||||
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
|
class FetchMenu {
|
||||||
|
static var lastFetch = DateTime.now();
|
||||||
|
static var fetched = false;
|
||||||
|
|
||||||
|
static Future<List<String>> get() async {
|
||||||
|
List<String> menus = [];
|
||||||
|
|
||||||
|
if (!fetched || DateTime.now().difference(lastFetch).inHours >= 2) {
|
||||||
|
menus = await fromRequest();
|
||||||
|
fetched = true;
|
||||||
|
} else {
|
||||||
|
menus = await fromCache();
|
||||||
|
}
|
||||||
|
|
||||||
|
return menus;
|
||||||
|
}
|
||||||
|
|
||||||
|
static Future<List<String>> fromCache() async {
|
||||||
|
return await loadCache();
|
||||||
|
}
|
||||||
|
|
||||||
|
static Future<List<String>> fromRequest() async {
|
||||||
|
List<String> menus = [];
|
||||||
|
http.Response resp = await http.get(Uri.parse(
|
||||||
|
"https://www.swfr.de/essen/mensen-cafes-speiseplaene/mensa-loerrach"));
|
||||||
|
var content = resp.body.split("<h3>");
|
||||||
|
var innerContent = content[1].split("\n");
|
||||||
|
for (var s in innerContent) {
|
||||||
|
if (s.contains("extra-text mb-15px")) {
|
||||||
|
var name = (s.split("\">")[1].split("</")[0]).replaceAll("<br>", " ");
|
||||||
|
menus.add(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
await storeCache(menus);
|
||||||
|
|
||||||
|
lastFetch = DateTime.now();
|
||||||
|
|
||||||
|
return menus;
|
||||||
|
}
|
||||||
|
|
||||||
|
static Future<void> storeCache(List<String> menus) async {
|
||||||
|
var prefs = await SharedPreferences.getInstance();
|
||||||
|
|
||||||
|
for (var i = 0; i < 4; i++) {
|
||||||
|
prefs.setString("menuCache$i", "");
|
||||||
|
if (i < menus.length) {
|
||||||
|
prefs.setString("menuCache$i", menus[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static Future<List<String>> loadCache() async {
|
||||||
|
var prefs = await SharedPreferences.getInstance();
|
||||||
|
|
||||||
|
List<String> menus = [];
|
||||||
|
|
||||||
|
for (var i = 0; i < 4; i++) {
|
||||||
|
var curr = prefs.getString("menuCache$i");
|
||||||
|
if (curr != "") {
|
||||||
|
menus.add(curr!);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return menus;
|
||||||
|
}
|
||||||
|
}
|
||||||
+73
-71
@@ -25,78 +25,80 @@ class PageAmbiente extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Center(
|
Center(
|
||||||
child: Container(
|
child: SingleChildScrollView(
|
||||||
decoration: BoxDecoration(
|
child: Container(
|
||||||
color: Colors.white.withOpacity(0.8),
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.only(
|
color: Colors.white.withOpacity(0.8),
|
||||||
topLeft: Radius.circular(80),
|
borderRadius: BorderRadius.only(
|
||||||
bottomRight: Radius.circular(80)
|
topLeft: Radius.circular(80),
|
||||||
)
|
bottomRight: Radius.circular(80)
|
||||||
),
|
)
|
||||||
width: 600,
|
),
|
||||||
height: 400,
|
width: 600,
|
||||||
padding: EdgeInsets.symmetric(horizontal: 20),
|
height: 400,
|
||||||
child: Column(
|
padding: EdgeInsets.symmetric(horizontal: 20),
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
Row(
|
children: [
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
Row(
|
||||||
children: [
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
const Text(
|
children: [
|
||||||
"Frage1*",
|
const Text(
|
||||||
style: TextStyle(fontSize: 35),
|
"Frage1*",
|
||||||
),
|
style: TextStyle(fontSize: 35),
|
||||||
Consumer<AmbienteProvider>(
|
|
||||||
builder: (context, essenProvider, child) {
|
|
||||||
return RatingStars(onRate: (value) {
|
|
||||||
essenProvider.setRatingFrage1(value);
|
|
||||||
}, initRating: essenProvider.ratingFrage1,);
|
|
||||||
},
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
const Text(
|
|
||||||
"Frage2*",
|
|
||||||
style: TextStyle(fontSize: 35),
|
|
||||||
),
|
|
||||||
Consumer<AmbienteProvider>(
|
|
||||||
builder: (context, essenProvider, child) {
|
|
||||||
return RatingStars(onRate: (value) {
|
|
||||||
essenProvider.setRatingFrage2(value);
|
|
||||||
}, initRating: essenProvider.ratingFrage2,);
|
|
||||||
},
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 50,
|
|
||||||
),
|
|
||||||
Consumer<AmbienteProvider>(
|
|
||||||
builder: (context, essenProvider, child) {
|
|
||||||
return TextFormField(
|
|
||||||
initialValue: essenProvider.freiText,
|
|
||||||
onChanged: (value) {
|
|
||||||
essenProvider.setFreiText(value);
|
|
||||||
},
|
|
||||||
autofocus: false,
|
|
||||||
maxLength: 500,
|
|
||||||
maxLines: 4,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
labelText: "Dein Feedback (optional)",
|
|
||||||
labelStyle: const TextStyle(fontSize: 20),
|
|
||||||
border: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(15)
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
style: TextStyle(fontSize: 20),
|
Consumer<AmbienteProvider>(
|
||||||
);
|
builder: (context, essenProvider, child) {
|
||||||
},
|
return RatingStars(onRate: (value) {
|
||||||
)
|
essenProvider.setRatingFrage1(value);
|
||||||
],
|
}, initRating: essenProvider.ratingFrage1,);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
const Text(
|
||||||
|
"Frage2*",
|
||||||
|
style: TextStyle(fontSize: 35),
|
||||||
|
),
|
||||||
|
Consumer<AmbienteProvider>(
|
||||||
|
builder: (context, essenProvider, child) {
|
||||||
|
return RatingStars(onRate: (value) {
|
||||||
|
essenProvider.setRatingFrage2(value);
|
||||||
|
}, initRating: essenProvider.ratingFrage2,);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 50,
|
||||||
|
),
|
||||||
|
Consumer<AmbienteProvider>(
|
||||||
|
builder: (context, essenProvider, child) {
|
||||||
|
return TextFormField(
|
||||||
|
initialValue: essenProvider.freiText,
|
||||||
|
onChanged: (value) {
|
||||||
|
essenProvider.setFreiText(value);
|
||||||
|
},
|
||||||
|
autofocus: false,
|
||||||
|
maxLength: 500,
|
||||||
|
maxLines: 4,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelText: "Dein Feedback (optional)",
|
||||||
|
labelStyle: const TextStyle(fontSize: 20),
|
||||||
|
border: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(15)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
style: TextStyle(fontSize: 20),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -17,91 +17,94 @@ class PageAnmerkungen extends StatelessWidget {
|
|||||||
height: 800,
|
height: 800,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
image: AssetImage("assets/backgrounds/Anmerkungen.jpg"),
|
image: AssetImage("assets/backgrounds/Anmerkungen.jpg"),
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
colorFilter: ColorFilter.mode(
|
colorFilter: ColorFilter.mode(
|
||||||
Colors.white.withOpacity(0.2),
|
Colors.white.withOpacity(0.2), BlendMode.dstATop),
|
||||||
BlendMode.dstATop
|
)),
|
||||||
),
|
|
||||||
)
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Center(
|
Center(
|
||||||
child: Container(
|
child: SingleChildScrollView(
|
||||||
decoration: BoxDecoration(
|
child: Container(
|
||||||
color: Colors.white.withOpacity(0.8),
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.only(
|
color: Colors.white.withOpacity(0.8),
|
||||||
topLeft: Radius.circular(80),
|
borderRadius: BorderRadius.only(
|
||||||
bottomRight: Radius.circular(80)
|
topLeft: Radius.circular(80),
|
||||||
)
|
bottomRight: Radius.circular(80))),
|
||||||
),
|
padding: EdgeInsets.symmetric(horizontal: 20),
|
||||||
padding: EdgeInsets.symmetric(horizontal: 20),
|
height: 400,
|
||||||
height: 400,
|
width: 600,
|
||||||
width: 600,
|
child: Column(
|
||||||
child: Column(
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
children: [
|
||||||
children: [
|
Row(
|
||||||
Row(
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
children: [
|
||||||
children: [
|
const Text(
|
||||||
const Text(
|
"Frage1*",
|
||||||
"Frage1*",
|
style: TextStyle(fontSize: 35),
|
||||||
style: TextStyle(fontSize: 35),
|
|
||||||
),
|
|
||||||
Consumer<AnmerkungProvider>(
|
|
||||||
builder: (context, essenProvider, child) {
|
|
||||||
return RatingStars(onRate: (value) {
|
|
||||||
essenProvider.setRatingFrage1(value);
|
|
||||||
}, initRating: essenProvider.ratingFrage1,);
|
|
||||||
},
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
const Text(
|
|
||||||
"Frage2*",
|
|
||||||
style: TextStyle(fontSize: 35),
|
|
||||||
),
|
|
||||||
Consumer<AnmerkungProvider>(
|
|
||||||
builder: (context, essenProvider, child) {
|
|
||||||
return RatingStars(onRate: (value) {
|
|
||||||
essenProvider.setRatingFrage2(value);
|
|
||||||
}, initRating: essenProvider.ratingFrage2,);
|
|
||||||
},
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 50,
|
|
||||||
),
|
|
||||||
Consumer<AnmerkungProvider>(
|
|
||||||
builder: (context, essenProvider, child) {
|
|
||||||
return TextFormField(
|
|
||||||
initialValue: essenProvider.freiText,
|
|
||||||
onChanged: (value) {
|
|
||||||
essenProvider.setFreiText(value);
|
|
||||||
},
|
|
||||||
autofocus: false,
|
|
||||||
maxLength: 500,
|
|
||||||
maxLines: 4,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
labelText: "Dein Feedback (optional)",
|
|
||||||
labelStyle: const TextStyle(fontSize: 20),
|
|
||||||
border: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(15)
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
style: TextStyle(fontSize: 20),
|
Consumer<AnmerkungProvider>(
|
||||||
);
|
builder: (context, essenProvider, child) {
|
||||||
},
|
return RatingStars(
|
||||||
)
|
onRate: (value) {
|
||||||
],
|
essenProvider.setRatingFrage1(value);
|
||||||
|
},
|
||||||
|
initRating: essenProvider.ratingFrage1,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
const Text(
|
||||||
|
"Frage2*",
|
||||||
|
style: TextStyle(fontSize: 35),
|
||||||
|
),
|
||||||
|
Consumer<AnmerkungProvider>(
|
||||||
|
builder: (context, essenProvider, child) {
|
||||||
|
return RatingStars(
|
||||||
|
onRate: (value) {
|
||||||
|
essenProvider.setRatingFrage2(value);
|
||||||
|
},
|
||||||
|
initRating: essenProvider.ratingFrage2,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 50,
|
||||||
|
),
|
||||||
|
Consumer<AnmerkungProvider>(
|
||||||
|
builder: (context, essenProvider, child) {
|
||||||
|
return TextFormField(
|
||||||
|
initialValue: essenProvider.freiText,
|
||||||
|
onChanged: (value) {
|
||||||
|
essenProvider.setFreiText(value);
|
||||||
|
},
|
||||||
|
autofocus: false,
|
||||||
|
maxLength: 500,
|
||||||
|
maxLines: 4,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelText: "Dein Feedback (optional)",
|
||||||
|
labelStyle: const TextStyle(fontSize: 20),
|
||||||
|
border: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(15)),
|
||||||
|
),
|
||||||
|
style: TextStyle(fontSize: 20),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)],
|
)
|
||||||
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
+101
-82
@@ -1,8 +1,10 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
|
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
|
||||||
|
import 'package:mensaapp/modules/fetchMenu.dart';
|
||||||
import 'package:mensaapp/modules/ratingEmote.dart';
|
import 'package:mensaapp/modules/ratingEmote.dart';
|
||||||
import 'package:mensaapp/modules/ratingStars.dart';
|
import 'package:mensaapp/modules/ratingStars.dart';
|
||||||
import 'package:mensaapp/providers/essenProvider.dart';
|
import 'package:mensaapp/providers/essenProvider.dart';
|
||||||
|
import 'package:mensaapp/providers/pageProvider.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
class PageEssen extends StatelessWidget {
|
class PageEssen extends StatelessWidget {
|
||||||
@@ -14,99 +16,116 @@ class PageEssen extends StatelessWidget {
|
|||||||
body: Stack(
|
body: Stack(
|
||||||
children: [
|
children: [
|
||||||
// Hintergrundbild
|
// Hintergrundbild
|
||||||
Container(
|
Container(
|
||||||
width: 1600,
|
width: 1600,
|
||||||
height: 750,
|
height: 750,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
image: AssetImage("assets/backgrounds/Essen.jpg"),
|
image: AssetImage("assets/backgrounds/Essen.jpg"),
|
||||||
fit: BoxFit.cover, // Deckt den gesamten Bildschirm ab
|
fit: BoxFit.cover, // Deckt den gesamten Bildschirm ab
|
||||||
colorFilter: ColorFilter.mode(
|
colorFilter: ColorFilter.mode(
|
||||||
Colors.white.withOpacity(0.2),
|
Colors.white.withOpacity(0.2),
|
||||||
BlendMode.dstATop,
|
BlendMode.dstATop,
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
),
|
||||||
// Vordergrundinhalte
|
// Vordergrundinhalte
|
||||||
|
|
||||||
Center(
|
Center(
|
||||||
child: Container(
|
child: SingleChildScrollView(
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Colors.white.withOpacity(0.8),
|
|
||||||
borderRadius: BorderRadius.only(
|
|
||||||
topLeft: Radius.circular(80),
|
|
||||||
bottomRight: Radius.circular(80)
|
|
||||||
)
|
|
||||||
),
|
|
||||||
height: 400,
|
|
||||||
width: 600,
|
|
||||||
padding: EdgeInsets.symmetric(horizontal: 20),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Row(
|
Consumer<PageProvider>(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
builder: (context, pageProvider, child) {
|
||||||
children: [
|
return Text(
|
||||||
const Text(
|
pageProvider.selectedEssenName,
|
||||||
"Geschmack*",
|
style: const TextStyle(fontSize: 40),
|
||||||
style: TextStyle(fontSize: 35),
|
|
||||||
),
|
|
||||||
Consumer<EssenProvider>(
|
|
||||||
builder: (context, essenProvider, child) {
|
|
||||||
return RatingStars(
|
|
||||||
onRate: (value) {
|
|
||||||
essenProvider.setRatingGeschmack(value);
|
|
||||||
},
|
|
||||||
initRating: essenProvider.ratingGeschmack,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
const Text(
|
|
||||||
"Qualität*",
|
|
||||||
style: TextStyle(fontSize: 35),
|
|
||||||
),
|
|
||||||
Consumer<EssenProvider>(
|
|
||||||
builder: (context, essenProvider, child) {
|
|
||||||
return RatingStars(
|
|
||||||
onRate: (value) {
|
|
||||||
essenProvider.setRatingQuali(value);
|
|
||||||
},
|
|
||||||
initRating: essenProvider.ratingQuali,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 50,
|
|
||||||
),
|
|
||||||
Consumer<EssenProvider>(
|
|
||||||
builder: (context, essenProvider, child) {
|
|
||||||
return TextFormField(
|
|
||||||
initialValue: essenProvider.freiText,
|
|
||||||
onChanged: (value) {
|
|
||||||
essenProvider.setFreiText(value);
|
|
||||||
},
|
|
||||||
autofocus: false,
|
|
||||||
maxLength: 500,
|
|
||||||
maxLines: 4,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
labelText: "Dein Feedback (optional)",
|
|
||||||
labelStyle: const TextStyle(fontSize: 20),
|
|
||||||
border: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(15),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
style: TextStyle(fontSize: 20),
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 30,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white.withOpacity(0.8),
|
||||||
|
borderRadius: const BorderRadius.only(
|
||||||
|
topLeft: Radius.circular(80),
|
||||||
|
bottomRight: Radius.circular(80))),
|
||||||
|
height: 400,
|
||||||
|
width: 600,
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 20),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
const Text(
|
||||||
|
"Geschmack*",
|
||||||
|
style: TextStyle(fontSize: 35),
|
||||||
|
),
|
||||||
|
Consumer<EssenProvider>(
|
||||||
|
builder: (context, essenProvider, child) {
|
||||||
|
return RatingStars(
|
||||||
|
onRate: (value) {
|
||||||
|
essenProvider.setRatingGeschmack(value);
|
||||||
|
},
|
||||||
|
initRating: essenProvider.ratingGeschmack,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
const Text(
|
||||||
|
"Qualität*",
|
||||||
|
style: TextStyle(fontSize: 35),
|
||||||
|
),
|
||||||
|
Consumer<EssenProvider>(
|
||||||
|
builder: (context, essenProvider, child) {
|
||||||
|
return RatingStars(
|
||||||
|
onRate: (value) {
|
||||||
|
essenProvider.setRatingQuali(value);
|
||||||
|
},
|
||||||
|
initRating: essenProvider.ratingQuali,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 50,
|
||||||
|
),
|
||||||
|
Consumer<EssenProvider>(
|
||||||
|
builder: (context, essenProvider, child) {
|
||||||
|
return TextFormField(
|
||||||
|
initialValue: essenProvider.freiText,
|
||||||
|
onChanged: (value) {
|
||||||
|
essenProvider.setFreiText(value);
|
||||||
|
},
|
||||||
|
autofocus: false,
|
||||||
|
maxLength: 500,
|
||||||
|
maxLines: 4,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelText: "Dein Feedback (optional)",
|
||||||
|
labelStyle: const TextStyle(fontSize: 20),
|
||||||
|
border: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(15),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
style: TextStyle(fontSize: 20),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -0,0 +1,65 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:mensaapp/modules/fetchMenu.dart';
|
||||||
|
import 'package:mensaapp/providers/pageProvider.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
class PageEssenSelect extends StatelessWidget {
|
||||||
|
const PageEssenSelect({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
|
||||||
|
List<String> menus = [];
|
||||||
|
|
||||||
|
Future<void> fetchMenu() async {
|
||||||
|
menus = await FetchMenu.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
return FutureBuilder(
|
||||||
|
future: fetchMenu(),
|
||||||
|
builder: (context, snapshot) {
|
||||||
|
return Scaffold(
|
||||||
|
body: Stack(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: 1600,
|
||||||
|
height: 750,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
image: DecorationImage(
|
||||||
|
image: AssetImage("assets/backgrounds/Essen.jpg"),
|
||||||
|
fit: BoxFit.cover, // Deckt den gesamten Bildschirm ab
|
||||||
|
colorFilter: ColorFilter.mode(
|
||||||
|
Colors.white.withOpacity(0.2),
|
||||||
|
BlendMode.dstATop,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Center(
|
||||||
|
child: Container(
|
||||||
|
child: Wrap(
|
||||||
|
direction: Axis.horizontal,
|
||||||
|
alignment: WrapAlignment.center,
|
||||||
|
runSpacing: 50,
|
||||||
|
spacing: 50,
|
||||||
|
children: [
|
||||||
|
for (int i = 0; i < menus.length; i++)
|
||||||
|
FilledButton.icon(
|
||||||
|
style: ButtonStyle(padding: WidgetStatePropertyAll(EdgeInsets.all(60))),
|
||||||
|
icon: const Icon(Icons.fastfood_outlined),
|
||||||
|
label: Text("Essen ${i + 1}: ${menus[i]}", style: TextStyle(fontSize: 23),),
|
||||||
|
onPressed: () {
|
||||||
|
Provider.of<PageProvider>(context, listen: false).setSelectedEssen(i + 1, "Essen ${i + 1}: ${menus[i]}");
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
+73
-71
@@ -27,78 +27,80 @@ class PageService extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Center(
|
Center(
|
||||||
child: Container(
|
child: SingleChildScrollView(
|
||||||
decoration: BoxDecoration(
|
child: Container(
|
||||||
color: Colors.white.withOpacity(0.8),
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.only(
|
color: Colors.white.withOpacity(0.8),
|
||||||
topLeft: Radius.circular(80),
|
borderRadius: BorderRadius.only(
|
||||||
bottomRight: Radius.circular(80)
|
topLeft: Radius.circular(80),
|
||||||
)
|
bottomRight: Radius.circular(80)
|
||||||
),
|
)
|
||||||
width: 600,
|
),
|
||||||
height: 400,
|
width: 600,
|
||||||
padding: EdgeInsets.symmetric(horizontal: 20),
|
height: 400,
|
||||||
child: Column(
|
padding: EdgeInsets.symmetric(horizontal: 20),
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
Row(
|
children: [
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
Row(
|
||||||
children: [
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
const Text(
|
children: [
|
||||||
"Frage1*",
|
const Text(
|
||||||
style: TextStyle(fontSize: 35),
|
"Frage1*",
|
||||||
),
|
style: TextStyle(fontSize: 35),
|
||||||
Consumer<ServiceProvider>(
|
|
||||||
builder: (context, essenProvider, child) {
|
|
||||||
return RatingStars(onRate: (value) {
|
|
||||||
essenProvider.setRatingFrage1(value);
|
|
||||||
}, initRating: essenProvider.ratingFrage1,);
|
|
||||||
},
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
const Text(
|
|
||||||
"Frage2*",
|
|
||||||
style: TextStyle(fontSize: 35),
|
|
||||||
),
|
|
||||||
Consumer<ServiceProvider>(
|
|
||||||
builder: (context, essenProvider, child) {
|
|
||||||
return RatingStars(onRate: (value) {
|
|
||||||
essenProvider.setRatingFrage2(value);
|
|
||||||
}, initRating: essenProvider.ratingFrage2,);
|
|
||||||
},
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 50,
|
|
||||||
),
|
|
||||||
Consumer<ServiceProvider>(
|
|
||||||
builder: (context, essenProvider, child) {
|
|
||||||
return TextFormField(
|
|
||||||
initialValue: essenProvider.freiText,
|
|
||||||
onChanged: (value) {
|
|
||||||
essenProvider.setFreiText(value);
|
|
||||||
},
|
|
||||||
autofocus: false,
|
|
||||||
maxLength: 500,
|
|
||||||
maxLines: 4,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
labelText: "Dein Feedback (optional)",
|
|
||||||
labelStyle: const TextStyle(fontSize: 20),
|
|
||||||
border: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(15)
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
style: TextStyle(fontSize: 20),
|
Consumer<ServiceProvider>(
|
||||||
);
|
builder: (context, essenProvider, child) {
|
||||||
},
|
return RatingStars(onRate: (value) {
|
||||||
)
|
essenProvider.setRatingFrage1(value);
|
||||||
],
|
}, initRating: essenProvider.ratingFrage1,);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
const Text(
|
||||||
|
"Frage2*",
|
||||||
|
style: TextStyle(fontSize: 35),
|
||||||
|
),
|
||||||
|
Consumer<ServiceProvider>(
|
||||||
|
builder: (context, essenProvider, child) {
|
||||||
|
return RatingStars(onRate: (value) {
|
||||||
|
essenProvider.setRatingFrage2(value);
|
||||||
|
}, initRating: essenProvider.ratingFrage2,);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 50,
|
||||||
|
),
|
||||||
|
Consumer<ServiceProvider>(
|
||||||
|
builder: (context, essenProvider, child) {
|
||||||
|
return TextFormField(
|
||||||
|
initialValue: essenProvider.freiText,
|
||||||
|
onChanged: (value) {
|
||||||
|
essenProvider.setFreiText(value);
|
||||||
|
},
|
||||||
|
autofocus: false,
|
||||||
|
maxLength: 500,
|
||||||
|
maxLines: 4,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelText: "Dein Feedback (optional)",
|
||||||
|
labelStyle: const TextStyle(fontSize: 20),
|
||||||
|
border: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(15)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
style: TextStyle(fontSize: 20),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -19,162 +19,100 @@ class PageSpezielleErnaehrung extends StatelessWidget {
|
|||||||
height: 750,
|
height: 750,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
image: DecorationImage(
|
image: DecorationImage(
|
||||||
image: AssetImage("assets/backgrounds/Speziell.jpg"),
|
image: AssetImage("assets/backgrounds/Speziell.jpg"),
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
colorFilter: ColorFilter.mode(
|
colorFilter: ColorFilter.mode(
|
||||||
Colors.white.withOpacity(0.2),
|
Colors.white.withOpacity(0.2), BlendMode.dstATop),
|
||||||
BlendMode.dstATop
|
)),
|
||||||
),
|
|
||||||
)
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
Center(
|
Center(
|
||||||
child: Container(
|
child: SingleChildScrollView(
|
||||||
decoration: BoxDecoration(
|
child: Container(
|
||||||
color: Colors.white.withOpacity(0.8),
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.only(
|
color: Colors.white.withOpacity(0.8),
|
||||||
topLeft: Radius.circular(80),
|
borderRadius: BorderRadius.only(
|
||||||
bottomRight: Radius.circular(80)
|
topLeft: Radius.circular(80),
|
||||||
)
|
bottomRight: Radius.circular(80))),
|
||||||
),
|
width: 650,
|
||||||
width: 650,
|
height: 450,
|
||||||
height: 450,
|
padding: EdgeInsets.symmetric(horizontal: 20),
|
||||||
padding: EdgeInsets.symmetric(horizontal: 20),
|
child: Column(
|
||||||
child: Column(
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
children: [
|
||||||
children: [
|
Row(
|
||||||
Row(
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
children: [
|
||||||
children: [
|
const Text(
|
||||||
const Text(
|
"Vegan?*",
|
||||||
"Vegan?*",
|
style: TextStyle(fontSize: 35),
|
||||||
style: TextStyle(fontSize: 35),
|
|
||||||
),
|
|
||||||
Consumer<SpezielleErnaehrungProvider>(
|
|
||||||
builder: (context, spezielleErnaehrungProvider, child) {
|
|
||||||
return RatingStars(onRate: (value) {
|
|
||||||
spezielleErnaehrungProvider.setRatingSitzmoeglichkeit(value);
|
|
||||||
}, initRating: spezielleErnaehrungProvider.ratingSitzmoeglichkeit,);
|
|
||||||
},
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
const Text(
|
|
||||||
"Keine Ahnung*",
|
|
||||||
style: TextStyle(fontSize: 35),
|
|
||||||
),
|
|
||||||
Consumer<SpezielleErnaehrungProvider>(
|
|
||||||
builder: (context, spezielleErnaehrungProvider, child) {
|
|
||||||
return RatingStars(onRate: (value) {
|
|
||||||
spezielleErnaehrungProvider.setRatingKeineAhnung(value);
|
|
||||||
}, initRating: spezielleErnaehrungProvider.ratingKeineAhnung,);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 50,
|
|
||||||
),
|
|
||||||
Consumer<SpezielleErnaehrungProvider>(
|
|
||||||
builder: (context, spezielleErnaehrungProvider, child) {
|
|
||||||
return TextFormField(
|
|
||||||
initialValue: spezielleErnaehrungProvider.freiText,
|
|
||||||
onChanged: (value) {
|
|
||||||
spezielleErnaehrungProvider.setFreiText(value);
|
|
||||||
},
|
|
||||||
autofocus: false,
|
|
||||||
maxLength: 500,
|
|
||||||
maxLines: 5,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
labelText: "Dein Feedback (optional)",
|
|
||||||
labelStyle: const TextStyle(fontSize: 20),
|
|
||||||
border: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(15)
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
style: TextStyle(fontSize: 20),
|
Consumer<SpezielleErnaehrungProvider>(
|
||||||
);
|
builder:
|
||||||
},
|
(context, spezielleErnaehrungProvider, child) {
|
||||||
)
|
return RatingStars(
|
||||||
],
|
onRate: (value) {
|
||||||
),
|
spezielleErnaehrungProvider
|
||||||
),
|
.setRatingSitzmoeglichkeit(value);
|
||||||
)
|
},
|
||||||
],
|
initRating: spezielleErnaehrungProvider
|
||||||
),
|
.ratingSitzmoeglichkeit,
|
||||||
);
|
);
|
||||||
|
},
|
||||||
Center(
|
)
|
||||||
child: Container(
|
],
|
||||||
width: 800,
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
const Text(
|
|
||||||
"Vegan?*",
|
|
||||||
style: TextStyle(fontSize: 35),
|
|
||||||
),
|
|
||||||
Consumer<SpezielleErnaehrungProvider>(
|
|
||||||
builder: (context, spezielleErnaehrungProvider, child) {
|
|
||||||
return RatingStars(onRate: (value) {
|
|
||||||
spezielleErnaehrungProvider.setRatingSitzmoeglichkeit(value);
|
|
||||||
}, initRating: spezielleErnaehrungProvider.ratingSitzmoeglichkeit,);
|
|
||||||
},
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
const Text(
|
|
||||||
"Keine Ahnung*",
|
|
||||||
style: TextStyle(fontSize: 35),
|
|
||||||
),
|
|
||||||
Consumer<SpezielleErnaehrungProvider>(
|
|
||||||
builder: (context, spezielleErnaehrungProvider, child) {
|
|
||||||
return RatingStars(onRate: (value) {
|
|
||||||
spezielleErnaehrungProvider.setRatingKeineAhnung(value);
|
|
||||||
}, initRating: spezielleErnaehrungProvider.ratingKeineAhnung,);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 50,
|
|
||||||
),
|
|
||||||
Consumer<SpezielleErnaehrungProvider>(
|
|
||||||
builder: (context, spezielleErnaehrungProvider, child) {
|
|
||||||
return TextFormField(
|
|
||||||
initialValue: spezielleErnaehrungProvider.freiText,
|
|
||||||
onChanged: (value) {
|
|
||||||
spezielleErnaehrungProvider.setFreiText(value);
|
|
||||||
},
|
|
||||||
autofocus: false,
|
|
||||||
maxLength: 500,
|
|
||||||
maxLines: 5,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
labelText: "Dein Feedback (optional)",
|
|
||||||
labelStyle: const TextStyle(fontSize: 20),
|
|
||||||
border: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(15)
|
|
||||||
),
|
),
|
||||||
),
|
Row(
|
||||||
style: TextStyle(fontSize: 20),
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
);
|
children: [
|
||||||
},
|
const Text(
|
||||||
)
|
"Keine Ahnung*",
|
||||||
],
|
style: TextStyle(fontSize: 35),
|
||||||
),
|
),
|
||||||
|
Consumer<SpezielleErnaehrungProvider>(
|
||||||
|
builder:
|
||||||
|
(context, spezielleErnaehrungProvider, child) {
|
||||||
|
return RatingStars(
|
||||||
|
onRate: (value) {
|
||||||
|
spezielleErnaehrungProvider
|
||||||
|
.setRatingKeineAhnung(value);
|
||||||
|
},
|
||||||
|
initRating:
|
||||||
|
spezielleErnaehrungProvider.ratingKeineAhnung,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 50,
|
||||||
|
),
|
||||||
|
Consumer<SpezielleErnaehrungProvider>(
|
||||||
|
builder: (context, spezielleErnaehrungProvider, child) {
|
||||||
|
return TextFormField(
|
||||||
|
initialValue: spezielleErnaehrungProvider.freiText,
|
||||||
|
onChanged: (value) {
|
||||||
|
spezielleErnaehrungProvider.setFreiText(value);
|
||||||
|
},
|
||||||
|
autofocus: false,
|
||||||
|
maxLength: 500,
|
||||||
|
maxLines: 5,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelText: "Dein Feedback (optional)",
|
||||||
|
labelStyle: const TextStyle(fontSize: 20),
|
||||||
|
border: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(15)),
|
||||||
|
),
|
||||||
|
style: TextStyle(fontSize: 20),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,17 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:mensaapp/pages/pageAmbiente.dart';
|
import 'package:mensaapp/pages/pageAmbiente.dart';
|
||||||
import 'package:mensaapp/pages/pageEssen.dart';
|
import 'package:mensaapp/pages/pageEssen.dart';
|
||||||
|
import 'package:mensaapp/pages/pageEssenSelect.dart';
|
||||||
import 'package:mensaapp/pages/pageService.dart';
|
import 'package:mensaapp/pages/pageService.dart';
|
||||||
import 'package:mensaapp/pages/pageAnmerkungen.dart';
|
import 'package:mensaapp/pages/pageAnmerkungen.dart';
|
||||||
import 'package:mensaapp/pages/pageSpezielleErnaehrung.dart';
|
import 'package:mensaapp/pages/pageSpezielleErnaehrung.dart';
|
||||||
|
|
||||||
class PageProvider extends ChangeNotifier {
|
class PageProvider extends ChangeNotifier {
|
||||||
int selectedPage = 0;
|
int selectedPage = 0;
|
||||||
|
int selectedEssenID = 0;
|
||||||
|
String selectedEssenName = "";
|
||||||
List<Widget> pages = [
|
List<Widget> pages = [
|
||||||
const PageEssen(),
|
const PageEssenSelect(),
|
||||||
const PageAmbiente(),
|
const PageAmbiente(),
|
||||||
const PageService(),
|
const PageService(),
|
||||||
const PageAnmerkungen(),
|
const PageAnmerkungen(),
|
||||||
@@ -27,4 +30,18 @@ class PageProvider extends ChangeNotifier {
|
|||||||
selectedPage = index;
|
selectedPage = index;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setSelectedEssen(int id, String name) {
|
||||||
|
selectedEssenName = name;
|
||||||
|
selectedEssenID = id;
|
||||||
|
pages[0] = const PageEssen();
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
void resetSelectedEssen() {
|
||||||
|
selectedEssenName = "";
|
||||||
|
selectedEssenID = 0;
|
||||||
|
pages[0] = const PageEssenSelect();
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+159
-2
@@ -57,6 +57,22 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.3.1"
|
version: "1.3.1"
|
||||||
|
ffi:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: ffi
|
||||||
|
sha256: "16ed7b077ef01ad6170a3d0c57caa4a112a38d7a2ed5602e0aca9ca6f3d98da6"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.3"
|
||||||
|
file:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: file
|
||||||
|
sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "7.0.1"
|
||||||
flutter:
|
flutter:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description: flutter
|
description: flutter
|
||||||
@@ -83,6 +99,11 @@ packages:
|
|||||||
description: flutter
|
description: flutter
|
||||||
source: sdk
|
source: sdk
|
||||||
version: "0.0.0"
|
version: "0.0.0"
|
||||||
|
flutter_web_plugins:
|
||||||
|
dependency: transitive
|
||||||
|
description: flutter
|
||||||
|
source: sdk
|
||||||
|
version: "0.0.0"
|
||||||
google_nav_bar:
|
google_nav_bar:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -91,6 +112,22 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "5.0.7"
|
version: "5.0.7"
|
||||||
|
http:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: http
|
||||||
|
sha256: b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.2.2"
|
||||||
|
http_parser:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: http_parser
|
||||||
|
sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "4.0.2"
|
||||||
leak_tracker:
|
leak_tracker:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -163,6 +200,46 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "1.9.0"
|
version: "1.9.0"
|
||||||
|
path_provider_linux:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_linux
|
||||||
|
sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.2.1"
|
||||||
|
path_provider_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_platform_interface
|
||||||
|
sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.2"
|
||||||
|
path_provider_windows:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: path_provider_windows
|
||||||
|
sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.3.0"
|
||||||
|
platform:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: platform
|
||||||
|
sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "3.1.6"
|
||||||
|
plugin_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: plugin_platform_interface
|
||||||
|
sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.1.8"
|
||||||
provider:
|
provider:
|
||||||
dependency: "direct main"
|
dependency: "direct main"
|
||||||
description:
|
description:
|
||||||
@@ -171,6 +248,62 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "6.1.2"
|
version: "6.1.2"
|
||||||
|
shared_preferences:
|
||||||
|
dependency: "direct main"
|
||||||
|
description:
|
||||||
|
name: shared_preferences
|
||||||
|
sha256: "95f9997ca1fb9799d494d0cb2a780fd7be075818d59f00c43832ed112b158a82"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.3.3"
|
||||||
|
shared_preferences_android:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shared_preferences_android
|
||||||
|
sha256: "3b9febd815c9ca29c9e3520d50ec32f49157711e143b7a4ca039eb87e8ade5ab"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.3.3"
|
||||||
|
shared_preferences_foundation:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shared_preferences_foundation
|
||||||
|
sha256: "07e050c7cd39bad516f8d64c455f04508d09df104be326d8c02551590a0d513d"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.5.3"
|
||||||
|
shared_preferences_linux:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shared_preferences_linux
|
||||||
|
sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.4.1"
|
||||||
|
shared_preferences_platform_interface:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shared_preferences_platform_interface
|
||||||
|
sha256: "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.4.1"
|
||||||
|
shared_preferences_web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shared_preferences_web
|
||||||
|
sha256: d2ca4132d3946fec2184261726b355836a82c33d7d5b67af32692aff18a4684e
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.4.2"
|
||||||
|
shared_preferences_windows:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: shared_preferences_windows
|
||||||
|
sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "2.4.1"
|
||||||
sky_engine:
|
sky_engine:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description: flutter
|
description: flutter
|
||||||
@@ -224,6 +357,14 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "0.7.2"
|
version: "0.7.2"
|
||||||
|
typed_data:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: typed_data
|
||||||
|
sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.4.0"
|
||||||
vector_math:
|
vector_math:
|
||||||
dependency: transitive
|
dependency: transitive
|
||||||
description:
|
description:
|
||||||
@@ -240,6 +381,22 @@ packages:
|
|||||||
url: "https://pub.dev"
|
url: "https://pub.dev"
|
||||||
source: hosted
|
source: hosted
|
||||||
version: "14.2.5"
|
version: "14.2.5"
|
||||||
|
web:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: web
|
||||||
|
sha256: cd3543bd5798f6ad290ea73d210f423502e71900302dde696f8bff84bf89a1cb
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.0"
|
||||||
|
xdg_directories:
|
||||||
|
dependency: transitive
|
||||||
|
description:
|
||||||
|
name: xdg_directories
|
||||||
|
sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15"
|
||||||
|
url: "https://pub.dev"
|
||||||
|
source: hosted
|
||||||
|
version: "1.1.0"
|
||||||
sdks:
|
sdks:
|
||||||
dart: ">=3.5.3 <4.0.0"
|
dart: ">=3.5.2 <4.0.0"
|
||||||
flutter: ">=3.18.0-18.0.pre.54"
|
flutter: ">=3.24.0"
|
||||||
|
|||||||
+3
-1
@@ -19,7 +19,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
|||||||
version: 1.0.0+1
|
version: 1.0.0+1
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.5.3
|
sdk: ^3.5.2
|
||||||
|
|
||||||
# Dependencies specify other packages that your package needs in order to work.
|
# Dependencies specify other packages that your package needs in order to work.
|
||||||
# To automatically upgrade your package dependencies to the latest versions
|
# To automatically upgrade your package dependencies to the latest versions
|
||||||
@@ -33,6 +33,8 @@ dependencies:
|
|||||||
provider: ^6.1.2
|
provider: ^6.1.2
|
||||||
google_nav_bar: ^5.0.7
|
google_nav_bar: ^5.0.7
|
||||||
flutter_rating_bar: ^4.0.1
|
flutter_rating_bar: ^4.0.1
|
||||||
|
http: ^1.2.2
|
||||||
|
shared_preferences: ^2.3.3
|
||||||
|
|
||||||
# The following adds the Cupertino Icons font to your application.
|
# The following adds the Cupertino Icons font to your application.
|
||||||
# Use with the CupertinoIcons class for iOS style icons.
|
# Use with the CupertinoIcons class for iOS style icons.
|
||||||
|
|||||||
Reference in New Issue
Block a user