From d1b96399bbb9a125c4fc837510401723b2e85dd3 Mon Sep 17 00:00:00 2001 From: Vadim <44135514+vodemn@users.noreply.github.com> Date: Sun, 3 Nov 2024 17:56:25 +0100 Subject: [PATCH] fixed select film discard notify --- lib/providers/films_provider.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/providers/films_provider.dart b/lib/providers/films_provider.dart index 3ec55ad..428fb8e 100644 --- a/lib/providers/films_provider.dart +++ b/lib/providers/films_provider.dart @@ -170,9 +170,11 @@ class Films extends InheritedModel<_FilmsModelAspect> { @override bool updateShouldNotifyDependent(Films oldWidget, Set<_FilmsModelAspect> dependencies) { 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)) || - (dependencies.contains(_FilmsModelAspect.customFilms) && + ((dependencies.contains(_FilmsModelAspect.customFilms) || + dependencies.contains(_FilmsModelAspect.filmsInUse)) && const DeepCollectionEquality().equals(oldWidget.customFilms, customFilms)); } }