Merge branch 'selectEssenPage' into 'main'

Essen auswählen

See merge request brausjonas/mensaapp!10
This commit is contained in:
Jonas Braus
2024-11-24 21:09:33 +00:00
14 changed files with 749 additions and 468 deletions
+3 -3
View File
@@ -11,12 +11,12 @@ android {
ndkVersion = flutter.ndkVersion
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
jvmTarget = 17
}
defaultConfig {
+1 -1
View File
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
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
+2 -2
View File
@@ -18,8 +18,8 @@ pluginManagement {
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.1.0" apply false
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
id "com.android.application" version "8.3.2" apply false
id "org.jetbrains.kotlin.android" version "2.0.20" apply false
}
include ":app"
+1
View File
@@ -91,6 +91,7 @@ class MyHome extends StatelessWidget {
Provider.of<AmbienteProvider>(context, listen: false).resetAllFields();
Provider.of<ServiceProvider>(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
Navigator.of(context).pop(); // Dialog schließen
+75
View File
@@ -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
View File
@@ -25,78 +25,80 @@ class PageAmbiente extends StatelessWidget {
),
),
Center(
child: Container(
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.8),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(80),
bottomRight: Radius.circular(80)
)
),
width: 600,
height: 400,
padding: EdgeInsets.symmetric(horizontal: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Text(
"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)
),
child: SingleChildScrollView(
child: Container(
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.8),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(80),
bottomRight: Radius.circular(80)
)
),
width: 600,
height: 400,
padding: EdgeInsets.symmetric(horizontal: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Text(
"Frage1*",
style: TextStyle(fontSize: 35),
),
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),
);
},
)
],
),
),
),
)
+85 -82
View File
@@ -17,91 +17,94 @@ class PageAnmerkungen extends StatelessWidget {
height: 800,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/backgrounds/Anmerkungen.jpg"),
fit: BoxFit.cover,
colorFilter: ColorFilter.mode(
Colors.white.withOpacity(0.2),
BlendMode.dstATop
),
)
),
image: AssetImage("assets/backgrounds/Anmerkungen.jpg"),
fit: BoxFit.cover,
colorFilter: ColorFilter.mode(
Colors.white.withOpacity(0.2), BlendMode.dstATop),
)),
),
Center(
child: Container(
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.8),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(80),
bottomRight: Radius.circular(80)
)
),
padding: EdgeInsets.symmetric(horizontal: 20),
height: 400,
width: 600,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Text(
"Frage1*",
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)
),
Center(
child: SingleChildScrollView(
child: Container(
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.8),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(80),
bottomRight: Radius.circular(80))),
padding: EdgeInsets.symmetric(horizontal: 20),
height: 400,
width: 600,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Text(
"Frage1*",
style: TextStyle(fontSize: 35),
),
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
View File
@@ -1,8 +1,10 @@
import 'package:flutter/material.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/ratingStars.dart';
import 'package:mensaapp/providers/essenProvider.dart';
import 'package:mensaapp/providers/pageProvider.dart';
import 'package:provider/provider.dart';
class PageEssen extends StatelessWidget {
@@ -14,99 +16,116 @@ class PageEssen extends StatelessWidget {
body: Stack(
children: [
// Hintergrundbild
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,
),
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,
),
),
),
),
// Vordergrundinhalte
Center(
child: Container(
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: SingleChildScrollView(
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),
Consumer<PageProvider>(
builder: (context, pageProvider, child) {
return Text(
pageProvider.selectedEssenName,
style: const TextStyle(fontSize: 40),
);
},
),
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),
);
},
),
],
),
),
],
),
),
+65
View File
@@ -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
View File
@@ -27,78 +27,80 @@ class PageService extends StatelessWidget {
),
),
Center(
child: Container(
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.8),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(80),
bottomRight: Radius.circular(80)
)
),
width: 600,
height: 400,
padding: EdgeInsets.symmetric(horizontal: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Text(
"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)
),
child: SingleChildScrollView(
child: Container(
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.8),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(80),
bottomRight: Radius.circular(80)
)
),
width: 600,
height: 400,
padding: EdgeInsets.symmetric(horizontal: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Text(
"Frage1*",
style: TextStyle(fontSize: 35),
),
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),
);
},
)
],
),
),
),
)
+90 -152
View File
@@ -19,162 +19,100 @@ class PageSpezielleErnaehrung extends StatelessWidget {
height: 750,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/backgrounds/Speziell.jpg"),
fit: BoxFit.cover,
colorFilter: ColorFilter.mode(
Colors.white.withOpacity(0.2),
BlendMode.dstATop
),
)
),
image: AssetImage("assets/backgrounds/Speziell.jpg"),
fit: BoxFit.cover,
colorFilter: ColorFilter.mode(
Colors.white.withOpacity(0.2), BlendMode.dstATop),
)),
),
Center(
child: Container(
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.8),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(80),
bottomRight: Radius.circular(80)
)
),
width: 650,
height: 450,
padding: EdgeInsets.symmetric(horizontal: 20),
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)
),
child: SingleChildScrollView(
child: Container(
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.8),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(80),
bottomRight: Radius.circular(80))),
width: 650,
height: 450,
padding: EdgeInsets.symmetric(horizontal: 20),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
const Text(
"Vegan?*",
style: TextStyle(fontSize: 35),
),
style: TextStyle(fontSize: 20),
);
},
)
],
),
),
)
],
),
);
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)
Consumer<SpezielleErnaehrungProvider>(
builder:
(context, spezielleErnaehrungProvider, child) {
return RatingStars(
onRate: (value) {
spezielleErnaehrungProvider
.setRatingSitzmoeglichkeit(value);
},
initRating: spezielleErnaehrungProvider
.ratingSitzmoeglichkeit,
);
},
)
],
),
),
style: TextStyle(fontSize: 20),
);
},
)
],
),
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),
);
},
)
],
),
),
),
)
],
),
);
}
+18 -1
View File
@@ -1,14 +1,17 @@
import 'package:flutter/material.dart';
import 'package:mensaapp/pages/pageAmbiente.dart';
import 'package:mensaapp/pages/pageEssen.dart';
import 'package:mensaapp/pages/pageEssenSelect.dart';
import 'package:mensaapp/pages/pageService.dart';
import 'package:mensaapp/pages/pageAnmerkungen.dart';
import 'package:mensaapp/pages/pageSpezielleErnaehrung.dart';
class PageProvider extends ChangeNotifier {
int selectedPage = 0;
int selectedEssenID = 0;
String selectedEssenName = "";
List<Widget> pages = [
const PageEssen(),
const PageEssenSelect(),
const PageAmbiente(),
const PageService(),
const PageAnmerkungen(),
@@ -27,4 +30,18 @@ class PageProvider extends ChangeNotifier {
selectedPage = index;
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
View File
@@ -57,6 +57,22 @@ packages:
url: "https://pub.dev"
source: hosted
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:
dependency: "direct main"
description: flutter
@@ -83,6 +99,11 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_web_plugins:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
google_nav_bar:
dependency: "direct main"
description:
@@ -91,6 +112,22 @@ packages:
url: "https://pub.dev"
source: hosted
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:
dependency: transitive
description:
@@ -163,6 +200,46 @@ packages:
url: "https://pub.dev"
source: hosted
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:
dependency: "direct main"
description:
@@ -171,6 +248,62 @@ packages:
url: "https://pub.dev"
source: hosted
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:
dependency: transitive
description: flutter
@@ -224,6 +357,14 @@ packages:
url: "https://pub.dev"
source: hosted
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:
dependency: transitive
description:
@@ -240,6 +381,22 @@ packages:
url: "https://pub.dev"
source: hosted
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:
dart: ">=3.5.3 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54"
dart: ">=3.5.2 <4.0.0"
flutter: ">=3.24.0"
+3 -1
View File
@@ -19,7 +19,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.0+1
environment:
sdk: ^3.5.3
sdk: ^3.5.2
# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
@@ -33,6 +33,8 @@ dependencies:
provider: ^6.1.2
google_nav_bar: ^5.0.7
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.
# Use with the CupertinoIcons class for iOS style icons.