Fix Displaying Bug
This commit is contained in:
parent
eee1d12851
commit
3940184975
@ -59,15 +59,15 @@ class _ProgressDetailScreenState extends State<ProgressDetailScreen> {
|
|||||||
|
|
||||||
List<Widget> _renderColumnChildren(
|
List<Widget> _renderColumnChildren(
|
||||||
SettingsViewModel settingsVm, TimeProgressViewModel tpVm) {
|
SettingsViewModel settingsVm, TimeProgressViewModel tpVm) {
|
||||||
List<Widget> columnChildren = [
|
List<Widget> columnChildren = [];
|
||||||
Expanded(
|
if (!_editMode) {
|
||||||
|
columnChildren.add(Expanded(
|
||||||
child: ProgressViewWidget(
|
child: ProgressViewWidget(
|
||||||
timeProgress: _editMode ? _editedProgress ?? tpVm.tp : tpVm.tp,
|
timeProgress: _editMode ? _editedProgress ?? tpVm.tp : tpVm.tp,
|
||||||
doneColor: settingsVm.appSettings.doneColor,
|
doneColor: settingsVm.appSettings.doneColor,
|
||||||
leftColor: settingsVm.appSettings.leftColor,
|
leftColor: settingsVm.appSettings.leftColor,
|
||||||
))
|
)));
|
||||||
];
|
} else {
|
||||||
if (_editMode) {
|
|
||||||
columnChildren.add(Expanded(
|
columnChildren.add(Expanded(
|
||||||
child: ProgressEditorWidget(
|
child: ProgressEditorWidget(
|
||||||
timeProgress: _editedProgress ?? tpVm.tp,
|
timeProgress: _editedProgress ?? tpVm.tp,
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:time_progress_tracker/models/time_progress.dart';
|
import 'package:time_progress_tracker/models/time_progress.dart';
|
||||||
import 'package:time_progress_tracker/widgets/buttons/date_picker_btn.dart';
|
import 'package:time_progress_tracker/widgets/buttons/date_picker_btn.dart';
|
||||||
|
|
||||||
@ -69,8 +70,11 @@ class _ProgressEditorWidgetState extends State<ProgressEditorWidget> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
double heightFactor = (!_validDate) ? 0.3 : 0.5;
|
||||||
|
|
||||||
List<Widget> columnChildren = [
|
List<Widget> columnChildren = [
|
||||||
Expanded(
|
SizedBox(
|
||||||
|
height: MediaQuery.of(context).size.height * heightFactor,
|
||||||
child: TextField(
|
child: TextField(
|
||||||
controller: _nameTextController,
|
controller: _nameTextController,
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
@ -82,7 +86,8 @@ class _ProgressEditorWidgetState extends State<ProgressEditorWidget> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
SizedBox(
|
||||||
|
height: MediaQuery.of(context).size.height * heightFactor,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
@ -112,8 +117,9 @@ class _ProgressEditorWidgetState extends State<ProgressEditorWidget> {
|
|||||||
|
|
||||||
if (!_validDate) {
|
if (!_validDate) {
|
||||||
columnChildren.add(
|
columnChildren.add(
|
||||||
const Expanded(
|
SizedBox(
|
||||||
child: Center(
|
height: MediaQuery.of(context).size.height * heightFactor,
|
||||||
|
child: const Center(
|
||||||
child: Text(
|
child: Text(
|
||||||
"Invalid Dates. The Start Date has to be before the End Date",
|
"Invalid Dates. The Start Date has to be before the End Date",
|
||||||
style: TextStyle(color: Colors.red),
|
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,
|
children: columnChildren,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,9 +17,13 @@ class ProgressViewWidget extends StatelessWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Column(
|
return SingleChildScrollView(
|
||||||
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
SizedBox(
|
||||||
|
height: MediaQuery.of(context).size.height *
|
||||||
|
0.3, // adjust the value as needed
|
||||||
child: FittedBox(
|
child: FittedBox(
|
||||||
fit: BoxFit.fitWidth,
|
fit: BoxFit.fitWidth,
|
||||||
child: Text(
|
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(
|
child: CircularPercentIndicator(
|
||||||
radius: 100,
|
radius: 100,
|
||||||
lineWidth: 10,
|
lineWidth: 10,
|
||||||
@ -42,7 +48,9 @@ class ProgressViewWidget extends StatelessWidget {
|
|||||||
center: Text("${(timeProgress.percentDone() * 100).floor()} %"),
|
center: Text("${(timeProgress.percentDone() * 100).floor()} %"),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Expanded(
|
SizedBox(
|
||||||
|
height: MediaQuery.of(context).size.height *
|
||||||
|
0.3, // adjust the value as needed
|
||||||
child: LinearPercentIndicator(
|
child: LinearPercentIndicator(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 15),
|
padding: const EdgeInsets.symmetric(horizontal: 15),
|
||||||
percent: timeProgress.percentDone(),
|
percent: timeProgress.percentDone(),
|
||||||
@ -58,6 +66,7 @@ class ProgressViewWidget extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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.
|
# In iOS, build-name is used as CFBundleShortVersionString while build-number is used as CFBundleVersion.
|
||||||
# Read more about iOS versioning at
|
# Read more about iOS versioning at
|
||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
version: 0.0.20+20
|
version: 0.0.21+21
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=3.3.1 <4.0.0'
|
sdk: '>=3.3.1 <4.0.0'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user