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

View File

@ -55,11 +55,28 @@ class _SizeState extends State<SizeWidget> with Trans {
print("w " + mediaWidth.toString() + "h " + mediaHeight.toString()); print("w " + mediaWidth.toString() + "h " + mediaHeight.toString());
widget.exerciseBloc.setMediaDimensions(mediaWidth, mediaHeight); widget.exerciseBloc.setMediaDimensions(mediaWidth, mediaHeight);
List<Widget> list = List(); List<Widget> list = List();
list.add(SizedBox( list.add(GestureDetector(
//child: Container(color: Colors.black87), onTap: () => {print("Save"), widget.exerciseBloc.add(ExerciseNewSaveWeight())},
width: mediaWidth, child: SizedBox(
height: mediaHeight, 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( list.add(
Positioned( Positioned(
top: mediaHeight * .07, 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; return list;
} }