diff --git a/lib/widgets/input_dialog_widget.dart b/lib/widgets/input_dialog_widget.dart index df299ea..39473dc 100644 --- a/lib/widgets/input_dialog_widget.dart +++ b/lib/widgets/input_dialog_widget.dart @@ -58,131 +58,137 @@ class _InputDialogState extends State> 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: [ - Container( - padding: const EdgeInsets.all(12.0), - child: Column(children: [ - Text( - widget.title, - style: GoogleFonts.archivoBlack( - shadows: [ - 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: [ + Container( + padding: const EdgeInsets.all(0.0), + child: Column(children: [ + Text( + widget.title, + style: GoogleFonts.archivoBlack( + shadows: [ + 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( - 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( + 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( - 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( + 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: [ - 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: [ + 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, + ) + ], + ) + ], + ), ), - )); + ); } diff --git a/lib/widgets/size_widget.dart b/lib/widgets/size_widget.dart index b0cd81b..f18a015 100644 --- a/lib/widgets/size_widget.dart +++ b/lib/widgets/size_widget.dart @@ -55,11 +55,28 @@ class _SizeState extends State with Trans { print("w " + mediaWidth.toString() + "h " + mediaHeight.toString()); widget.exerciseBloc.setMediaDimensions(mediaWidth, mediaHeight); List 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 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; }