cetorres / multiselect_formfield

A Flutter package that provides a multi select form field using alert dialog to select multiple items with checkboxes and showing as chips.
BSD 3-Clause "New" or "Revised" License
72 stars 59 forks source link

After Migrating to null safety have this issue type '() => Null' is not a subtype of type '(() => Map<String, dynamic>)?' of 'orElse' #53

Open diaodiallo opened 1 year ago

diaodiallo commented 1 year ago

Returning null around here var existingItem = dataSource!.singleWhere(((itm) => itm[valueField] == item), orElse: () => null); at line 72 is causing this. I think should replace null by [] but I did not test it.

diaodiallo commented 1 year ago

I could fix this by replacing () => null by null I will request a pull for this. Thanks

WaseemAbbasi22 commented 1 year ago

instead of using List<Map<String,dynamic> as data source just use List it will solve this issue