m3_lightmeter/lib/utils/map_model.dart
Vadim 6566108994
ML-129 Spot metering (#136)
* imlemented `CameraSpotDetector`

* separated generic `DialogSwitch`

* added `CameraFeature` model

* added `CameraFeaturesListTile` to metering section

* added features dialog subtitles

* added long press to remove metering spot

* translations

* hide camera features for purchasable status

* hide `CameraHistogram` & `CameraSpotDetector` if purchasable

* bumped iap version

* fixed tests

* removed redundant camera state emission

* tests

* Fixed remote config initalization

* updated pro features description
2023-11-11 21:05:11 +01:00

26 lines
544 B
Dart

import 'package:flutter/material.dart';
class MapModel<T> extends InheritedModel<T> {
final Map<T, bool> data;
const MapModel({
required this.data,
required super.child,
});
@override
bool updateShouldNotify(MapModel oldWidget) => oldWidget.data != data;
@override
bool updateShouldNotifyDependent(
MapModel<T> oldWidget,
Set<T> dependencies,
) {
for (final dependecy in dependencies) {
if (oldWidget.data[dependecy] != data[dependecy]) {
return true;
}
}
return false;
}
}