Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor.withOpacity(.4),
border: Border.all(
color: Theme.of(context).primaryColor,
width: 2,
),
),
child: Column(
children: [
MultiSelectBottomSheetField(
isDismissible: false,
initialValue: aList4,
initialChildSize: 0.4,
listType: MultiSelectListType.CHIP,
searchable: true,
buttonText: Text("Vehicle Number"),
title: Text("Vehicle Number"),
items: _items,
onConfirm: ( values) {
_assignVehicle = values;
},
chipDisplay: MultiSelectChipDisplay(
onTap: (value) {
setState(() {
_assignVehicle.remove(value);
});
},
),
),
_assignVehicle == null || _assignVehicle.isEmpty
? Container(
padding: EdgeInsets.all(10),
alignment: Alignment.centerLeft,
child: Text(
" ",
style: TextStyle(color: Colors.black54),
))
: Container(),
],
),
),
This plugin is not very good for use. In plugin example it is showing to assign onChange{ value in List but it is not assigning}.
From three days I'm stuck in from this issue.
Here is my code.
List aList2=[];
List aList4 = [];
_showAssignedArList() async {
try {
var response = await http.get(Uri.parse("${AppConstant.BASE_URL}vechicallist"));
var data = VehicleResponse.fromJson(json.decode(response.body));
print("this is data${data}");
setState(() {
aList2 = data.data!;
print("This is vehicle list${aList2}");
});
}
catch (error) {
throw(error);
}
}
var _items = aList2.map((ar) => MultiSelectItem(ar, ar.vechicalNo.toString())).toList();
@override void initState() { _showAssignedArList(); super.initState(); }
Container( decoration: BoxDecoration( color: Theme.of(context).primaryColor.withOpacity(.4), border: Border.all( color: Theme.of(context).primaryColor, width: 2, ), ), child: Column( children:[
MultiSelectBottomSheetField(
isDismissible: false,
initialValue: aList4,
initialChildSize: 0.4,
listType: MultiSelectListType.CHIP,
searchable: true,
buttonText: Text("Vehicle Number"),
title: Text("Vehicle Number"),
items: _items,
onConfirm: ( values) {
_assignVehicle = values;
},
chipDisplay: MultiSelectChipDisplay(
onTap: (value) {
setState(() {
_assignVehicle.remove(value);
});
},
),
),
_assignVehicle == null || _assignVehicle.isEmpty
? Container(
padding: EdgeInsets.all(10),
alignment: Alignment.centerLeft,
child: Text(
" ",
style: TextStyle(color: Colors.black54),
))
: Container(),
],
),
),
This plugin is not very good for use. In plugin example it is showing to assign onChange{ value in List but it is not assigning}.
From three days I'm stuck in from this issue.