From f870be4af799dad432430f5e740fead3d88d4717 Mon Sep 17 00:00:00 2001 From: Jonas Braus Date: Sun, 24 Nov 2024 14:35:44 +0100 Subject: [PATCH 1/3] =?UTF-8?q?Essen=20ausw=C3=A4hlen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Stand jetzt: essen von der Website gezogen: Schöner: Warten auf API-Key --- lib/main.dart | 1 + lib/modules/fetchMenu.dart | 22 ++++ lib/pages/pageEssen.dart | 197 +++++++++++++++++--------------- lib/pages/pageEssenSelect.dart | 65 +++++++++++ lib/providers/pageProvider.dart | 19 ++- pubspec.lock | 32 ++++++ pubspec.yaml | 1 + 7 files changed, 243 insertions(+), 94 deletions(-) create mode 100644 lib/modules/fetchMenu.dart create mode 100644 lib/pages/pageEssenSelect.dart diff --git a/lib/main.dart b/lib/main.dart index ab2e6eb..2f2efd9 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -91,6 +91,7 @@ class MyHome extends StatelessWidget { Provider.of(context, listen: false).resetAllFields(); Provider.of(context, listen: false).resetAllFields(); Provider.of(context, listen: false).resetAllFields(); + Provider.of(context, listen: false).resetSelectedEssen(); // Hier Aktion für Löschen ausführen Navigator.of(context).pop(); // Dialog schließen diff --git a/lib/modules/fetchMenu.dart b/lib/modules/fetchMenu.dart new file mode 100644 index 0000000..bed19ce --- /dev/null +++ b/lib/modules/fetchMenu.dart @@ -0,0 +1,22 @@ +import 'package:http/http.dart' as http; + +class FetchMenu { + static Future> get() async { + List menus = []; + + // TODO: Proto: + http.Response resp = await http.get(Uri.parse( + "https://www.swfr.de/essen/mensen-cafes-speiseplaene/mensa-loerrach")); + var content = resp.body.split("

"); + var innerContent = content[1].split("\n"); + for (var s in innerContent) { + if (s.contains("extra-text mb-15px")) { + var name = (s.split("\">")[1].split("", " "); + menus.add(name); + } + } + // End-Proto + + return menus; + } +} diff --git a/lib/pages/pageEssen.dart b/lib/pages/pageEssen.dart index deb1292..db9d015 100644 --- a/lib/pages/pageEssen.dart +++ b/lib/pages/pageEssen.dart @@ -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,103 +16,112 @@ 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: Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - const Text( - "Geschmack*", - style: TextStyle(fontSize: 35), - ), - Consumer( - 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( - builder: (context, essenProvider, child) { - return RatingStars( - onRate: (value) { - essenProvider.setRatingQuali(value); - }, - initRating: essenProvider.ratingQuali, - ); - }, - ) - ], - ), - const SizedBox( - height: 50, - ), - Consumer( - 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), - ); - }, - ), - ], - ), - ), ), + // Vordergrundinhalte + + Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Consumer( + 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( + 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( + builder: (context, essenProvider, child) { + return RatingStars( + onRate: (value) { + essenProvider.setRatingQuali(value); + }, + initRating: essenProvider.ratingQuali, + ); + }, + ) + ], + ), + const SizedBox( + height: 50, + ), + Consumer( + 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), + ); + }, + ), + ], + ), + ), + ], + )), ], ), ); diff --git a/lib/pages/pageEssenSelect.dart b/lib/pages/pageEssenSelect.dart new file mode 100644 index 0000000..3ebe0d6 --- /dev/null +++ b/lib/pages/pageEssenSelect.dart @@ -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 menus = []; + + Future 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(context, listen: false).setSelectedEssen(i + 1, "Essen ${i + 1}: ${menus[i]}"); + }, + ) + ], + ), + ), + ) + ], + ), + ); + }, + ); + } +} diff --git a/lib/providers/pageProvider.dart b/lib/providers/pageProvider.dart index b7517bb..17bb2a5 100644 --- a/lib/providers/pageProvider.dart +++ b/lib/providers/pageProvider.dart @@ -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 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(); + } } \ No newline at end of file diff --git a/pubspec.lock b/pubspec.lock index 17b0c46..84abb0b 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -91,6 +91,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: @@ -224,6 +240,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 +264,14 @@ 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" sdks: dart: ">=3.5.3 <4.0.0" flutter: ">=3.18.0-18.0.pre.54" diff --git a/pubspec.yaml b/pubspec.yaml index 8c4f18c..f9f4773 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -33,6 +33,7 @@ dependencies: provider: ^6.1.2 google_nav_bar: ^5.0.7 flutter_rating_bar: ^4.0.1 + http: ^1.2.2 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. From b7de4065f8d78445cbcdfa4aa16c260cc1b49537 Mon Sep 17 00:00:00 2001 From: Jonas Braus Date: Sun, 24 Nov 2024 21:59:39 +0100 Subject: [PATCH 2/3] Cached Http-Request MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit und gefixxt: tastur überlagert sich mit eingabefeld --- android/app/build.gradle | 6 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- android/settings.gradle | 4 +- lib/modules/fetchMenu.dart | 57 ++++- lib/pages/pageEssen.dart | 205 +++++++++--------- pubspec.lock | 129 ++++++++++- pubspec.yaml | 3 +- 7 files changed, 294 insertions(+), 112 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 0fd2d56..e23a5c8 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -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 { diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 7bb2df6..afa1e8e 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -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 diff --git a/android/settings.gradle b/android/settings.gradle index b9e43bd..b5e1b3f 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -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" diff --git a/lib/modules/fetchMenu.dart b/lib/modules/fetchMenu.dart index bed19ce..65f0800 100644 --- a/lib/modules/fetchMenu.dart +++ b/lib/modules/fetchMenu.dart @@ -1,10 +1,32 @@ +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> get() async { List menus = []; - // TODO: Proto: + if (!fetched || DateTime.now().difference(lastFetch).inHours >= 2) { + menus = await fromRequest(); + fetched = true; + } else { + menus = await fromCache(); + } + + return menus; + } + + static Future> fromCache() async { + return await loadCache(); + } + + static Future> fromRequest() async { + List menus = []; http.Response resp = await http.get(Uri.parse( "https://www.swfr.de/essen/mensen-cafes-speiseplaene/mensa-loerrach")); var content = resp.body.split("

