fetchAllSubType method
Implementation
Future<List<ReportSubTypeModel>> fetchAllSubType() async {
return _httpService.fetchAllSubType().then((data) async {
if (data.statusCode == 200) {
List<dynamic> reports = json.decode(data.body);
List<ReportSubTypeModel> reportsSubTypeList =
reports.map((i) => ReportSubTypeModel.fromJson(i)).toList();
return reportsSubTypeList;
} else {
return List<ReportSubTypeModel>.from([]);
}
});
}