fixed select film discard notify

This commit is contained in:
Vadim 2024-11-03 17:56:25 +01:00
parent ae2216ae3a
commit d1b96399bb

View file

@ -170,9 +170,11 @@ class Films extends InheritedModel<_FilmsModelAspect> {
@override @override
bool updateShouldNotifyDependent(Films oldWidget, Set<_FilmsModelAspect> dependencies) { bool updateShouldNotifyDependent(Films oldWidget, Set<_FilmsModelAspect> dependencies) {
return (dependencies.contains(_FilmsModelAspect.selected) && oldWidget.selected != selected) || return (dependencies.contains(_FilmsModelAspect.selected) && oldWidget.selected != selected) ||
(dependencies.contains(_FilmsModelAspect.predefinedFilms) && ((dependencies.contains(_FilmsModelAspect.predefinedFilms) ||
dependencies.contains(_FilmsModelAspect.filmsInUse)) &&
const DeepCollectionEquality().equals(oldWidget.predefinedFilms, predefinedFilms)) || const DeepCollectionEquality().equals(oldWidget.predefinedFilms, predefinedFilms)) ||
(dependencies.contains(_FilmsModelAspect.customFilms) && ((dependencies.contains(_FilmsModelAspect.customFilms) ||
dependencies.contains(_FilmsModelAspect.filmsInUse)) &&
const DeepCollectionEquality().equals(oldWidget.customFilms, customFilms)); const DeepCollectionEquality().equals(oldWidget.customFilms, customFilms));
} }
} }