mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-22 07:20:39 +00:00
bfd0bfe531
* use latest `camera_android_camerax` * fixed trailing commas * moved ci/cd to 3.13.9 * removed focus & exposure fix * fixed camera not being initialized on Android * removed unused import
31 lines
999 B
Dart
31 lines
999 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;
|
|
default:
|
|
return null;
|
|
}
|
|
}
|
|
|
|
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));
|
|
}
|