From 7052d73772ae54256c2d487e47420323cee05187 Mon Sep 17 00:00:00 2001 From: nights99 Date: Mon, 1 May 2023 14:16:17 +0100 Subject: [PATCH] filter state seems to rely on the selectedItems list being the empty list rather than null - see e.g. the setter function. So, proposal is to initialise the list to the empty list when null has been passed through to the initialiser - which is what happens when selectedListData is not specified when FilterListWidget is created. --- lib/src/state/filter_state.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/state/filter_state.dart b/lib/src/state/filter_state.dart index d2b01f3..7fc8819 100644 --- a/lib/src/state/filter_state.dart +++ b/lib/src/state/filter_state.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; class FilterState extends ListenableState { FilterState({List? allItems, List? selectedItems}) { - this.selectedItems = selectedItems; + this.selectedItems = selectedItems ?? []; items = allItems; }