mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2025-01-31 09:40:41 +00:00
fb58b6cd9f
* fixed fvm path typo * Update pubspec.yaml * version control pubspec.lock * fixed ios build * deleted `ExpandableSectionList` * removed redundant default cases * avoided async gaps * replaced deprecated color value getter * `WillPopScope` -> `PopScope` * removed theme deprecations * replaced text scale deprecation * updated goldens * updated flutter version across workflows * [android] migrated to the new gradle * upgraded dependencies * [android] fixed build * [ios] fixed build * updated config * allow release notes to fail * updated stub pubspec * [android] use java 17 * [ios] enable flutterfire * added firebase.json to secrets * typo * update color utils * use exact versions * reverted color utils * updated goldens
29 lines
958 B
Dart
29 lines
958 B
Dart
enum MeteringScreenLayoutFeature {
|
|
extremeExposurePairs, // 0
|
|
filmPicker, // 1
|
|
equipmentProfiles, // 3
|
|
}
|
|
|
|
typedef MeteringScreenLayoutConfig = Map<MeteringScreenLayoutFeature, bool>;
|
|
|
|
extension MeteringScreenLayoutConfigJson on MeteringScreenLayoutConfig {
|
|
static MeteringScreenLayoutConfig fromJson(Map<String, dynamic> data) {
|
|
int migratedIndex(MeteringScreenLayoutFeature feature) {
|
|
switch (feature) {
|
|
case MeteringScreenLayoutFeature.extremeExposurePairs:
|
|
return 0;
|
|
case MeteringScreenLayoutFeature.filmPicker:
|
|
return 1;
|
|
case MeteringScreenLayoutFeature.equipmentProfiles:
|
|
return 3;
|
|
}
|
|
}
|
|
|
|
return <MeteringScreenLayoutFeature, bool>{
|
|
for (final f in MeteringScreenLayoutFeature.values)
|
|
f: (data[migratedIndex(f).toString()] ?? data[f.name]) as bool? ?? true,
|
|
};
|
|
}
|
|
|
|
Map<String, dynamic> toJson() => map((key, value) => MapEntry(key.name, value));
|
|
}
|