m3_lightmeter/lib/data/models/metering_screen_layout_config.dart

12 lines
515 B
Dart
Raw Permalink Normal View History

enum MeteringScreenLayoutFeature { extremeExposurePairs, filmPicker }
typedef MeteringScreenLayoutConfig = Map<MeteringScreenLayoutFeature, bool>;
extension MeteringScreenLayoutConfigJson on MeteringScreenLayoutConfig {
static MeteringScreenLayoutConfig fromJson(Map<String, dynamic> data) => data.map(
2023-05-11 13:01:21 +00:00
(key, value) => MapEntry(MeteringScreenLayoutFeature.values[int.parse(key)], value as bool),
);
Map<String, dynamic> toJson() => map((key, value) => MapEntry(key.index.toString(), value));
}