WT1.1.2g Sizes fix

This commit is contained in:
bossanyit 2020-11-17 19:31:13 +01:00
parent b71544ba13
commit d984588567
2 changed files with 144 additions and 136 deletions

View File

@ -58,131 +58,137 @@ class _InputDialogState<Event> extends State<InputDialog<Event>> with Trans {
@override
Widget build(BuildContext context) {
return Dialog(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
elevation: 0,
backgroundColor: Colors.transparent,
child: _buildChild(context),
);
return SingleChildScrollView(
padding: EdgeInsets.only(
top: _nodeText1.hasFocus
? 0 // adjust values according to your need
: MediaQuery.of(context).size.height / 2 - 250), // adjust values according to your need
child: Dialog(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
elevation: 0,
backgroundColor: Colors.transparent,
child: _buildChild(context),
));
}
_buildChild(BuildContext context) => Container(
height: 350,
decoration: BoxDecoration(color: Colors.grey[700], shape: BoxShape.rectangle, borderRadius: BorderRadius.all(Radius.circular(12))),
child: KeyboardActions(
config: _buildConfig(context),
child: Column(
children: <Widget>[
Container(
padding: const EdgeInsets.all(12.0),
child: Column(children: [
Text(
widget.title,
style: GoogleFonts.archivoBlack(
shadows: <Shadow>[
Shadow(
offset: Offset(3.0, 3.0),
blurRadius: 3.0,
color: Colors.black54,
),
],
fontSize: 25,
color: Colors.orange[500],
height: 350,
decoration: BoxDecoration(color: Colors.grey[700], shape: BoxShape.rectangle, borderRadius: BorderRadius.all(Radius.circular(12))),
child: KeyboardActions(
config: _buildConfig(context),
child: Column(
children: <Widget>[
Container(
padding: const EdgeInsets.all(0.0),
child: Column(children: [
Text(
widget.title,
style: GoogleFonts.archivoBlack(
shadows: <Shadow>[
Shadow(
offset: Offset(3.0, 3.0),
blurRadius: 3.0,
color: Colors.black54,
),
],
fontSize: 25,
color: Colors.orange[500],
),
),
),
Text(
widget.subtitle,
style: GoogleFonts.archivoBlack(
shadows: <Shadow>[
Shadow(
offset: Offset(3.0, 3.0),
blurRadius: 3.0,
color: Colors.black54,
),
],
fontSize: 30,
color: Colors.orange[500],
Text(
widget.subtitle,
style: GoogleFonts.archivoBlack(
shadows: <Shadow>[
Shadow(
offset: Offset(3.0, 3.0),
blurRadius: 3.0,
color: Colors.black54,
),
],
fontSize: 30,
color: Colors.orange[500],
),
),
),
]),
width: double.infinity,
decoration: BoxDecoration(
color: Colors.grey[900],
shape: BoxShape.rectangle,
borderRadius: BorderRadius.only(topLeft: Radius.circular(12), topRight: Radius.circular(12))),
),
SizedBox(
height: 8,
),
Padding(
padding: const EdgeInsets.only(top: 20, right: 16, left: 16),
child: Text(
t("Please type the following data:"),
style: GoogleFonts.inter(fontSize: 16, color: Colors.yellow[200], shadows: <Shadow>[
Shadow(
offset: Offset(2.0, 2.0),
blurRadius: 3.0,
color: Colors.black54,
)
]),
textAlign: TextAlign.center,
width: double.infinity,
decoration: BoxDecoration(
color: Colors.grey[900],
shape: BoxShape.rectangle,
borderRadius: BorderRadius.only(topLeft: Radius.circular(12), topRight: Radius.circular(12))),
),
),
SizedBox(
height: 24,
),
Padding(
padding: const EdgeInsets.only(left: 90, right: 90),
child: TextFormField(
focusNode: _nodeText1,
decoration: InputDecoration(
contentPadding: EdgeInsets.only(left: 15, top: 5, bottom: 5),
labelText: widget.subtitle,
labelStyle: GoogleFonts.inter(fontSize: 16, color: Colors.yellow[50]),
fillColor: Colors.black38,
filled: true,
border: OutlineInputBorder(
gapPadding: 2.0,
borderRadius: BorderRadius.circular(12.0),
borderSide: BorderSide(color: Colors.white12, width: 0.4),
SizedBox(
height: 8,
),
Padding(
padding: const EdgeInsets.only(top: 20, right: 16, left: 16),
child: Text(
t("Please type the following data:"),
style: GoogleFonts.inter(fontSize: 16, color: Colors.yellow[200], shadows: <Shadow>[
Shadow(
offset: Offset(2.0, 2.0),
blurRadius: 3.0,
color: Colors.black54,
)
]),
textAlign: TextAlign.center,
),
),
SizedBox(
height: 24,
),
Padding(
padding: const EdgeInsets.only(left: 90, right: 90),
child: TextFormField(
focusNode: _nodeText1,
decoration: InputDecoration(
contentPadding: EdgeInsets.only(left: 15, top: 5, bottom: 5),
labelText: widget.subtitle,
labelStyle: GoogleFonts.inter(fontSize: 16, color: Colors.yellow[50]),
fillColor: Colors.black38,
filled: true,
border: OutlineInputBorder(
gapPadding: 2.0,
borderRadius: BorderRadius.circular(12.0),
borderSide: BorderSide(color: Colors.white12, width: 0.4),
),
),
initialValue: widget.initialValue.toStringAsFixed(0),
keyboardType: TextInputType.numberWithOptions(decimal: true),
textInputAction: TextInputAction.done,
style: GoogleFonts.archivoBlack(fontSize: 20, color: Colors.yellow[300]),
onChanged: (value) => this.inputValue = double.parse(value),
),
initialValue: widget.initialValue.toStringAsFixed(0),
keyboardType: TextInputType.numberWithOptions(decimal: true),
textInputAction: TextInputAction.done,
style: GoogleFonts.archivoBlack(fontSize: 20, color: Colors.yellow[300]),
onChanged: (value) => this.inputValue = double.parse(value),
),
),
SizedBox(
height: 24,
),
Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
RaisedButton(
onPressed: () {
Navigator.of(context).pop();
},
child: Text(t('Cancel')),
color: Colors.black26,
textColor: Colors.white,
),
SizedBox(
width: 8,
),
RaisedButton(
onPressed: () {
widget.onChanged(this.inputValue);
return Navigator.of(context).pop(true);
},
child: Text(t('Save')),
color: Colors.orange[600],
textColor: Colors.white,
)
],
)
],
SizedBox(
height: 24,
),
Row(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
RaisedButton(
onPressed: () {
Navigator.of(context).pop();
},
child: Text(t('Cancel')),
color: Colors.black26,
textColor: Colors.white,
),
SizedBox(
width: 8,
),
RaisedButton(
onPressed: () {
widget.onChanged(this.inputValue);
return Navigator.of(context).pop(true);
},
child: Text(t('Save')),
color: Colors.orange[600],
textColor: Colors.white,
)
],
)
],
),
),
));
);
}

View File

@ -55,11 +55,28 @@ class _SizeState extends State<SizeWidget> with Trans {
print("w " + mediaWidth.toString() + "h " + mediaHeight.toString());
widget.exerciseBloc.setMediaDimensions(mediaWidth, mediaHeight);
List<Widget> list = List();
list.add(SizedBox(
//child: Container(color: Colors.black87),
width: mediaWidth,
height: mediaHeight,
));
list.add(GestureDetector(
onTap: () => {print("Save"), widget.exerciseBloc.add(ExerciseNewSaveWeight())},
child: SizedBox(
width: mediaWidth,
height: mediaHeight,
)));
list.add(
widget.exerciseBloc.isMan
? Image.asset(
"asset/image/man_sizes.png",
height: mediaHeight,
width: mediaWidth,
)
: Image.asset(
"asset/image/woman_sizes.png",
height: mediaHeight,
width: mediaWidth,
),
);
list.addAll(getSizeElements());
list.add(
Positioned(
top: mediaHeight * .07,
@ -93,21 +110,6 @@ class _SizeState extends State<SizeWidget> with Trans {
],
)),
);
list.add(
widget.exerciseBloc.isMan
? Image.asset(
"asset/image/man_sizes.png",
height: mediaHeight,
width: mediaWidth,
)
: Image.asset(
"asset/image/woman_sizes.png",
height: mediaHeight,
width: mediaWidth,
),
);
list.addAll(getSizeElements());
return list;
}