Fix Displaying Bug

This commit is contained in:
Andreas Fahrecker 2024-05-14 20:58:22 +02:00
parent eee1d12851
commit 3940184975
4 changed files with 35 additions and 17 deletions

View File

@ -59,15 +59,15 @@ class _ProgressDetailScreenState extends State<ProgressDetailScreen> {
List<Widget> _renderColumnChildren(
SettingsViewModel settingsVm, TimeProgressViewModel tpVm) {
List<Widget> columnChildren = [
Expanded(
List<Widget> 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,

View File

@ -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<ProgressEditorWidget> {
@override
Widget build(BuildContext context) {
double heightFactor = (!_validDate) ? 0.3 : 0.5;
List<Widget> columnChildren = [
Expanded(
SizedBox(
height: MediaQuery.of(context).size.height * heightFactor,
child: TextField(
controller: _nameTextController,
decoration: InputDecoration(
@ -82,7 +86,8 @@ class _ProgressEditorWidgetState extends State<ProgressEditorWidget> {
),
),
),
Expanded(
SizedBox(
height: MediaQuery.of(context).size.height * heightFactor,
child: Row(
children: [
Expanded(
@ -112,8 +117,9 @@ class _ProgressEditorWidgetState extends State<ProgressEditorWidget> {
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<ProgressEditorWidget> {
);
}
return Column(
return SingleChildScrollView(
physics: const NeverScrollableScrollPhysics(),
child: Column(
children: columnChildren,
),
);
}
}

View File

@ -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 {
),
),
],
),
);
}
}

View File

@ -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'