mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-10-09 17:34:14 +02:00
Add new builtin profiles, better handline of initialization, bump version
This commit is contained in:
1 parent
2a7004e5a2
commit
c8ae925dc1
6 files changed
+78
-16
No files matched your search
@@ -8,8 +8,19 @@ class OperatorProfileState extends ChangeNotifier {
|
||||
|
||||
List<OperatorProfile> get profiles => List.unmodifiable(_profiles);
|
||||
|
||||
Future<void> init() async {
|
||||
Future<void> init({bool addDefaults = false}) async {
|
||||
_profiles.addAll(await OperatorProfileService().load());
|
||||
|
||||
// Add default operator profiles if this is first launch
|
||||
if (addDefaults) {
|
||||
final defaults = [
|
||||
OperatorProfile.lowes(),
|
||||
OperatorProfile.homeDepot(),
|
||||
];
|
||||
|
||||
_profiles.addAll(defaults);
|
||||
await OperatorProfileService().save(_profiles);
|
||||
}
|
||||
}
|
||||
|
||||
void addOrUpdateProfile(OperatorProfile p) {
|
||||
|
||||
Reference in new issue
Block a user