mirror of
https://github.com/vodemn/m3_lightmeter.git
synced 2024-11-25 08:50:40 +00:00
reset selected equipment profile when layout feature is disabled
This commit is contained in:
parent
b42ad01b7c
commit
7633f3fd27
1 changed files with 13 additions and 3 deletions
|
@ -76,13 +76,23 @@ class _InheritedListeners extends StatelessWidget {
|
||||||
onDidChangeDependencies: (value) {
|
onDidChangeDependencies: (value) {
|
||||||
context.read<MeteringBloc>().add(EquipmentProfileChangedEvent(value));
|
context.read<MeteringBloc>().add(EquipmentProfileChangedEvent(value));
|
||||||
},
|
},
|
||||||
|
child: InheritedModelAspectListener<MeteringScreenLayoutFeature, bool>(
|
||||||
|
aspect: MeteringScreenLayoutFeature.equipmentProfiles,
|
||||||
|
onDidChangeDependencies: (value) {
|
||||||
|
if (!value) {
|
||||||
|
EquipmentProfileProvider.of(context).setProfile(context.get<EquipmentProfiles>().first);
|
||||||
|
}
|
||||||
|
},
|
||||||
child: InheritedModelAspectListener<MeteringScreenLayoutFeature, bool>(
|
child: InheritedModelAspectListener<MeteringScreenLayoutFeature, bool>(
|
||||||
aspect: MeteringScreenLayoutFeature.filmPicker,
|
aspect: MeteringScreenLayoutFeature.filmPicker,
|
||||||
onDidChangeDependencies: (value) {
|
onDidChangeDependencies: (value) {
|
||||||
if (!value) context.read<MeteringBloc>().add(const FilmChangedEvent(Film.other()));
|
if (!value) {
|
||||||
|
context.read<MeteringBloc>().add(const FilmChangedEvent(Film.other()));
|
||||||
|
}
|
||||||
},
|
},
|
||||||
child: child,
|
child: child,
|
||||||
),
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue