diff --git a/lib/screens/progress_detail_screen.dart b/lib/screens/progress_detail_screen.dart index ced0d97..a905014 100644 --- a/lib/screens/progress_detail_screen.dart +++ b/lib/screens/progress_detail_screen.dart @@ -59,15 +59,15 @@ class _ProgressDetailScreenState extends State { List _renderColumnChildren( SettingsViewModel settingsVm, TimeProgressViewModel tpVm) { - List columnChildren = [ - Expanded( + List columnChildren = []; + if (!_editMode) { + columnChildren.add(Expanded( child: ProgressViewWidget( timeProgress: _editMode ? _editedProgress ?? tpVm.tp : tpVm.tp, doneColor: settingsVm.appSettings.doneColor, leftColor: settingsVm.appSettings.leftColor, - )) - ]; - if (_editMode) { + ))); + } else { columnChildren.add(Expanded( child: ProgressEditorWidget( timeProgress: _editedProgress ?? tpVm.tp, diff --git a/lib/widgets/progress_editor_widget.dart b/lib/widgets/progress_editor_widget.dart index bf66c54..643a7ca 100644 --- a/lib/widgets/progress_editor_widget.dart +++ b/lib/widgets/progress_editor_widget.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; import 'package:time_progress_tracker/models/time_progress.dart'; import 'package:time_progress_tracker/widgets/buttons/date_picker_btn.dart'; @@ -69,8 +70,11 @@ class _ProgressEditorWidgetState extends State { @override Widget build(BuildContext context) { + double heightFactor = (!_validDate) ? 0.3 : 0.5; + List columnChildren = [ - Expanded( + SizedBox( + height: MediaQuery.of(context).size.height * heightFactor, child: TextField( controller: _nameTextController, decoration: InputDecoration( @@ -82,7 +86,8 @@ class _ProgressEditorWidgetState extends State { ), ), ), - Expanded( + SizedBox( + height: MediaQuery.of(context).size.height * heightFactor, child: Row( children: [ Expanded( @@ -112,8 +117,9 @@ class _ProgressEditorWidgetState extends State { if (!_validDate) { columnChildren.add( - const Expanded( - child: Center( + SizedBox( + height: MediaQuery.of(context).size.height * heightFactor, + child: const Center( child: Text( "Invalid Dates. The Start Date has to be before the End Date", style: TextStyle(color: Colors.red), @@ -123,8 +129,11 @@ class _ProgressEditorWidgetState extends State { ); } - return Column( - children: columnChildren, + return SingleChildScrollView( + physics: const NeverScrollableScrollPhysics(), + child: Column( + children: columnChildren, + ), ); } } diff --git a/lib/widgets/progress_view_widget.dart b/lib/widgets/progress_view_widget.dart index 79f39a0..1e336a2 100644 --- a/lib/widgets/progress_view_widget.dart +++ b/lib/widgets/progress_view_widget.dart @@ -17,9 +17,13 @@ class ProgressViewWidget extends StatelessWidget { @override Widget build(BuildContext context) { - return Column( + return SingleChildScrollView( + physics: const NeverScrollableScrollPhysics(), + child: Column( children: [ - Expanded( + SizedBox( + height: MediaQuery.of(context).size.height * + 0.3, // adjust the value as needed child: FittedBox( fit: BoxFit.fitWidth, child: Text( @@ -32,7 +36,9 @@ class ProgressViewWidget extends StatelessWidget { ), ), ), - Expanded( + SizedBox( + height: MediaQuery.of(context).size.height * + 0.3, // adjust the value as needed child: CircularPercentIndicator( radius: 100, lineWidth: 10, @@ -42,7 +48,9 @@ class ProgressViewWidget extends StatelessWidget { center: Text("${(timeProgress.percentDone() * 100).floor()} %"), ), ), - Expanded( + SizedBox( + height: MediaQuery.of(context).size.height * + 0.3, // adjust the value as needed child: LinearPercentIndicator( padding: const EdgeInsets.symmetric(horizontal: 15), percent: timeProgress.percentDone(), @@ -58,6 +66,7 @@ class ProgressViewWidget extends StatelessWidget { ), ), ], - ); + ), + ); } } diff --git a/pubspec.yaml b/pubspec.yaml index 825682f..1b17cd2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 0.0.20+20 +version: 0.0.21+21 environment: sdk: '>=3.3.1 <4.0.0'