"); @@ -15,7 +37,38 @@ class FetchMenu { menus.add(name); } } - // End-Proto + + await storeCache(menus); + + lastFetch = DateTime.now(); + + return menus; + } + + static Future storeCache(List 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> loadCache() async { + var prefs = await SharedPreferences.getInstance(); + + List menus = []; + + for (var i = 0; i < 4; i++) { + var curr = prefs.getString("menuCache$i"); + if (curr != "") { + menus.add(curr!); + } + } return menus; } diff --git a/lib/pages/pageEssen.dart b/lib/pages/pageEssen.dart index db9d015..fe94175 100644 --- a/lib/pages/pageEssen.dart +++ b/lib/pages/pageEssen.dart @@ -13,117 +13,120 @@ class PageEssen extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - 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, + body: SingleChildScrollView( + child: 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, + ), ), ), ), - ), - // Vordergrundinhalte + // Vordergrundinhalte - Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Consumer( - 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), + Center( child: Column( - crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - const Text( - "Geschmack*", - style: TextStyle(fontSize: 35), - ), - Consumer( - 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( - builder: (context, essenProvider, child) { - return RatingStars( - onRate: (value) { - essenProvider.setRatingQuali(value); - }, - initRating: essenProvider.ratingQuali, - ); - }, - ) - ], - ), - const SizedBox( - height: 50, - ), - Consumer( - 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), - ); + SizedBox(height: 200,), + Consumer( + 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( + 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( + builder: (context, essenProvider, child) { + return RatingStars( + onRate: (value) { + essenProvider.setRatingQuali(value); + }, + initRating: essenProvider.ratingQuali, + ); + }, + ) + ], + ), + const SizedBox( + height: 50, + ), + Consumer( + 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), + ); + }, + ), + ], + ), + ), ], - ), - ), - ], - )), - ], - ), + )), + ], + ), + ) ); } } diff --git a/pubspec.lock b/pubspec.lock index 84abb0b..d827ff6 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -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: @@ -179,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: @@ -187,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 @@ -272,6 +389,14 @@ packages: 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" diff --git a/pubspec.yaml b/pubspec.yaml index f9f4773..8366f4d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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 @@ -34,6 +34,7 @@ dependencies: 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. From 4b24d16387ec163159f8b091f45c01aadecdad4f Mon Sep 17 00:00:00 2001 From: Jonas Braus Date: Sun, 24 Nov 2024 22:09:11 +0100 Subject: [PATCH 3/3] Bug Fix for Bug Fix --- lib/pages/pageAmbiente.dart | 144 +++++++-------- lib/pages/pageAnmerkungen.dart | 167 ++++++++--------- lib/pages/pageEssen.dart | 221 +++++++++++----------- lib/pages/pageService.dart | 144 +++++++-------- lib/pages/pageSpezielleErnaehrung.dart | 242 +++++++++---------------- 5 files changed, 434 insertions(+), 484 deletions(-) diff --git a/lib/pages/pageAmbiente.dart b/lib/pages/pageAmbiente.dart index 886645d..85039f8 100644 --- a/lib/pages/pageAmbiente.dart +++ b/lib/pages/pageAmbiente.dart @@ -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( - 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( - builder: (context, essenProvider, child) { - return RatingStars(onRate: (value) { - essenProvider.setRatingFrage2(value); - }, initRating: essenProvider.ratingFrage2,); - }, - ) - ], - ), - const SizedBox( - height: 50, - ), - Consumer( - 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( + 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( + builder: (context, essenProvider, child) { + return RatingStars(onRate: (value) { + essenProvider.setRatingFrage2(value); + }, initRating: essenProvider.ratingFrage2,); + }, + ) + ], + ), + const SizedBox( + height: 50, + ), + Consumer( + 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), + ); + }, + ) + ], + ), ), ), ) diff --git a/lib/pages/pageAnmerkungen.dart b/lib/pages/pageAnmerkungen.dart index 6460322..6b65a13 100644 --- a/lib/pages/pageAnmerkungen.dart +++ b/lib/pages/pageAnmerkungen.dart @@ -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( - 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( - builder: (context, essenProvider, child) { - return RatingStars(onRate: (value) { - essenProvider.setRatingFrage2(value); - }, initRating: essenProvider.ratingFrage2,); - }, - ) - ], - ), - const SizedBox( - height: 50, - ), - Consumer( - 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( + 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( + builder: (context, essenProvider, child) { + return RatingStars( + onRate: (value) { + essenProvider.setRatingFrage2(value); + }, + initRating: essenProvider.ratingFrage2, + ); + }, + ) + ], + ), + const SizedBox( + height: 50, + ), + Consumer( + 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), + ); + }, + ) + ], + ), ), - ), - )], + ), + ) + ], ), ); } diff --git a/lib/pages/pageEssen.dart b/lib/pages/pageEssen.dart index fe94175..9d4720a 100644 --- a/lib/pages/pageEssen.dart +++ b/lib/pages/pageEssen.dart @@ -13,120 +13,125 @@ class PageEssen extends StatelessWidget { @override Widget build(BuildContext context) { return Scaffold( - body: SingleChildScrollView( - child: 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, - ), + 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, ), ), ), - // Vordergrundinhalte + ), + // Vordergrundinhalte - Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - SizedBox(height: 200,), - Consumer( - 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( - 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( - builder: (context, essenProvider, child) { - return RatingStars( - onRate: (value) { - essenProvider.setRatingQuali(value); - }, - initRating: essenProvider.ratingQuali, - ); - }, - ) - ], - ), - const SizedBox( - height: 50, - ), - Consumer( - 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: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Consumer( + 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( + 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( + builder: (context, essenProvider, child) { + return RatingStars( + onRate: (value) { + essenProvider.setRatingQuali(value); + }, + initRating: essenProvider.ratingQuali, + ); + }, + ) + ], + ), + const SizedBox( + height: 50, + ), + Consumer( + 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), - ); - }, - ), - ], - ), + ), + style: TextStyle(fontSize: 20), + ); + }, + ), + ], ), - ], - )), - ], - ), - ) + ), + ], + ), + ), + ), + ], + ), ); } } diff --git a/lib/pages/pageService.dart b/lib/pages/pageService.dart index 857b896..bcf89da 100644 --- a/lib/pages/pageService.dart +++ b/lib/pages/pageService.dart @@ -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( - 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( - builder: (context, essenProvider, child) { - return RatingStars(onRate: (value) { - essenProvider.setRatingFrage2(value); - }, initRating: essenProvider.ratingFrage2,); - }, - ) - ], - ), - const SizedBox( - height: 50, - ), - Consumer( - 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( + 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( + builder: (context, essenProvider, child) { + return RatingStars(onRate: (value) { + essenProvider.setRatingFrage2(value); + }, initRating: essenProvider.ratingFrage2,); + }, + ) + ], + ), + const SizedBox( + height: 50, + ), + Consumer( + 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), + ); + }, + ) + ], + ), ), ), ) diff --git a/lib/pages/pageSpezielleErnaehrung.dart b/lib/pages/pageSpezielleErnaehrung.dart index 801d156..816c94a 100644 --- a/lib/pages/pageSpezielleErnaehrung.dart +++ b/lib/pages/pageSpezielleErnaehrung.dart @@ -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( - 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( - builder: (context, spezielleErnaehrungProvider, child) { - return RatingStars(onRate: (value) { - spezielleErnaehrungProvider.setRatingKeineAhnung(value); - }, initRating: spezielleErnaehrungProvider.ratingKeineAhnung,); - }, - ), - - ], - ), - const SizedBox( - height: 50, - ), - Consumer( - 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( - 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( - builder: (context, spezielleErnaehrungProvider, child) { - return RatingStars(onRate: (value) { - spezielleErnaehrungProvider.setRatingKeineAhnung(value); - }, initRating: spezielleErnaehrungProvider.ratingKeineAhnung,); - }, - ), - - ], - ), - const SizedBox( - height: 50, - ), - Consumer( - 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( + 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( + builder: + (context, spezielleErnaehrungProvider, child) { + return RatingStars( + onRate: (value) { + spezielleErnaehrungProvider + .setRatingKeineAhnung(value); + }, + initRating: + spezielleErnaehrungProvider.ratingKeineAhnung, + ); + }, + ), + ], + ), + const SizedBox( + height: 50, + ), + Consumer( + 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), + ); + }, + ) + ], + ), + ), + ), + ) + ], ), ); }