multi_select_flutter icon indicating copy to clipboard operation
multi_select_flutter copied to clipboard

Error: The argument type 'List<V>?' can't be assigned to the parameter type 'List<V>'

Open subhadippramanik opened this issue 1 year ago • 4 comments

I am trying to set initialValue. My code looks like

MultiSelectBottomSheetField<Interest>(
                              initialChildSize: 0.4,
                              listType: MultiSelectListType.CHIP,
                              searchable: true,
                              buttonText: Text(item.key),
                              title: Text('Select ${item.key}'),
                              buttonIcon:
                                  Icon(CupertinoIcons.arrow_down_circle),
                              items: item.value
                                  .map((e) => MultiSelectItem(e, e.name))
                                  .toList(),
                              initialValue:
                                  initialInterests[item.key] ?? List.empty(),
                              onConfirm: (values) =>
                                  handleSave(item.key, values),
                              chipDisplay: MultiSelectChipDisplay(
                                  // onTap: (value) =>
                                  //     handleDelete(item.key, value),
                                  ),
                            ),
                          )

I am getting the following error

../../.pub-cache/hosted/pub.dev/multi_select_flutter-4.1.3/lib/bottom_sheet/multi_select_bottom_sheet_field.dart:169:31: Error: The argument type 'List<V>?' can't be assigned to the parameter type 'List<V>' because 'List<V>?' is nullable and 'List<V>' isn't.
 - 'List' is from 'dart:core'.
                initialValue: initialValue,
                              ^
Target kernel_snapshot failed: Exception


FAILURE: Build failed with an exception.

* Where:
Script '/Users/subhadip/Developer/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1201

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/Users/subhadip/Developer/flutter/bin/flutter'' finished with non-zero exit value 1

My package version is 4.1.3

subhadippramanik avatar Aug 19 '23 07:08 subhadippramanik

I am getting the same error, don't know why

arcbueno avatar Sep 06 '23 15:09 arcbueno

Same error here

valterh4ck3r avatar Dec 15 '23 17:12 valterh4ck3r

same error

edithbefin avatar Jan 08 '24 16:01 edithbefin

Screenshot 2024-01-08 220352

edithbefin avatar Jan 08 '24 16:01 edithbefin