Fix Image Scaling Issue
+ on click outside textfield, close keyboard
This commit is contained in:
@@ -12,109 +12,119 @@ class PageSpezielleErnaehrung extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final FocusNode _focus = FocusNode();
|
||||
|
||||
return Consumer<LanguageProvider>(builder: (context, languageProvider, child) {
|
||||
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: SingleChildScrollView(
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
_focus.unfocus();
|
||||
},
|
||||
child: Scaffold(
|
||||
body: Stack(
|
||||
children: [
|
||||
Center(
|
||||
child: Container(
|
||||
width: MediaQuery.of(context).size.width * 0.8,
|
||||
height: MediaQuery.of(context).size.height,
|
||||
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: [
|
||||
Text(
|
||||
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: [
|
||||
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),
|
||||
);
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
image: DecorationImage(
|
||||
image: AssetImage("assets/backgrounds/Anmerkungen.jpg"),
|
||||
fit: BoxFit.cover,
|
||||
colorFilter: ColorFilter.mode(
|
||||
Colors.white.withOpacity(0.6), BlendMode.dstATop),
|
||||
)),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
Center(
|
||||
child: SingleChildScrollView(
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white.withOpacity(0.9),
|
||||
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: [
|
||||
Text(
|
||||
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: [
|
||||
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,
|
||||
focusNode: _focus,
|
||||
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),
|
||||
);
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user