multi_select_flutter
multi_select_flutter copied to clipboard
Error: The argument type 'List<V>?' can't be assigned to the parameter type 'List<V>'
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
I am getting the same error, don't know why
Same error here
same error