Merge branch 'Fixes' into 'main'

Fix Image Scaling Issue

See merge request brausjonas/mensaapp!14
This commit is contained in:
Jonas Braus
2024-11-25 15:48:37 +00:00
8 changed files with 357 additions and 340 deletions
+3
View File
@@ -0,0 +1,3 @@
description: This file stores settings for Dart & Flutter DevTools.
documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
extensions:
+20 -7
View File
@@ -13,25 +13,33 @@ class PageEssen extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final FocusNode _focus = FocusNode();
return Consumer<LanguageProvider>(builder: (context, languageProvider, child){ return Consumer<LanguageProvider>(builder: (context, languageProvider, child){
return Scaffold( return GestureDetector(
onTap: () {
_focus.unfocus();
},
child: Scaffold(
body: Stack( body: Stack(
children: [ children: [
// Hintergrundbild // Hintergrundbild
Container( Center(
width: 1600, child: Container(
height: 750, width: MediaQuery.of(context).size.width * 0.8,
height: MediaQuery.of(context).size.height,
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: AssetImage("assets/backgrounds/Essen.jpg"), image: AssetImage("assets/backgrounds/Essen.jpg"),
fit: BoxFit.cover, // Deckt den gesamten Bildschirm ab fit: BoxFit.cover, // Deckt den gesamten Bildschirm ab
colorFilter: ColorFilter.mode( colorFilter: ColorFilter.mode(
Colors.white.withOpacity(0.2), Colors.white.withOpacity(0.6),
BlendMode.dstATop, BlendMode.dstATop,
), ),
), ),
), ),
), ),
),
// Vordergrundinhalte // Vordergrundinhalte
Center( Center(
@@ -43,7 +51,7 @@ class PageEssen extends StatelessWidget {
builder: (context, pageProvider, child) { builder: (context, pageProvider, child) {
return Text( return Text(
pageProvider.selectedEssenName, pageProvider.selectedEssenName,
style: const TextStyle(fontSize: 40), style: TextStyle(fontSize: 40, fontWeight: FontWeight.bold),
); );
}, },
), ),
@@ -52,7 +60,7 @@ class PageEssen extends StatelessWidget {
), ),
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white.withOpacity(0.8), color: Colors.white.withOpacity(0.9),
borderRadius: const BorderRadius.only( borderRadius: const BorderRadius.only(
topLeft: Radius.circular(80), topLeft: Radius.circular(80),
bottomRight: Radius.circular(80))), bottomRight: Radius.circular(80))),
@@ -114,6 +122,7 @@ class PageEssen extends StatelessWidget {
autofocus: false, autofocus: false,
maxLength: 500, maxLength: 500,
maxLines: 4, maxLines: 4,
focusNode: _focus,
decoration: InputDecoration( decoration: InputDecoration(
labelText: Provider.of<LanguageProvider>(context).languageData[Provider.of<LanguageProvider>(context).language]["textfield"], labelText: Provider.of<LanguageProvider>(context).languageData[Provider.of<LanguageProvider>(context).language]["textfield"],
labelStyle: const TextStyle(fontSize: 20), labelStyle: const TextStyle(fontSize: 20),
@@ -121,6 +130,9 @@ class PageEssen extends StatelessWidget {
borderRadius: BorderRadius.circular(15), borderRadius: BorderRadius.circular(15),
), ),
), ),
onFieldSubmitted: (value) {
Navigator.pop(context);
},
style: TextStyle(fontSize: 20), style: TextStyle(fontSize: 20),
); );
}, },
@@ -134,6 +146,7 @@ class PageEssen extends StatelessWidget {
), ),
], ],
), ),
),
); );
}); });
} }
+6 -4
View File
@@ -21,20 +21,22 @@ class PageEssenSelect extends StatelessWidget {
return Scaffold( return Scaffold(
body: Stack( body: Stack(
children: [ children: [
Container( Center(
width: 1600, child: Container(
height: 750, width: MediaQuery.of(context).size.width * 0.8,
height: MediaQuery.of(context).size.height,
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: AssetImage("assets/backgrounds/Essen.jpg"), image: AssetImage("assets/backgrounds/Essen.jpg"),
fit: BoxFit.cover, // Deckt den gesamten Bildschirm ab fit: BoxFit.cover, // Deckt den gesamten Bildschirm ab
colorFilter: ColorFilter.mode( colorFilter: ColorFilter.mode(
Colors.white.withOpacity(0.2), Colors.white.withOpacity(0.6),
BlendMode.dstATop, BlendMode.dstATop,
), ),
), ),
), ),
), ),
),
Center( Center(
child: Container( child: Container(
child: Wrap( child: Wrap(
+16 -6
View File
@@ -10,29 +10,37 @@ class PageService extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final FocusNode _focus = FocusNode();
return Consumer<LanguageProvider>(builder: (context, languageProvider, child){ return Consumer<LanguageProvider>(builder: (context, languageProvider, child){
return Scaffold( return GestureDetector(
onTap: () {
_focus.unfocus();
},
child: Scaffold(
body: Stack( body: Stack(
children: [ children: [
Container( Center(
width: 1600, child: Container(
height: 750, width: MediaQuery.of(context).size.width * 0.8,
height: MediaQuery.of(context).size.height,
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: AssetImage("assets/backgrounds/Service.jpg"), image: AssetImage("assets/backgrounds/Service.jpg"),
fit: BoxFit.cover, fit: BoxFit.cover,
colorFilter: ColorFilter.mode( colorFilter: ColorFilter.mode(
Colors.white.withOpacity(0.2), Colors.white.withOpacity(0.6),
BlendMode.dstATop BlendMode.dstATop
), ),
) )
), ),
), ),
),
Center( Center(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white.withOpacity(0.8), color: Colors.white.withOpacity(0.9),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(80), topLeft: Radius.circular(80),
bottomRight: Radius.circular(80) bottomRight: Radius.circular(80)
@@ -90,6 +98,7 @@ class PageService extends StatelessWidget {
autofocus: false, autofocus: false,
maxLength: 500, maxLength: 500,
maxLines: 4, maxLines: 4,
focusNode: _focus,
decoration: InputDecoration( decoration: InputDecoration(
labelText: Provider.of<LanguageProvider>(context).languageData[Provider.of<LanguageProvider>(context).language]["textfield"], labelText: Provider.of<LanguageProvider>(context).languageData[Provider.of<LanguageProvider>(context).language]["textfield"],
labelStyle: const TextStyle(fontSize: 20), labelStyle: const TextStyle(fontSize: 20),
@@ -108,6 +117,7 @@ class PageService extends StatelessWidget {
) )
], ],
), ),
),
); );
}); });
} }
+17 -7
View File
@@ -12,26 +12,34 @@ class PageSpezielleErnaehrung extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final FocusNode _focus = FocusNode();
return Consumer<LanguageProvider>(builder: (context, languageProvider, child) { return Consumer<LanguageProvider>(builder: (context, languageProvider, child) {
return Scaffold( return GestureDetector(
onTap: () {
_focus.unfocus();
},
child: Scaffold(
body: Stack( body: Stack(
children: [ children: [
Container( Center(
width: 1600, child: Container(
height: 750, width: MediaQuery.of(context).size.width * 0.8,
height: MediaQuery.of(context).size.height,
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: AssetImage("assets/backgrounds/Speziell.jpg"), image: AssetImage("assets/backgrounds/Anmerkungen.jpg"),
fit: BoxFit.cover, fit: BoxFit.cover,
colorFilter: ColorFilter.mode( colorFilter: ColorFilter.mode(
Colors.white.withOpacity(0.2), BlendMode.dstATop), Colors.white.withOpacity(0.6), BlendMode.dstATop),
)), )),
), ),
),
Center( Center(
child: SingleChildScrollView( child: SingleChildScrollView(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white.withOpacity(0.8), color: Colors.white.withOpacity(0.9),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(80), topLeft: Radius.circular(80),
bottomRight: Radius.circular(80))), bottomRight: Radius.circular(80))),
@@ -99,6 +107,7 @@ class PageSpezielleErnaehrung extends StatelessWidget {
autofocus: false, autofocus: false,
maxLength: 500, maxLength: 500,
maxLines: 5, maxLines: 5,
focusNode: _focus,
decoration: InputDecoration( decoration: InputDecoration(
labelText: Provider.of<LanguageProvider>(context).languageData[Provider.of<LanguageProvider>(context).language]["textfield"], labelText: Provider.of<LanguageProvider>(context).languageData[Provider.of<LanguageProvider>(context).language]["textfield"],
labelStyle: const TextStyle(fontSize: 20), labelStyle: const TextStyle(fontSize: 20),
@@ -116,6 +125,7 @@ class PageSpezielleErnaehrung extends StatelessWidget {
) )
], ],
), ),
),
); );
}); });
} }
+6 -12
View File
@@ -39,10 +39,8 @@ class LanguageProvider extends ChangeNotifier {
"navBar": "navBar":
{ {
"0": "Essen", "0": "Essen",
"1": "Ambiente", "1": "Service",
"2": "Service", "2": "Spezielle Ernährung"
"3": "Anmerkungen",
"4": "Spezielle Ernährung"
}, },
"floating": "floating":
{ {
@@ -85,10 +83,8 @@ class LanguageProvider extends ChangeNotifier {
}, },
"navBar": { "navBar": {
"0": "Food", "0": "Food",
"1": "Ambience", "1": "Service",
"2": "Service", "2": "Special Diet"
"3": "Remarks",
"4": "Special Diet"
}, },
"floating": { "floating": {
"info": "* Required field", "info": "* Required field",
@@ -130,10 +126,8 @@ class LanguageProvider extends ChangeNotifier {
}, },
"navBar": { "navBar": {
"0": "Nourriture", "0": "Nourriture",
"1": "Ambiance", "1": "Service",
"2": "Service", "2": "Régime spécial"
"3": "Remarques",
"4": "Régime spécial"
}, },
"floating": { "floating": {
"info": "* Champ obligatoire", "info": "* Champ obligatoire",
-2
View File
@@ -12,9 +12,7 @@ class PageProvider extends ChangeNotifier {
String selectedEssenName = ""; String selectedEssenName = "";
List<Widget> pages = [ List<Widget> pages = [
const PageEssenSelect(), const PageEssenSelect(),
const PageAmbiente(),
const PageService(), const PageService(),
const PageAnmerkungen(),
const PageSpezielleErnaehrung() const PageSpezielleErnaehrung()
]; ];
+3 -16
View File
@@ -84,7 +84,7 @@ class SpaceRate extends StatelessWidget {
appBar: AppBar( appBar: AppBar(
leading: IconButton( leading: IconButton(
icon: Icon( icon: Icon(
Icons.home, Icons.home_rounded,
size: 36, size: 36,
color: Theme.of(context).colorScheme.onPrimary, color: Theme.of(context).colorScheme.onPrimary,
), ),
@@ -247,29 +247,16 @@ class SpaceRate extends StatelessWidget {
["navBar"]["0"], ["navBar"]["0"],
), ),
GButton( GButton(
icon: Icons.chair, icon: Icons.mood,
/* prev: landscape*/
text: Provider.of<LanguageProvider>(context).languageData[ text: Provider.of<LanguageProvider>(context).languageData[
Provider.of<LanguageProvider>(context).language] Provider.of<LanguageProvider>(context).language]
["navBar"]["1"], ["navBar"]["1"],
), ),
GButton(
icon: Icons.mood,
text: Provider.of<LanguageProvider>(context).languageData[
Provider.of<LanguageProvider>(context).language]
["navBar"]["2"],
),
GButton(
icon: Icons.feedback,
text: Provider.of<LanguageProvider>(context).languageData[
Provider.of<LanguageProvider>(context).language]
["navBar"]["3"],
),
GButton( GButton(
icon: Icons.grass, icon: Icons.grass,
text: Provider.of<LanguageProvider>(context).languageData[ text: Provider.of<LanguageProvider>(context).languageData[
Provider.of<LanguageProvider>(context).language] Provider.of<LanguageProvider>(context).language]
["navBar"]["4"], ["navBar"]["2"],
), ),
], ],
), ),