2023-08-06 14:28:20 +00:00
|
|
|
enum MeteringScreenLayoutFeature { extremeExposurePairs, filmPicker, histogram }
|
2023-04-05 19:15:11 +00:00
|
|
|
|
|
|
|
typedef MeteringScreenLayoutConfig = Map<MeteringScreenLayoutFeature, bool>;
|
|
|
|
|
|
|
|
extension MeteringScreenLayoutConfigJson on MeteringScreenLayoutConfig {
|
2023-08-06 14:28:20 +00:00
|
|
|
static MeteringScreenLayoutConfig fromJson(Map<String, dynamic> data) =>
|
|
|
|
<MeteringScreenLayoutFeature, bool>{
|
|
|
|
for (final f in MeteringScreenLayoutFeature.values)
|
|
|
|
f: data[f.index.toString()] as bool? ?? true
|
|
|
|
};
|
2023-04-05 19:15:11 +00:00
|
|
|
|
|
|
|
Map<String, dynamic> toJson() => map((key, value) => MapEntry(key.index.toString(), value));
|
|
|
|
}
|