Feature/code cleanup (#9)

* Implemented hasSettingsLoaded reducer
* Added Padding to Progress List View
* Created Settings and Time Progress List Store Connector
* Rewritten Home Active Tab
* Fixed missing onTap in Progress List Tile
* Started using new Store Connectors in Inactive and Settings Tab
* Created Time Progress Store Connector
* Rewritten ProgressDetailScreen with new Store Connectors
* Rewritten DatePickerBtn with TextButton
* Deleted unused widget
* Changed Foreground Color behaviour in ColorPicker BTN
* Created Select Duration Button
* Rewritten Duration Setting Widget
* Updated Version Number

Signed-off-by: Andreas Fahrecker <AndreasFahrecker@gmail.com>
This commit is contained in:
Andreas Fahrecker
2021-03-08 20:48:45 +01:00
committed by GitHub
parent fc35476503
commit 40bdcc44f9
22 changed files with 450 additions and 319 deletions

View File

@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:percent_indicator/linear_percent_indicator.dart';
import 'package:time_progress_tracker/models/time_progress.dart';
import 'package:time_progress_tracker/screens/progress_detail_screen.dart';
class ProgressListTileStrings {
static String percentString(TimeProgress tp) =>
@ -39,9 +40,14 @@ class ProgressListTile extends StatelessWidget {
@override
Widget build(BuildContext context) {
void _onTileTap() =>
Navigator.pushNamed(context, ProgressDetailScreen.routeName,
arguments: ProgressDetailScreenArguments(timeProgress.id));
return ListTile(
title: Text(timeProgress.name),
subtitle: _renderSubtitle(context),
onTap: _onTileTap,
);
}
}

View File

@ -13,20 +13,21 @@ class ProgressListView extends StatelessWidget {
});
List<Widget> _renderListViewChildren() {
return timeProgressList.map((e) =>
Card(
child: ProgressListTile(
timeProgress: e,
doneColor: doneColor,
leftColor: leftColor,
),
)
).toList(growable: false);
return timeProgressList
.map((e) => Card(
child: ProgressListTile(
timeProgress: e,
doneColor: doneColor,
leftColor: leftColor,
),
))
.toList(growable: false);
}
@override
Widget build(BuildContext context) {
return ListView(
padding: EdgeInsets.all(8),
children: _renderListViewChildren(),
);
}