type '() => Null' is not a subtype of type '(() => Map<String, dynamic>)?' of 'orElse'
How to get out from this error?
and this is the my code snippet as below.
FutureBuilder<ActivityCheckPoints>(
future: apiGetCheckPointsName(),
builder: (context, snapshot) {
if(snapshot.hasData)
return Container(
child:
MultiSelectFormField(
chipBackGroundColor: Colors.blue,
chipLabelStyle: TextStyle(fontWeight: FontWeight.bold),
dialogTextStyle: TextStyle(fontWeight: FontWeight.bold),
checkBoxActiveColor: Colors.blue,
checkBoxCheckColor: Colors.white,
dialogShapeBorder: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(12.0))),
title: Text(_actpoints,
style: TextStyle(fontSize: 16),
),
dataSource: snapshot.data!.listactiviticheckpoints!.map((value){
return {'display': '$value','value': value};
}).toList(),
textField: 'display',
valueField: 'value',
okButtonLabel: 'OK',
cancelButtonLabel: 'CANCEL',
hintWidget: Text(_actpointsdisplay,
),
initialValue: _listActivityPointNames,
onSaved: (value) {
if (value == null) return;
setState(() {
_listActivityPointNames = value;
});
},
),
);
return Container();
}
),