From f325e27f8b6a9a124fb656656df941fe3d2fc524 Mon Sep 17 00:00:00 2001 From: ibal Date: Wed, 9 Nov 2022 08:41:37 +0100 Subject: [PATCH] design change --- lib/main.dart | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index e4e5609..71dae01 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -35,13 +35,6 @@ class MyCustomFormState extends StatelessWidget with InputValidationMixin { final _controllerEndSpeed = TextEditingController(); final _controllerWeight = TextEditingController(); - @override - void dispose() { - _controllerStartSpeed.dispose(); - _controllerEndSpeed.dispose(); - _controllerWeight.dispose(); - } - void _changeJoule(BuildContext context) { Provider.of(context, listen: false).changeJoule( double.parse(_controllerWeight.text), @@ -121,19 +114,27 @@ class MyCustomFormState extends StatelessWidget with InputValidationMixin { } }, ), - Text('$_joule Joule \n' - '$_energyWater Liter Wasser können damit erhitzt werden \n' - '$_energyIron kg Eisen können damit zu glühen gebracht werden'), + FittedBox( + child: Text( + '$_joule Joule \n' + '$_energyWater Liter Wasser können damit erhitzt werden \n' + '$_energyIron kg Eisen können damit zu glühen gebracht werden', + style: new TextStyle( + fontSize: 20.0, + color: Colors.black, + ))), Padding( padding: const EdgeInsets.symmetric(vertical: 16.0), child: ElevatedButton( onPressed: () => { - if (formGlobalKey.currentState!.validate()) { - formGlobalKey.currentState!.save() - }, + if (formGlobalKey.currentState!.validate()) + {formGlobalKey.currentState!.save()}, _changeJoule(context), }, - child: const Text('Submit'), + child: Text('Submit', + style: new TextStyle( + fontSize: 20.0, + )), ), ), ], @@ -143,5 +144,6 @@ class MyCustomFormState extends StatelessWidget with InputValidationMixin { } mixin InputValidationMixin { - bool isInputValid(String value) => !new RegExp(r'[0-9]+.?[0-9]*').hasMatch(value); + bool isInputValid(String value) => + !new RegExp(r'[0-9]+.?[0-9]*').hasMatch(value); }