m3_lightmeter/lib/data/models/metering_screen_layout_config.dart
Vadim aaadd1ded6
ML-48 Allow users to hide fastest/shortest exposure pairs #48 (#49)
* implemented `MeteringScreenLayoutProvider`

* refined topbar height difference calculation

* implemented `MeteringScreenLayoutFeaturesDialog`

* added icons to all dialogs

* save & restore `MeteringScreenLayoutConfig`

* reset film on film picker disabling

* fixed Fomapan reciprocity

* fixed dependencies

* added translations
2023-04-05 22:15:11 +03:00

10 lines
505 B
Dart

enum MeteringScreenLayoutFeature { extremeExposurePairs, filmPicker }
typedef MeteringScreenLayoutConfig = Map<MeteringScreenLayoutFeature, bool>;
extension MeteringScreenLayoutConfigJson on MeteringScreenLayoutConfig {
static MeteringScreenLayoutConfig fromJson(Map<String, dynamic> data) => data.map(
(key, value) => MapEntry(MeteringScreenLayoutFeature.values[int.parse(key)], value as bool));
Map<String, dynamic> toJson() => map((key, value) => MapEntry(key.index.toString(), value));
}