Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
subhadippramanik opened this issue Aug 19, 2023 · 5 comments

Comments

@subhadippramanik
Copy link

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

@arcbueno
Copy link

arcbueno commented Sep 6, 2023

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

@valterh4ck3r
Copy link

Same error here

@edithbefin
Copy link

same error

@edithbefin
Copy link

Screenshot 2024-01-08 220352

@ADubbsW7
Copy link

same, anyone have a work around?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants