Merge branch 'delete_ratings' into 'main'

delete all kinda stuff

See merge request brausjonas/mensaapp!9
This commit is contained in:
Jonas Braus
2024-11-24 12:25:39 +00:00
11 changed files with 559 additions and 313 deletions
+49 -7
View File
@@ -63,6 +63,45 @@ class MyApp extends StatelessWidget {
class MyHome extends StatelessWidget { class MyHome extends StatelessWidget {
const MyHome({super.key}); const MyHome({super.key});
void _showDeleteDialog(BuildContext context) {
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(20),
),
title: const Text("Bewertungen löschen"),
content: const Text("Möchtest du alle Eingaben entfernen?",
style: TextStyle(fontSize: 18),),
actions: [
ElevatedButton(
onPressed: () {
Navigator.of(context).pop();
},
child: Text("Behalten"),
style: ElevatedButton.styleFrom(
backgroundColor: Theme.of(context).colorScheme.secondary
),
),
ElevatedButton(
onPressed: () {
Provider.of<AnmerkungProvider>(context, listen: false).resetAllFields();
Provider.of<EssenProvider>(context, listen: false).resetAllFields();
Provider.of<AmbienteProvider>(context, listen: false).resetAllFields();
Provider.of<ServiceProvider>(context, listen: false).resetAllFields();
Provider.of<SpezielleErnaehrungProvider>(context, listen: false).resetAllFields();
// Hier Aktion für Löschen ausführen
Navigator.of(context).pop(); // Dialog schließen
},
child: Text("Löschen"),
)
],
);
},
);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@@ -146,17 +185,20 @@ class MyHome extends StatelessWidget {
bottom: 10, bottom: 10,
child: IconButton.filled( child: IconButton.filled(
padding: const EdgeInsets.all(15), padding: const EdgeInsets.all(15),
onPressed: () {}, onPressed: () {
_showDeleteDialog(context); // Dialog anzeigen
},
icon: const Icon( icon: const Icon(
Icons.delete, Icons.delete,
size: 30, size: 30,
), ),
style: ButtonStyle( style: ButtonStyle(
shape: WidgetStateProperty.all(RoundedRectangleBorder( shape: WidgetStateProperty.all(RoundedRectangleBorder(
borderRadius: BorderRadius.circular(17))), borderRadius: BorderRadius.circular(17))),
backgroundColor: WidgetStateProperty.all( backgroundColor: WidgetStateProperty.all(
Theme.of(context).colorScheme.primary, Theme.of(context).colorScheme.primary,
)), ),
),
), ),
) )
], ],
@@ -204,7 +246,7 @@ class MyHome extends StatelessWidget {
text: "Essen", text: "Essen",
), ),
GButton( GButton(
icon: Icons.landscape, icon: Icons.chair, /* prev: landscape*/
text: "Ambiente", text: "Ambiente",
), ),
GButton( GButton(
+90 -73
View File
@@ -9,81 +9,98 @@ class PageAmbiente extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Center( return Scaffold(
child: Container( body: Stack(
decoration: BoxDecoration( children: [
image: DecorationImage( Container(
image: AssetImage("assets/backgrounds/Ambiente.jpg"), decoration: BoxDecoration(
fit: BoxFit.cover, image: DecorationImage(
colorFilter: ColorFilter.mode( image: AssetImage("assets/backgrounds/Ambiente.jpg"),
Colors.white.withOpacity(0.2), fit: BoxFit.cover,
BlendMode.dstATop 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: 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)
),
),
style: TextStyle(fontSize: 20),
);
},
)
],
),
), ),
) )
), ],
width: 600,
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)
),
),
style: TextStyle(fontSize: 20),
);
},
)
],
),
), ),
); );
} }
+92 -74
View File
@@ -9,81 +9,99 @@ class PageAnmerkungen extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Center( return Scaffold(
child: Container( body: Stack(
decoration: BoxDecoration( children: [
image: DecorationImage( Container(
image: AssetImage("assets/backgrounds/Anmerkungen.jpg"), width: 1600,
fit: BoxFit.cover, height: 800,
colorFilter: ColorFilter.mode( decoration: BoxDecoration(
Colors.white.withOpacity(0.2), image: DecorationImage(
BlendMode.dstATop image: AssetImage("assets/backgrounds/Anmerkungen.jpg"),
), fit: BoxFit.cover,
) colorFilter: ColorFilter.mode(
), Colors.white.withOpacity(0.2),
width: 600, BlendMode.dstATop
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)
),
), ),
style: TextStyle(fontSize: 20), )
); ),
}, ),
) 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)
),
),
style: TextStyle(fontSize: 20),
);
},
)
],
),
),
)],
), ),
); );
} }
+101 -74
View File
@@ -10,81 +10,108 @@ class PageEssen extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Center( return Scaffold(
child: Container( body: Stack(
decoration: BoxDecoration( children: [
image: DecorationImage( // Hintergrundbild
image: AssetImage("assets/backgrounds/Essen.jpg"), Container(
fit: BoxFit.cover, width: 1600,
colorFilter: ColorFilter.mode( height: 750,
Colors.white.withOpacity(0.2), decoration: BoxDecoration(
BlendMode.dstATop image: DecorationImage(
), image: AssetImage("assets/backgrounds/Essen.jpg"),
) fit: BoxFit.cover, // Deckt den gesamten Bildschirm ab
), colorFilter: ColorFilter.mode(
width: 600, Colors.white.withOpacity(0.2),
child: Column( BlendMode.dstATop,
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), ),
); ),
}, ),
) // 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<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),
);
},
),
],
),
),
),
],
), ),
); );
} }
+93 -74
View File
@@ -9,81 +9,100 @@ class PageService extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Center( return Scaffold(
child: Container( body: Stack(
decoration: BoxDecoration( children: [
image: DecorationImage( Container(
image: AssetImage("assets/backgrounds/Service.jpg"), width: 1600,
fit: BoxFit.cover, height: 750,
colorFilter: ColorFilter.mode( decoration: BoxDecoration(
Colors.white.withOpacity(0.2), image: DecorationImage(
BlendMode.dstATop image: AssetImage("assets/backgrounds/Service.jpg"),
), fit: BoxFit.cover,
) colorFilter: ColorFilter.mode(
), Colors.white.withOpacity(0.2),
width: 600, BlendMode.dstATop
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)
),
), ),
style: TextStyle(fontSize: 20), )
); ),
}, ),
) 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)
),
),
style: TextStyle(fontSize: 20),
);
},
)
],
),
),
)
],
), ),
); );
} }
+99 -11
View File
@@ -11,18 +11,106 @@ class PageSpezielleErnaehrung extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Center( return Scaffold(
child: Container( body: Stack(
decoration: BoxDecoration( children: [
image: DecorationImage( Container(
image: AssetImage("assets/backgrounds/Speziell.jpg"), width: 1600,
fit: BoxFit.cover, height: 750,
colorFilter: ColorFilter.mode( decoration: BoxDecoration(
Colors.white.withOpacity(0.2), image: DecorationImage(
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)
),
),
style: TextStyle(fontSize: 20),
);
},
)
],
),
),
)
],
),
);
Center(
child: Container(
width: 800, width: 800,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
+7
View File
@@ -19,4 +19,11 @@ class AmbienteProvider extends ChangeNotifier {
freiText = text; freiText = text;
notifyListeners(); notifyListeners();
} }
void resetAllFields(){
freiText = "";
ratingFrage1 = 0;
ratingFrage2 = 0;
notifyListeners();
}
} }
+7
View File
@@ -19,4 +19,11 @@ class AnmerkungProvider extends ChangeNotifier {
freiText = text; freiText = text;
notifyListeners(); notifyListeners();
} }
void resetAllFields(){
freiText = "";
ratingFrage1 = 0;
ratingFrage2 = 0;
notifyListeners();
}
} }
+7
View File
@@ -19,4 +19,11 @@ class EssenProvider extends ChangeNotifier {
freiText = text; freiText = text;
notifyListeners(); notifyListeners();
} }
void resetAllFields(){
freiText = "";
ratingGeschmack = 0;
ratingQuali = 0;
notifyListeners();
}
} }
+7
View File
@@ -19,4 +19,11 @@ class ServiceProvider extends ChangeNotifier {
freiText = text; freiText = text;
notifyListeners(); notifyListeners();
} }
void resetAllFields(){
freiText = "";
ratingFrage1 = 0;
ratingFrage2 = 0;
notifyListeners();
}
} }
@@ -20,4 +20,11 @@ class SpezielleErnaehrungProvider extends ChangeNotifier {
freiText = text; freiText = text;
notifyListeners(); notifyListeners();
} }
void resetAllFields(){
freiText = "";
ratingSitzmoeglichkeit = 0;
ratingKeineAhnung = 0;
notifyListeners();
}
} }