getDesignList method
Future<List<DesignModel> >
getDesignList(
- RoomModel model,
- StationData station, {
- dynamic callback(
- List<
DesignModel> res
- List<
Implementation
Future<List<DesignModel>> getDesignList(RoomModel model, StationData station,
{Function(List<DesignModel> res)? callback}) async {
Map<String, dynamic> param = {
'roomTaskId': model.id,
'actualOrder': station.actualOrder
};
Map? res = await UnitsForNetwork.getHttp(designListApi, parameters: param);
List<DesignModel> modelList = [];
if (res != null) {
List resList = res["data"];
if (resList.isNotEmpty) {
for (var element in resList) {
DesignModel designModel = DesignModel.fromJson(element);
modelList.add(designModel);
}
}
}
if (callback != null) {
callback(modelList);
}
return modelList;
}