Language Change
Dictionary has been modified, all texts are being translated now
This commit is contained in:
+169
-166
@@ -114,184 +114,187 @@ class MyHome extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Consumer<LanguageProvider>(builder: (context, languageProvider, child) {
|
||||||
appBar: AppBar(
|
return Scaffold(
|
||||||
leading: IconButton(
|
appBar: AppBar(
|
||||||
icon: Icon(
|
leading: IconButton(
|
||||||
Icons.home,
|
icon: Icon(
|
||||||
size: 36,
|
Icons.home,
|
||||||
color: Theme.of(context).colorScheme.onPrimary,
|
size: 36,
|
||||||
|
color: Theme.of(context).colorScheme.onPrimary,
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
// Aktion für diesen Button
|
||||||
|
},
|
||||||
),
|
),
|
||||||
onPressed: () {
|
title: Consumer<PageProvider>(
|
||||||
// Aktion für diesen Button
|
// Consumer verwenden, um den dynamischen Titel anzuzeigen
|
||||||
},
|
builder: (context, pageProvider, child) {
|
||||||
),
|
return Container(
|
||||||
title: Consumer<PageProvider>(
|
height: 40,
|
||||||
// Consumer verwenden, um den dynamischen Titel anzuzeigen
|
decoration: BoxDecoration(
|
||||||
builder: (context, pageProvider, child) {
|
color: Theme.of(context).colorScheme.primaryContainer,
|
||||||
return Container(
|
borderRadius: BorderRadius.circular(15),
|
||||||
height: 40,
|
),
|
||||||
decoration: BoxDecoration(
|
alignment: Alignment.centerLeft,
|
||||||
color: Theme.of(context).colorScheme.primaryContainer,
|
child: Text(
|
||||||
borderRadius: BorderRadius.circular(15),
|
languageProvider.languageData[Provider.of<LanguageProvider>(context).language]["navBar"][pageProvider.selectedPage.toString()],
|
||||||
),
|
// Hier wird der dynamische Titel angezeigt
|
||||||
alignment: Alignment.centerLeft,
|
style: TextStyle(
|
||||||
child: Text(
|
color: Theme.of(context).colorScheme.onPrimary,
|
||||||
pageProvider.titleString[pageProvider.selectedPage],
|
fontWeight: FontWeight.bold,
|
||||||
// Hier wird der dynamische Titel angezeigt
|
),
|
||||||
style: TextStyle(
|
),
|
||||||
color: Theme.of(context).colorScheme.onPrimary,
|
);
|
||||||
fontWeight: FontWeight.bold,
|
},
|
||||||
|
),
|
||||||
|
backgroundColor: Theme.of(context).colorScheme.primary,
|
||||||
|
actions: [
|
||||||
|
IconButton(
|
||||||
|
icon: Opacity(
|
||||||
|
opacity: Provider.of<LanguageProvider>(context).language == "de"
|
||||||
|
? 1.0 // Voll sichtbar
|
||||||
|
: 0.4, // Halb durchsichtig
|
||||||
|
child: Image.asset(
|
||||||
|
'assets/flags/de.png',
|
||||||
|
width: 34,
|
||||||
|
height: 24,
|
||||||
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
onPressed: () {
|
||||||
|
Provider.of<LanguageProvider>(context, listen: false)
|
||||||
|
.setLanguage("de");
|
||||||
|
},
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
icon: Opacity(
|
||||||
|
opacity: Provider.of<LanguageProvider>(context).language == "en"
|
||||||
|
? 1.0 // Voll sichtbar
|
||||||
|
: 0.4, // Halb durchsichtig
|
||||||
|
child: Image.asset(
|
||||||
|
'assets/flags/en.png',
|
||||||
|
width: 34,
|
||||||
|
height: 24,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
Provider.of<LanguageProvider>(context, listen: false)
|
||||||
|
.setLanguage("en");
|
||||||
|
},
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
icon: Opacity(
|
||||||
|
opacity: Provider.of<LanguageProvider>(context).language == "fr"
|
||||||
|
? 1.0 // Voll sichtbar
|
||||||
|
: 0.4, // Halb durchsichtig
|
||||||
|
child: Image.asset(
|
||||||
|
'assets/flags/fr.png',
|
||||||
|
width: 34,
|
||||||
|
height: 24,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
Provider.of<LanguageProvider>(context, listen: false)
|
||||||
|
.setLanguage("fr");
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
body: Consumer<PageProvider>(
|
||||||
|
builder: (context, pageProvider, child) {
|
||||||
|
return Stack(
|
||||||
|
children: [
|
||||||
|
pageProvider.pages[pageProvider.selectedPage],
|
||||||
|
Positioned(
|
||||||
|
left: 10,
|
||||||
|
bottom: 10,
|
||||||
|
child: IconButton.filled(
|
||||||
|
padding: const EdgeInsets.all(15),
|
||||||
|
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,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
backgroundColor: Theme.of(context).colorScheme.primary,
|
floatingActionButton: Column(
|
||||||
actions: [
|
mainAxisSize: MainAxisSize.min,
|
||||||
IconButton(
|
children: [
|
||||||
icon: Opacity(
|
Text(
|
||||||
opacity: Provider.of<LanguageProvider>(context).language == "de"
|
Provider.of<LanguageProvider>(context).languageData[Provider.of<LanguageProvider>(context).language]["floating"]["info"],
|
||||||
? 1.0 // Voll sichtbar
|
style: TextStyle(fontSize: 15),
|
||||||
: 0.4, // Halb durchsichtig
|
|
||||||
child: Image.asset(
|
|
||||||
'assets/flags/de.png',
|
|
||||||
width: 34,
|
|
||||||
height: 24,
|
|
||||||
fit: BoxFit.cover,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
onPressed: () {
|
const SizedBox(
|
||||||
Provider.of<LanguageProvider>(context, listen: false)
|
height: 10,
|
||||||
.setLanguage("de");
|
|
||||||
},
|
|
||||||
),
|
|
||||||
IconButton(
|
|
||||||
icon: Opacity(
|
|
||||||
opacity: Provider.of<LanguageProvider>(context).language == "en"
|
|
||||||
? 1.0 // Voll sichtbar
|
|
||||||
: 0.4, // Halb durchsichtig
|
|
||||||
child: Image.asset(
|
|
||||||
'assets/flags/en.png',
|
|
||||||
width: 34,
|
|
||||||
height: 24,
|
|
||||||
fit: BoxFit.cover,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
onPressed: () {
|
FloatingActionButton.extended(
|
||||||
Provider.of<LanguageProvider>(context, listen: false)
|
onPressed: () {},
|
||||||
.setLanguage("en");
|
label: Text(
|
||||||
},
|
Provider.of<LanguageProvider>(context).languageData[Provider.of<LanguageProvider>(context).language]["floating"]["return"],
|
||||||
),
|
style: TextStyle(fontSize: 20),
|
||||||
IconButton(
|
|
||||||
icon: Opacity(
|
|
||||||
opacity: Provider.of<LanguageProvider>(context).language == "fr"
|
|
||||||
? 1.0 // Voll sichtbar
|
|
||||||
: 0.4, // Halb durchsichtig
|
|
||||||
child: Image.asset(
|
|
||||||
'assets/flags/fr.png',
|
|
||||||
width: 34,
|
|
||||||
height: 24,
|
|
||||||
fit: BoxFit.cover,
|
|
||||||
),
|
),
|
||||||
),
|
icon: const Icon(Icons.send),
|
||||||
onPressed: () {
|
)
|
||||||
Provider.of<LanguageProvider>(context, listen: false)
|
],
|
||||||
.setLanguage("fr");
|
),
|
||||||
},
|
bottomNavigationBar: Container(
|
||||||
),
|
color: Theme.of(context).colorScheme.secondary,
|
||||||
],
|
child: Padding(
|
||||||
),
|
padding: const EdgeInsets.all(5),
|
||||||
body: Consumer<PageProvider>(
|
child: GNav(
|
||||||
builder: (context, pageProvider, child) {
|
onTabChange: (index) {
|
||||||
return Stack(
|
Provider.of<PageProvider>(context, listen: false)
|
||||||
children: [
|
.changePage(index);
|
||||||
pageProvider.pages[pageProvider.selectedPage],
|
},
|
||||||
Positioned(
|
gap: 8,
|
||||||
left: 10,
|
style: GnavStyle.google,
|
||||||
bottom: 10,
|
backgroundColor: Colors.transparent,
|
||||||
child: IconButton.filled(
|
color: Theme.of(context).colorScheme.onSurface,
|
||||||
padding: const EdgeInsets.all(15),
|
activeColor: Theme.of(context).colorScheme.onPrimary,
|
||||||
onPressed: () {
|
tabBackgroundColor: Theme.of(context).colorScheme.primary,
|
||||||
_showDeleteDialog(context); // Dialog anzeigen
|
tabs: [
|
||||||
},
|
GButton(
|
||||||
icon: const Icon(
|
icon: Icons.fastfood_outlined,
|
||||||
Icons.delete,
|
text: Provider.of<LanguageProvider>(context).languageData[Provider.of<LanguageProvider>(context).language]["navBar"]["0"],
|
||||||
size: 30,
|
|
||||||
),
|
|
||||||
style: ButtonStyle(
|
|
||||||
shape: WidgetStateProperty.all(RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(17))),
|
|
||||||
backgroundColor: WidgetStateProperty.all(
|
|
||||||
Theme.of(context).colorScheme.primary,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
)
|
GButton(
|
||||||
],
|
icon: Icons.chair, /* prev: landscape*/
|
||||||
);
|
text: Provider.of<LanguageProvider>(context).languageData[Provider.of<LanguageProvider>(context).language]["navBar"]["1"],
|
||||||
},
|
),
|
||||||
),
|
GButton(
|
||||||
floatingActionButton: Column(
|
icon: Icons.mood,
|
||||||
mainAxisSize: MainAxisSize.min,
|
text: Provider.of<LanguageProvider>(context).languageData[Provider.of<LanguageProvider>(context).language]["navBar"]["2"],
|
||||||
children: [
|
),
|
||||||
const Text(
|
GButton(
|
||||||
"* Pflichtfeld",
|
icon: Icons.feedback,
|
||||||
style: TextStyle(fontSize: 15),
|
text: Provider.of<LanguageProvider>(context).languageData[Provider.of<LanguageProvider>(context).language]["navBar"]["3"],
|
||||||
),
|
),
|
||||||
const SizedBox(
|
GButton(
|
||||||
height: 10,
|
icon: Icons.grass,
|
||||||
),
|
text: Provider.of<LanguageProvider>(context).languageData[Provider.of<LanguageProvider>(context).language]["navBar"]["4"],
|
||||||
FloatingActionButton.extended(
|
),
|
||||||
onPressed: () {},
|
],
|
||||||
label: const Text(
|
|
||||||
"Absenden",
|
|
||||||
style: TextStyle(fontSize: 20),
|
|
||||||
),
|
),
|
||||||
icon: const Icon(Icons.send),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
bottomNavigationBar: Container(
|
|
||||||
color: Theme.of(context).colorScheme.secondary,
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(5),
|
|
||||||
child: GNav(
|
|
||||||
onTabChange: (index) {
|
|
||||||
Provider.of<PageProvider>(context, listen: false)
|
|
||||||
.changePage(index);
|
|
||||||
},
|
|
||||||
gap: 8,
|
|
||||||
style: GnavStyle.google,
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
color: Theme.of(context).colorScheme.onSurface,
|
|
||||||
activeColor: Theme.of(context).colorScheme.onPrimary,
|
|
||||||
tabBackgroundColor: Theme.of(context).colorScheme.primary,
|
|
||||||
tabs: const [
|
|
||||||
GButton(
|
|
||||||
icon: Icons.fastfood_outlined,
|
|
||||||
text: "Essen",
|
|
||||||
),
|
|
||||||
GButton(
|
|
||||||
icon: Icons.chair, /* prev: landscape*/
|
|
||||||
text: "Ambiente",
|
|
||||||
),
|
|
||||||
GButton(
|
|
||||||
icon: Icons.mood,
|
|
||||||
text: "Service",
|
|
||||||
),
|
|
||||||
GButton(
|
|
||||||
icon: Icons.feedback,
|
|
||||||
text: "Anmerkungen",
|
|
||||||
),
|
|
||||||
GButton(
|
|
||||||
icon: Icons.grass,
|
|
||||||
text: "Spezielle Ernährung",
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
);
|
||||||
);
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+96
-92
@@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:mensaapp/providers/languageProvider.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
import '../modules/ratingStars.dart';
|
import '../modules/ratingStars.dart';
|
||||||
@@ -9,101 +10,104 @@ class PageAmbiente extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Consumer<LanguageProvider>(builder: (context, languageProvider, child){
|
||||||
body: Stack(
|
return Scaffold(
|
||||||
children: [
|
body: Stack(
|
||||||
Container(
|
children: [
|
||||||
decoration: BoxDecoration(
|
Container(
|
||||||
image: DecorationImage(
|
decoration: BoxDecoration(
|
||||||
image: AssetImage("assets/backgrounds/Ambiente.jpg"),
|
image: DecorationImage(
|
||||||
fit: BoxFit.cover,
|
image: AssetImage("assets/backgrounds/Ambiente.jpg"),
|
||||||
colorFilter: ColorFilter.mode(
|
fit: BoxFit.cover,
|
||||||
Colors.white.withOpacity(0.2),
|
colorFilter: ColorFilter.mode(
|
||||||
BlendMode.dstATop
|
Colors.white.withOpacity(0.2),
|
||||||
),
|
BlendMode.dstATop
|
||||||
)
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Center(
|
|
||||||
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),
|
|
||||||
),
|
|
||||||
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),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
)
|
Center(
|
||||||
],
|
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: [
|
||||||
|
Text(
|
||||||
|
Provider.of<LanguageProvider>(context).languageData[Provider.of<LanguageProvider>(context).language]["pageAmbiente"]["question1"],
|
||||||
|
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: [
|
||||||
|
Text(
|
||||||
|
Provider.of<LanguageProvider>(context).languageData[Provider.of<LanguageProvider>(context).language]["pageAmbiente"]["question2"],
|
||||||
|
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: Provider.of<LanguageProvider>(context).languageData[Provider.of<LanguageProvider>(context).language]["textfield"],
|
||||||
|
labelStyle: const TextStyle(fontSize: 20),
|
||||||
|
border: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(15)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
style: TextStyle(fontSize: 20),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:mensaapp/providers/anmerkungProvider.dart';
|
import 'package:mensaapp/providers/anmerkungProvider.dart';
|
||||||
|
import 'package:mensaapp/providers/languageProvider.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
import '../modules/ratingStars.dart';
|
import '../modules/ratingStars.dart';
|
||||||
@@ -9,103 +10,106 @@ class PageAnmerkungen extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Consumer<LanguageProvider>(builder: (context, languageProvider, child)
|
||||||
body: Stack(
|
{
|
||||||
children: [
|
return Scaffold(
|
||||||
Container(
|
body: Stack(
|
||||||
width: 1600,
|
children: [
|
||||||
height: 800,
|
Container(
|
||||||
decoration: BoxDecoration(
|
width: 1600,
|
||||||
image: DecorationImage(
|
height: 800,
|
||||||
image: AssetImage("assets/backgrounds/Anmerkungen.jpg"),
|
decoration: BoxDecoration(
|
||||||
fit: BoxFit.cover,
|
image: DecorationImage(
|
||||||
colorFilter: ColorFilter.mode(
|
image: AssetImage("assets/backgrounds/Anmerkungen.jpg"),
|
||||||
Colors.white.withOpacity(0.2), BlendMode.dstATop),
|
fit: BoxFit.cover,
|
||||||
)),
|
colorFilter: ColorFilter.mode(
|
||||||
),
|
Colors.white.withOpacity(0.2), BlendMode.dstATop),
|
||||||
Center(
|
)),
|
||||||
child: SingleChildScrollView(
|
),
|
||||||
child: Container(
|
Center(
|
||||||
decoration: BoxDecoration(
|
child: SingleChildScrollView(
|
||||||
color: Colors.white.withOpacity(0.8),
|
child: Container(
|
||||||
borderRadius: BorderRadius.only(
|
decoration: BoxDecoration(
|
||||||
topLeft: Radius.circular(80),
|
color: Colors.white.withOpacity(0.8),
|
||||||
bottomRight: Radius.circular(80))),
|
borderRadius: BorderRadius.only(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 20),
|
topLeft: Radius.circular(80),
|
||||||
height: 400,
|
bottomRight: Radius.circular(80))),
|
||||||
width: 600,
|
padding: EdgeInsets.symmetric(horizontal: 20),
|
||||||
child: Column(
|
height: 400,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
width: 600,
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
child: Column(
|
||||||
children: [
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
Row(
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
children: [
|
||||||
children: [
|
Row(
|
||||||
const Text(
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
"Frage1*",
|
children: [
|
||||||
style: TextStyle(fontSize: 35),
|
Text(
|
||||||
),
|
Provider.of<LanguageProvider>(context).languageData[Provider.of<LanguageProvider>(context).language]["pageAnmerkungen"]["question1"],
|
||||||
Consumer<AnmerkungProvider>(
|
style: TextStyle(fontSize: 35),
|
||||||
builder: (context, essenProvider, child) {
|
|
||||||
return RatingStars(
|
|
||||||
onRate: (value) {
|
|
||||||
essenProvider.setRatingFrage1(value);
|
|
||||||
},
|
|
||||||
initRating: essenProvider.ratingFrage1,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
const Text(
|
|
||||||
"Frage2*",
|
|
||||||
style: TextStyle(fontSize: 35),
|
|
||||||
),
|
|
||||||
Consumer<AnmerkungProvider>(
|
|
||||||
builder: (context, essenProvider, child) {
|
|
||||||
return RatingStars(
|
|
||||||
onRate: (value) {
|
|
||||||
essenProvider.setRatingFrage2(value);
|
|
||||||
},
|
|
||||||
initRating: essenProvider.ratingFrage2,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 50,
|
|
||||||
),
|
|
||||||
Consumer<AnmerkungProvider>(
|
|
||||||
builder: (context, essenProvider, child) {
|
|
||||||
return TextFormField(
|
|
||||||
initialValue: essenProvider.freiText,
|
|
||||||
onChanged: (value) {
|
|
||||||
essenProvider.setFreiText(value);
|
|
||||||
},
|
|
||||||
autofocus: false,
|
|
||||||
maxLength: 500,
|
|
||||||
maxLines: 4,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
labelText: "Dein Feedback (optional)",
|
|
||||||
labelStyle: const TextStyle(fontSize: 20),
|
|
||||||
border: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(15)),
|
|
||||||
),
|
),
|
||||||
style: TextStyle(fontSize: 20),
|
Consumer<AnmerkungProvider>(
|
||||||
);
|
builder: (context, essenProvider, child) {
|
||||||
},
|
return RatingStars(
|
||||||
)
|
onRate: (value) {
|
||||||
],
|
essenProvider.setRatingFrage1(value);
|
||||||
|
},
|
||||||
|
initRating: essenProvider.ratingFrage1,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
Provider.of<LanguageProvider>(context).languageData[Provider.of<LanguageProvider>(context).language]["pageAnmerkungen"]["question2"],
|
||||||
|
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: Provider.of<LanguageProvider>(context).languageData[Provider.of<LanguageProvider>(context).language]["textfield"],
|
||||||
|
labelStyle: const TextStyle(fontSize: 20),
|
||||||
|
border: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(15)),
|
||||||
|
),
|
||||||
|
style: TextStyle(fontSize: 20),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
)
|
||||||
)
|
],
|
||||||
],
|
),
|
||||||
),
|
);
|
||||||
);
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+117
-114
@@ -4,6 +4,7 @@ import 'package:mensaapp/modules/fetchMenu.dart';
|
|||||||
import 'package:mensaapp/modules/ratingEmote.dart';
|
import 'package:mensaapp/modules/ratingEmote.dart';
|
||||||
import 'package:mensaapp/modules/ratingStars.dart';
|
import 'package:mensaapp/modules/ratingStars.dart';
|
||||||
import 'package:mensaapp/providers/essenProvider.dart';
|
import 'package:mensaapp/providers/essenProvider.dart';
|
||||||
|
import 'package:mensaapp/providers/languageProvider.dart';
|
||||||
import 'package:mensaapp/providers/pageProvider.dart';
|
import 'package:mensaapp/providers/pageProvider.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
@@ -12,126 +13,128 @@ class PageEssen extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Consumer<LanguageProvider>(builder: (context, languageProvider, child){
|
||||||
body: Stack(
|
return Scaffold(
|
||||||
children: [
|
body: Stack(
|
||||||
// Hintergrundbild
|
children: [
|
||||||
Container(
|
// Hintergrundbild
|
||||||
width: 1600,
|
Container(
|
||||||
height: 750,
|
width: 1600,
|
||||||
decoration: BoxDecoration(
|
height: 750,
|
||||||
image: DecorationImage(
|
decoration: BoxDecoration(
|
||||||
image: AssetImage("assets/backgrounds/Essen.jpg"),
|
image: DecorationImage(
|
||||||
fit: BoxFit.cover, // Deckt den gesamten Bildschirm ab
|
image: AssetImage("assets/backgrounds/Essen.jpg"),
|
||||||
colorFilter: ColorFilter.mode(
|
fit: BoxFit.cover, // Deckt den gesamten Bildschirm ab
|
||||||
Colors.white.withOpacity(0.2),
|
colorFilter: ColorFilter.mode(
|
||||||
BlendMode.dstATop,
|
Colors.white.withOpacity(0.2),
|
||||||
|
BlendMode.dstATop,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
// Vordergrundinhalte
|
||||||
// Vordergrundinhalte
|
|
||||||
|
|
||||||
Center(
|
Center(
|
||||||
child: SingleChildScrollView(
|
child: SingleChildScrollView(
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Consumer<PageProvider>(
|
Consumer<PageProvider>(
|
||||||
builder: (context, pageProvider, child) {
|
builder: (context, pageProvider, child) {
|
||||||
return Text(
|
return Text(
|
||||||
pageProvider.selectedEssenName,
|
pageProvider.selectedEssenName,
|
||||||
style: const TextStyle(fontSize: 40),
|
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),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
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: [
|
||||||
|
Text(
|
||||||
|
Provider.of<LanguageProvider>(context).languageData[Provider.of<LanguageProvider>(context).language]["pageEssen"]["question1"],
|
||||||
|
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: [
|
||||||
|
Text(
|
||||||
|
Provider.of<LanguageProvider>(context).languageData[Provider.of<LanguageProvider>(context).language]["pageEssen"]["question2"],
|
||||||
|
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: Provider.of<LanguageProvider>(context).languageData[Provider.of<LanguageProvider>(context).language]["textfield"],
|
||||||
|
labelStyle: const TextStyle(fontSize: 20),
|
||||||
|
border: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(15),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
style: TextStyle(fontSize: 20),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
),
|
);
|
||||||
);
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+98
-95
@@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:mensaapp/providers/languageProvider.dart';
|
||||||
import 'package:mensaapp/providers/serviceProvider.dart';
|
import 'package:mensaapp/providers/serviceProvider.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
@@ -9,103 +10,105 @@ class PageService extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Consumer<LanguageProvider>(builder: (context, languageProvider, child){
|
||||||
body: Stack(
|
return Scaffold(
|
||||||
children: [
|
body: Stack(
|
||||||
Container(
|
children: [
|
||||||
width: 1600,
|
Container(
|
||||||
height: 750,
|
width: 1600,
|
||||||
decoration: BoxDecoration(
|
height: 750,
|
||||||
image: DecorationImage(
|
decoration: BoxDecoration(
|
||||||
image: AssetImage("assets/backgrounds/Service.jpg"),
|
image: DecorationImage(
|
||||||
fit: BoxFit.cover,
|
image: AssetImage("assets/backgrounds/Service.jpg"),
|
||||||
colorFilter: ColorFilter.mode(
|
fit: BoxFit.cover,
|
||||||
Colors.white.withOpacity(0.2),
|
colorFilter: ColorFilter.mode(
|
||||||
BlendMode.dstATop
|
Colors.white.withOpacity(0.2),
|
||||||
),
|
BlendMode.dstATop
|
||||||
)
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Center(
|
|
||||||
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),
|
|
||||||
),
|
|
||||||
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: 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: [
|
||||||
|
Text(
|
||||||
|
Provider.of<LanguageProvider>(context).languageData[Provider.of<LanguageProvider>(context).language]["pageService"]["question1"],
|
||||||
|
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: [
|
||||||
|
Text(
|
||||||
|
Provider.of<LanguageProvider>(context).languageData[Provider.of<LanguageProvider>(context).language]["pageService"]["question2"],
|
||||||
|
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: Provider.of<LanguageProvider>(context).languageData[Provider.of<LanguageProvider>(context).language]["textfield"],
|
||||||
|
labelStyle: const TextStyle(fontSize: 20),
|
||||||
|
border: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(15)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
style: TextStyle(fontSize: 20),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
|
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
|
||||||
import 'package:mensaapp/modules/ratingEmote.dart';
|
import 'package:mensaapp/modules/ratingEmote.dart';
|
||||||
import 'package:mensaapp/modules/ratingStars.dart';
|
import 'package:mensaapp/modules/ratingStars.dart';
|
||||||
|
import 'package:mensaapp/providers/languageProvider.dart';
|
||||||
import 'package:mensaapp/providers/spezielleErnaehrungProvider.dart';
|
import 'package:mensaapp/providers/spezielleErnaehrungProvider.dart';
|
||||||
|
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
@@ -11,109 +12,111 @@ class PageSpezielleErnaehrung extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Consumer<LanguageProvider>(builder: (context, languageProvider, child) {
|
||||||
body: Stack(
|
return Scaffold(
|
||||||
children: [
|
body: Stack(
|
||||||
Container(
|
children: [
|
||||||
width: 1600,
|
Container(
|
||||||
height: 750,
|
width: 1600,
|
||||||
decoration: BoxDecoration(
|
height: 750,
|
||||||
image: DecorationImage(
|
decoration: BoxDecoration(
|
||||||
image: AssetImage("assets/backgrounds/Speziell.jpg"),
|
image: DecorationImage(
|
||||||
fit: BoxFit.cover,
|
image: AssetImage("assets/backgrounds/Speziell.jpg"),
|
||||||
colorFilter: ColorFilter.mode(
|
fit: BoxFit.cover,
|
||||||
Colors.white.withOpacity(0.2), BlendMode.dstATop),
|
colorFilter: ColorFilter.mode(
|
||||||
)),
|
Colors.white.withOpacity(0.2), BlendMode.dstATop),
|
||||||
),
|
)),
|
||||||
Center(
|
),
|
||||||
child: SingleChildScrollView(
|
Center(
|
||||||
child: Container(
|
child: SingleChildScrollView(
|
||||||
decoration: BoxDecoration(
|
child: Container(
|
||||||
color: Colors.white.withOpacity(0.8),
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.only(
|
color: Colors.white.withOpacity(0.8),
|
||||||
topLeft: Radius.circular(80),
|
borderRadius: BorderRadius.only(
|
||||||
bottomRight: Radius.circular(80))),
|
topLeft: Radius.circular(80),
|
||||||
width: 650,
|
bottomRight: Radius.circular(80))),
|
||||||
height: 450,
|
width: 650,
|
||||||
padding: EdgeInsets.symmetric(horizontal: 20),
|
height: 450,
|
||||||
child: Column(
|
padding: EdgeInsets.symmetric(horizontal: 20),
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
Row(
|
children: [
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
Row(
|
||||||
children: [
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
const Text(
|
children: [
|
||||||
"Vegan?*",
|
Text(
|
||||||
style: TextStyle(fontSize: 35),
|
Provider.of<LanguageProvider>(context).languageData[Provider.of<LanguageProvider>(context).language]["pageSpecial"]["question1"],
|
||||||
),
|
style: TextStyle(fontSize: 35),
|
||||||
Consumer<SpezielleErnaehrungProvider>(
|
|
||||||
builder:
|
|
||||||
(context, spezielleErnaehrungProvider, child) {
|
|
||||||
return RatingStars(
|
|
||||||
onRate: (value) {
|
|
||||||
spezielleErnaehrungProvider
|
|
||||||
.setRatingSitzmoeglichkeit(value);
|
|
||||||
},
|
|
||||||
initRating: spezielleErnaehrungProvider
|
|
||||||
.ratingSitzmoeglichkeit,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
const Text(
|
|
||||||
"Keine Ahnung*",
|
|
||||||
style: TextStyle(fontSize: 35),
|
|
||||||
),
|
|
||||||
Consumer<SpezielleErnaehrungProvider>(
|
|
||||||
builder:
|
|
||||||
(context, spezielleErnaehrungProvider, child) {
|
|
||||||
return RatingStars(
|
|
||||||
onRate: (value) {
|
|
||||||
spezielleErnaehrungProvider
|
|
||||||
.setRatingKeineAhnung(value);
|
|
||||||
},
|
|
||||||
initRating:
|
|
||||||
spezielleErnaehrungProvider.ratingKeineAhnung,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
const SizedBox(
|
|
||||||
height: 50,
|
|
||||||
),
|
|
||||||
Consumer<SpezielleErnaehrungProvider>(
|
|
||||||
builder: (context, spezielleErnaehrungProvider, child) {
|
|
||||||
return TextFormField(
|
|
||||||
initialValue: spezielleErnaehrungProvider.freiText,
|
|
||||||
onChanged: (value) {
|
|
||||||
spezielleErnaehrungProvider.setFreiText(value);
|
|
||||||
},
|
|
||||||
autofocus: false,
|
|
||||||
maxLength: 500,
|
|
||||||
maxLines: 5,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
labelText: "Dein Feedback (optional)",
|
|
||||||
labelStyle: const TextStyle(fontSize: 20),
|
|
||||||
border: OutlineInputBorder(
|
|
||||||
borderRadius: BorderRadius.circular(15)),
|
|
||||||
),
|
),
|
||||||
style: TextStyle(fontSize: 20),
|
Consumer<SpezielleErnaehrungProvider>(
|
||||||
);
|
builder:
|
||||||
},
|
(context, spezielleErnaehrungProvider, child) {
|
||||||
)
|
return RatingStars(
|
||||||
],
|
onRate: (value) {
|
||||||
|
spezielleErnaehrungProvider
|
||||||
|
.setRatingSitzmoeglichkeit(value);
|
||||||
|
},
|
||||||
|
initRating: spezielleErnaehrungProvider
|
||||||
|
.ratingSitzmoeglichkeit,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
Provider.of<LanguageProvider>(context).languageData[Provider.of<LanguageProvider>(context).language]["pageSpecial"]["question2"],
|
||||||
|
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: Provider.of<LanguageProvider>(context).languageData[Provider.of<LanguageProvider>(context).language]["textfield"],
|
||||||
|
labelStyle: const TextStyle(fontSize: 20),
|
||||||
|
border: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(15)),
|
||||||
|
),
|
||||||
|
style: TextStyle(fontSize: 20),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
)
|
||||||
)
|
],
|
||||||
],
|
),
|
||||||
),
|
);
|
||||||
);
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,23 +6,21 @@ class LanguageProvider extends ChangeNotifier {
|
|||||||
Map<String, dynamic> languageData = {
|
Map<String, dynamic> languageData = {
|
||||||
"de":
|
"de":
|
||||||
{
|
{
|
||||||
"pageAmbiente":
|
"textfield": "Dein Feedback",
|
||||||
|
"pageAmbiente":
|
||||||
{
|
{
|
||||||
"question1": "Frage1",
|
"question1": "Frage1",
|
||||||
"question2": "Frage2",
|
"question2": "Frage2",
|
||||||
"textfield": "Dein Feedback"
|
|
||||||
},
|
},
|
||||||
"pageAnmerkungen":
|
"pageAnmerkungen":
|
||||||
{
|
{
|
||||||
"question1": "Frage1",
|
"question1": "Frage1",
|
||||||
"question2": "Frage2",
|
"question2": "Frage2",
|
||||||
"textfield": "Dein Feedback"
|
|
||||||
},
|
},
|
||||||
"pageEssen":
|
"pageEssen":
|
||||||
{
|
{
|
||||||
"question1": "Geschmack",
|
"question1": "Geschmack",
|
||||||
"question2": "Qualität",
|
"question2": "Qualität",
|
||||||
"textfield": "Dein Feedback"
|
|
||||||
},
|
},
|
||||||
"pageHome":
|
"pageHome":
|
||||||
{
|
{
|
||||||
@@ -32,21 +30,19 @@ class LanguageProvider extends ChangeNotifier {
|
|||||||
{
|
{
|
||||||
"question1": "Frage1",
|
"question1": "Frage1",
|
||||||
"question2": "Frage2",
|
"question2": "Frage2",
|
||||||
"textfield": "Dein Feedback"
|
|
||||||
},
|
},
|
||||||
"pageSpecial":
|
"pageSpecial":
|
||||||
{
|
{
|
||||||
"question1": "Frage1",
|
"question1": "Frage1",
|
||||||
"question2": "Frage2",
|
"question2": "Frage2",
|
||||||
"textfield": "Dein Feedback"
|
|
||||||
},
|
},
|
||||||
"navBar":
|
"navBar":
|
||||||
{
|
{
|
||||||
"symbol1": "Essen",
|
"0": "Essen",
|
||||||
"symbol2": "Ambiente",
|
"1": "Ambiente",
|
||||||
"symbol3": "Service",
|
"2": "Service",
|
||||||
"symbol4": "Anmerkungen",
|
"3": "Anmerkungen",
|
||||||
"symbol5": "Spezielle Ernährung"
|
"4": "Spezielle Ernährung"
|
||||||
},
|
},
|
||||||
"floating":
|
"floating":
|
||||||
{
|
{
|
||||||
@@ -63,20 +59,18 @@ class LanguageProvider extends ChangeNotifier {
|
|||||||
},
|
},
|
||||||
"en":
|
"en":
|
||||||
{
|
{
|
||||||
"pageAmbiente": {
|
"textfield": "Your Feedback",
|
||||||
|
"pageAmbiente": {
|
||||||
"question1": "Question1",
|
"question1": "Question1",
|
||||||
"question2": "Question2",
|
"question2": "Question2",
|
||||||
"textfield": "Your Feedback"
|
|
||||||
},
|
},
|
||||||
"pageAnmerkungen": {
|
"pageAnmerkungen": {
|
||||||
"question1": "Question1",
|
"question1": "Question1",
|
||||||
"question2": "Question2",
|
"question2": "Question2",
|
||||||
"textfield": "Your Feedback"
|
|
||||||
},
|
},
|
||||||
"pageEssen": {
|
"pageEssen": {
|
||||||
"question1": "Taste",
|
"question1": "Taste",
|
||||||
"question2": "Quality",
|
"question2": "Quality",
|
||||||
"textfield": "Your Feedback"
|
|
||||||
},
|
},
|
||||||
"pageHome": {
|
"pageHome": {
|
||||||
|
|
||||||
@@ -84,19 +78,17 @@ class LanguageProvider extends ChangeNotifier {
|
|||||||
"pageService": {
|
"pageService": {
|
||||||
"question1": "Question1",
|
"question1": "Question1",
|
||||||
"question2": "Question2",
|
"question2": "Question2",
|
||||||
"textfield": "Your Feedback"
|
|
||||||
},
|
},
|
||||||
"pageSpecial": {
|
"pageSpecial": {
|
||||||
"question1": "Question1",
|
"question1": "Question1",
|
||||||
"question2": "Question2",
|
"question2": "Question2",
|
||||||
"textfield": "Your Feedback"
|
|
||||||
},
|
},
|
||||||
"navBar": {
|
"navBar": {
|
||||||
"symbol1": "Food",
|
"0": "Food",
|
||||||
"symbol2": "Ambience",
|
"1": "Ambience",
|
||||||
"symbol3": "Service",
|
"2": "Service",
|
||||||
"symbol4": "Remarks",
|
"3": "Remarks",
|
||||||
"symbol5": "Special Diet"
|
"4": "Special Diet"
|
||||||
},
|
},
|
||||||
"floating": {
|
"floating": {
|
||||||
"info": "* Required field",
|
"info": "* Required field",
|
||||||
@@ -112,20 +104,18 @@ class LanguageProvider extends ChangeNotifier {
|
|||||||
},
|
},
|
||||||
"fr":
|
"fr":
|
||||||
{
|
{
|
||||||
"pageAmbiente": {
|
"textfield": "Votre avis",
|
||||||
|
"pageAmbiente": {
|
||||||
"question1": "Question1",
|
"question1": "Question1",
|
||||||
"question2": "Question2",
|
"question2": "Question2",
|
||||||
"textfield": "Votre avis"
|
|
||||||
},
|
},
|
||||||
"pageAnmerkungen": {
|
"pageAnmerkungen": {
|
||||||
"question1": "Question1",
|
"question1": "Question1",
|
||||||
"question2": "Question2",
|
"question2": "Question2",
|
||||||
"textfield": "Votre avis"
|
|
||||||
},
|
},
|
||||||
"pageEssen": {
|
"pageEssen": {
|
||||||
"question1": "Goût",
|
"question1": "Goût",
|
||||||
"question2": "Qualité",
|
"question2": "Qualité",
|
||||||
"textfield": "Votre avis"
|
|
||||||
},
|
},
|
||||||
"pageHome": {
|
"pageHome": {
|
||||||
|
|
||||||
@@ -133,19 +123,17 @@ class LanguageProvider extends ChangeNotifier {
|
|||||||
"pageService": {
|
"pageService": {
|
||||||
"question1": "Question1",
|
"question1": "Question1",
|
||||||
"question2": "Question2",
|
"question2": "Question2",
|
||||||
"textfield": "Votre avis"
|
|
||||||
},
|
},
|
||||||
"pageSpecial": {
|
"pageSpecial": {
|
||||||
"question1": "Question1",
|
"question1": "Question1",
|
||||||
"question2": "Question2",
|
"question2": "Question2",
|
||||||
"textfield": "Votre avis"
|
|
||||||
},
|
},
|
||||||
"navBar": {
|
"navBar": {
|
||||||
"symbol1": "Nourriture",
|
"0": "Nourriture",
|
||||||
"symbol2": "Ambiance",
|
"1": "Ambiance",
|
||||||
"symbol3": "Service",
|
"2": "Service",
|
||||||
"symbol4": "Remarques",
|
"3": "Remarques",
|
||||||
"symbol5": "Régime spécial"
|
"4": "Régime spécial"
|
||||||
},
|
},
|
||||||
"floating": {
|
"floating": {
|
||||||
"info": "* Champ obligatoire",
|
"info": "* Champ obligatoire",
|
||||||
|
|||||||
@@ -18,14 +18,6 @@ class PageProvider extends ChangeNotifier {
|
|||||||
const PageSpezielleErnaehrung()
|
const PageSpezielleErnaehrung()
|
||||||
];
|
];
|
||||||
|
|
||||||
List<String> titleString = [
|
|
||||||
"Essen",
|
|
||||||
"Ambiente",
|
|
||||||
"Service",
|
|
||||||
"Anmerkungen",
|
|
||||||
"Spezielle Ernährung"
|
|
||||||
];
|
|
||||||
|
|
||||||
void changePage(int index) {
|
void changePage(int index) {
|
||||||
selectedPage = index;
|
selectedPage = index;
|
||||||
notifyListeners();
|
notifyListeners();
|
||||||
|
|||||||
Reference in New Issue
Block a user