Feature/change progress colors (#6)

* Added Settings Actions
* Created App Settings and Repo + Entity
* Code cleanup Time Progress
* Created App Settings Middleware
* Has Progresses ad has Settings loaded
* Created Load and Update Settings reducers
* Added Settings store middleware to renamed store middleware
* Load Default Settings if not Saved. Use Redux AppState to showprogress colors.
Colors are not yet changeable.
* Added ColorPicker for Done and Left Color
Fixed Loading App Settings Bug
* Fixed Version Number
* Fixed Android App Logo
* Extracted Color Settings into Widget
* Fixed Home Settings Tab Layout and Color Settings Button now show Text in complementary color
This commit is contained in:
Andreas Fahrecker
2021-03-03 16:35:08 +01:00
committed by GitHub
parent c580e45361
commit b520d56d1a
23 changed files with 545 additions and 150 deletions

View File

@ -1,36 +1,40 @@
import 'package:meta/meta.dart';
import 'package:time_progress_tracker/models/app_settings.dart';
import 'package:time_progress_tracker/models/time_progress.dart';
@immutable
class AppState {
final bool hasLoaded;
final bool hasProgressesLoaded, hasSettingsLoaded;
final List<TimeProgress> timeProgressList;
final AppSettings appSettings;
AppState({
this.hasLoaded = false,
this.timeProgressList = const [],
});
AppState(
{this.hasProgressesLoaded = false,
this.hasSettingsLoaded = false,
this.timeProgressList = const [],
this.appSettings});
factory AppState.initial() => AppState(hasLoaded: false);
factory AppState.initial() =>
AppState(hasProgressesLoaded: false, appSettings: AppSettings.defaults());
AppState copyWith({
bool hasLoaded,
List<TimeProgress> timeProgressList,
}) {
return AppState(
hasLoaded: hasLoaded ?? this.hasLoaded,
hasProgressesLoaded: hasLoaded ?? this.hasProgressesLoaded,
timeProgressList: timeProgressList ?? this.timeProgressList,
);
}
@override
int get hashCode => hasLoaded.hashCode ^ timeProgressList.hashCode;
int get hashCode => hasProgressesLoaded.hashCode ^ timeProgressList.hashCode;
@override
bool operator ==(Object other) =>
identical(this, other) ||
other is AppState &&
runtimeType == other.runtimeType &&
hasLoaded == other.hasLoaded &&
hasProgressesLoaded == other.hasProgressesLoaded &&
timeProgressList == other.timeProgressList;
}