Fix Image Scaling Issue

+ on click outside textfield, close keyboard
This commit is contained in:
Jonas Braus
2024-11-25 16:40:48 +01:00
parent 8ab4e4cd5f
commit 5b346976f2
7 changed files with 348 additions and 325 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
Widget build(BuildContext context) {
final FocusNode _focus = FocusNode();
return Consumer<LanguageProvider>(builder: (context, languageProvider, child){
return Scaffold(
return GestureDetector(
onTap: () {
_focus.unfocus();
},
child: Scaffold(
body: Stack(
children: [
// Hintergrundbild
Container(
width: 1600,
height: 750,
Center(
child: Container(
width: MediaQuery.of(context).size.width * 0.8,
height: MediaQuery.of(context).size.height,
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),
Colors.white.withOpacity(0.6),
BlendMode.dstATop,
),
),
),
),
),
// Vordergrundinhalte
Center(
@@ -43,7 +51,7 @@ class PageEssen extends StatelessWidget {
builder: (context, pageProvider, child) {
return Text(
pageProvider.selectedEssenName,
style: const TextStyle(fontSize: 40),
style: TextStyle(fontSize: 40, fontWeight: FontWeight.bold),
);
},
),
@@ -52,7 +60,7 @@ class PageEssen extends StatelessWidget {
),
Container(
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.8),
color: Colors.white.withOpacity(0.9),
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(80),
bottomRight: Radius.circular(80))),
@@ -114,6 +122,7 @@ class PageEssen extends StatelessWidget {
autofocus: false,
maxLength: 500,
maxLines: 4,
focusNode: _focus,
decoration: InputDecoration(
labelText: Provider.of<LanguageProvider>(context).languageData[Provider.of<LanguageProvider>(context).language]["textfield"],
labelStyle: const TextStyle(fontSize: 20),
@@ -121,6 +130,9 @@ class PageEssen extends StatelessWidget {
borderRadius: BorderRadius.circular(15),
),
),
onFieldSubmitted: (value) {
Navigator.pop(context);
},
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(
body: Stack(
children: [
Container(
width: 1600,
height: 750,
Center(
child: Container(
width: MediaQuery.of(context).size.width * 0.8,
height: MediaQuery.of(context).size.height,
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),
Colors.white.withOpacity(0.6),
BlendMode.dstATop,
),
),
),
),
),
Center(
child: Container(
child: Wrap(
+16 -6
View File
@@ -10,29 +10,37 @@ class PageService extends StatelessWidget {
@override
Widget build(BuildContext context) {
final FocusNode _focus = FocusNode();
return Consumer<LanguageProvider>(builder: (context, languageProvider, child){
return Scaffold(
return GestureDetector(
onTap: () {
_focus.unfocus();
},
child: Scaffold(
body: Stack(
children: [
Container(
width: 1600,
height: 750,
Center(
child: Container(
width: MediaQuery.of(context).size.width * 0.8,
height: MediaQuery.of(context).size.height,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/backgrounds/Service.jpg"),
fit: BoxFit.cover,
colorFilter: ColorFilter.mode(
Colors.white.withOpacity(0.2),
Colors.white.withOpacity(0.6),
BlendMode.dstATop
),
)
),
),
),
Center(
child: SingleChildScrollView(
child: Container(
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.8),
color: Colors.white.withOpacity(0.9),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(80),
bottomRight: Radius.circular(80)
@@ -90,6 +98,7 @@ class PageService extends StatelessWidget {
autofocus: false,
maxLength: 500,
maxLines: 4,
focusNode: _focus,
decoration: InputDecoration(
labelText: Provider.of<LanguageProvider>(context).languageData[Provider.of<LanguageProvider>(context).language]["textfield"],
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
Widget build(BuildContext context) {
final FocusNode _focus = FocusNode();
return Consumer<LanguageProvider>(builder: (context, languageProvider, child) {
return Scaffold(
return GestureDetector(
onTap: () {
_focus.unfocus();
},
child: Scaffold(
body: Stack(
children: [
Container(
width: 1600,
height: 750,
Center(
child: Container(
width: MediaQuery.of(context).size.width * 0.8,
height: MediaQuery.of(context).size.height,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage("assets/backgrounds/Speziell.jpg"),
image: AssetImage("assets/backgrounds/Anmerkungen.jpg"),
fit: BoxFit.cover,
colorFilter: ColorFilter.mode(
Colors.white.withOpacity(0.2), BlendMode.dstATop),
Colors.white.withOpacity(0.6), BlendMode.dstATop),
)),
),
),
Center(
child: SingleChildScrollView(
child: Container(
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.8),
color: Colors.white.withOpacity(0.9),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(80),
bottomRight: Radius.circular(80))),
@@ -99,6 +107,7 @@ class PageSpezielleErnaehrung extends StatelessWidget {
autofocus: false,
maxLength: 500,
maxLines: 5,
focusNode: _focus,
decoration: InputDecoration(
labelText: Provider.of<LanguageProvider>(context).languageData[Provider.of<LanguageProvider>(context).language]["textfield"],
labelStyle: const TextStyle(fontSize: 20),
@@ -116,6 +125,7 @@ class PageSpezielleErnaehrung extends StatelessWidget {
)
],
),
),
);
});
}
-2
View File
@@ -12,9 +12,7 @@ class PageProvider extends ChangeNotifier {
String selectedEssenName = "";
List<Widget> pages = [
const PageEssenSelect(),
const PageAmbiente(),
const PageService(),
const PageAnmerkungen(),
const PageSpezielleErnaehrung()
];
-13
View File
@@ -246,25 +246,12 @@ class SpaceRate extends StatelessWidget {
Provider.of<LanguageProvider>(context).language]
["navBar"]["0"],
),
GButton(
icon: Icons.chair,
/* prev: landscape*/
text: Provider.of<LanguageProvider>(context).languageData[
Provider.of<LanguageProvider>(context).language]
["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(
icon: Icons.grass,
text: Provider.of<LanguageProvider>(context).languageData[