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 {
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
Widget build(BuildContext context) {
@@ -146,17 +185,20 @@ class MyHome extends StatelessWidget {
bottom: 10,
child: IconButton.filled(
padding: const EdgeInsets.all(15),
onPressed: () {},
onPressed: () {
_showDeleteDialog(context); // Dialog anzeigen
},
icon: const Icon(
Icons.delete,
size: 30,
),
style: ButtonStyle(
shape: WidgetStateProperty.all(RoundedRectangleBorder(
borderRadius: BorderRadius.circular(17))),
backgroundColor: WidgetStateProperty.all(
Theme.of(context).colorScheme.primary,
)),
shape: WidgetStateProperty.all(RoundedRectangleBorder(
borderRadius: BorderRadius.circular(17))),
backgroundColor: WidgetStateProperty.all(
Theme.of(context).colorScheme.primary,
),
),
),
)
],
@@ -204,7 +246,7 @@ class MyHome extends StatelessWidget {
text: "Essen",
),
GButton(
icon: Icons.landscape,
icon: Icons.chair, /* prev: landscape*/
text: "Ambiente",
),
GButton(
+90 -73
View File
@@ -9,81 +9,98 @@ class PageAmbiente extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Center(
child: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/backgrounds/Ambiente.jpg"),
fit: BoxFit.cover,
colorFilter: ColorFilter.mode(
Colors.white.withOpacity(0.2),
BlendMode.dstATop
return Scaffold(
body: Stack(
children: [
Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/backgrounds/Ambiente.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: 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
Widget build(BuildContext context) {
return Center(
child: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/backgrounds/Anmerkungen.jpg"),
fit: BoxFit.cover,
colorFilter: ColorFilter.mode(
Colors.white.withOpacity(0.2),
BlendMode.dstATop
),
)
),
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)
),
return Scaffold(
body: Stack(
children: [
Container(
width: 1600,
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
),
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
Widget build(BuildContext context) {
return Center(
child: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/backgrounds/Essen.jpg"),
fit: BoxFit.cover,
colorFilter: ColorFilter.mode(
Colors.white.withOpacity(0.2),
BlendMode.dstATop
),
)
),
width: 600,
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)
),
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,
),
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
Widget build(BuildContext context) {
return Center(
child: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/backgrounds/Service.jpg"),
fit: BoxFit.cover,
colorFilter: ColorFilter.mode(
Colors.white.withOpacity(0.2),
BlendMode.dstATop
),
)
),
width: 600,
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)
),
return Scaffold(
body: Stack(
children: [
Container(
width: 1600,
height: 750,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/backgrounds/Service.jpg"),
fit: BoxFit.cover,
colorFilter: ColorFilter.mode(
Colors.white.withOpacity(0.2),
BlendMode.dstATop
),
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
Widget build(BuildContext context) {
return Center(
child: Container(
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/backgrounds/Speziell.jpg"),
fit: BoxFit.cover,
colorFilter: ColorFilter.mode(
Colors.white.withOpacity(0.2),
BlendMode.dstATop
return Scaffold(
body: Stack(
children: [
Container(
width: 1600,
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
),
)
),
),
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,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
+7
View File
@@ -19,4 +19,11 @@ class AmbienteProvider extends ChangeNotifier {
freiText = text;
notifyListeners();
}
void resetAllFields(){
freiText = "";
ratingFrage1 = 0;
ratingFrage2 = 0;
notifyListeners();
}
}
+7
View File
@@ -19,4 +19,11 @@ class AnmerkungProvider extends ChangeNotifier {
freiText = text;
notifyListeners();
}
void resetAllFields(){
freiText = "";
ratingFrage1 = 0;
ratingFrage2 = 0;
notifyListeners();
}
}
+7
View File
@@ -19,4 +19,11 @@ class EssenProvider extends ChangeNotifier {
freiText = text;
notifyListeners();
}
void resetAllFields(){
freiText = "";
ratingGeschmack = 0;
ratingQuali = 0;
notifyListeners();
}
}
+7
View File
@@ -19,4 +19,11 @@ class ServiceProvider extends ChangeNotifier {
freiText = text;
notifyListeners();
}
void resetAllFields(){
freiText = "";
ratingFrage1 = 0;
ratingFrage2 = 0;
notifyListeners();
}
}
@@ -20,4 +20,11 @@ class SpezielleErnaehrungProvider extends ChangeNotifier {
freiText = text;
notifyListeners();
}
void resetAllFields(){
freiText = "";
ratingSitzmoeglichkeit = 0;
ratingKeineAhnung = 0;
notifyListeners();
}
}