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:
committed by
GitHub
parent
fc35476503
commit
40bdcc44f9
@ -7,7 +7,10 @@ import 'package:time_progress_tracker/reducers/time_progress_list_reducer.dart';
|
||||
|
||||
AppState appStateReducer(AppState state, dynamic action) {
|
||||
return AppState(
|
||||
hasProgressesLoaded: hasLoadedReducer(state.hasProgressesLoaded, action),
|
||||
hasSettingsLoaded:
|
||||
hasSettingsLoadedReducer(state.hasSettingsLoaded, action),
|
||||
hasProgressesLoaded:
|
||||
hasProgressesLoadedReducer(state.hasProgressesLoaded, action),
|
||||
timeProgressList: timeProgressListReducer(state.timeProgressList, action),
|
||||
appSettings: appSettingsReducers(state.appSettings, action),
|
||||
);
|
||||
|
@ -1,15 +1,28 @@
|
||||
import 'package:redux/redux.dart';
|
||||
import 'package:time_progress_tracker/actions/actions.dart';
|
||||
|
||||
final hasLoadedReducer = combineReducers<bool>([
|
||||
TypedReducer<bool, TimeProgressListLoadedAction>(_setLoaded),
|
||||
TypedReducer<bool, TimeProgressListNotLoadedAction>(_setUnloaded)
|
||||
final hasProgressesLoadedReducer = combineReducers<bool>([
|
||||
TypedReducer<bool, TimeProgressListLoadedAction>(_setProgressesLoaded),
|
||||
TypedReducer<bool, TimeProgressListNotLoadedAction>(_setProgressesUnloaded)
|
||||
]);
|
||||
|
||||
bool _setLoaded(bool hasLoaded, TimeProgressListLoadedAction action) {
|
||||
bool _setProgressesLoaded(bool hasLoaded, TimeProgressListLoadedAction action) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool _setUnloaded(bool hasLoaded, TimeProgressListNotLoadedAction action) {
|
||||
bool _setProgressesUnloaded(bool hasLoaded, TimeProgressListNotLoadedAction action) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final hasSettingsLoadedReducer = combineReducers<bool>([
|
||||
TypedReducer<bool, AppSettingsLoadedActions>(_setSettingsLoaded),
|
||||
TypedReducer<bool, AppSettingsNotLoadedAction>(_setSettingsUnloaded)
|
||||
]);
|
||||
|
||||
bool _setSettingsLoaded(bool hasLoaded, AppSettingsLoadedActions action) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool _setSettingsUnloaded(bool hasLoaded, AppSettingsNotLoadedAction action) {
|
||||
return false;
|
||||
}
|
Reference in New Issue
Block a user