You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.2 KiB
Dart
37 lines
1.2 KiB
Dart
import 'package:diplomaticquarterapp/config/config.dart';
|
|
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
|
import 'package:diplomaticquarterapp/core/model/contactus/get_hmg_locations.dart';
|
|
import '../base_service.dart';
|
|
|
|
class FindusService extends BaseService {
|
|
|
|
|
|
List<GetHMGLocationsModel> FindusModelList = List();
|
|
List<GetHMGLocationsModel> FindusHospitalModelList = List();
|
|
List<GetHMGLocationsModel> FindusPharmaciesModelList = List();
|
|
Map<String, dynamic> body = Map();
|
|
|
|
Future getAllFindUsOrders() async {
|
|
hasError = false;
|
|
|
|
await baseAppClient.post(GET_FINDUS_REQUEST,
|
|
onSuccess: (dynamic response, int statusCode) {
|
|
FindusModelList.clear();
|
|
FindusHospitalModelList.clear();
|
|
FindusPharmaciesModelList.clear();
|
|
|
|
response['ListHMGLocation'].forEach((vital) {
|
|
if (GetHMGLocationsModel.fromJson(vital).locationType == 1) {
|
|
FindusHospitalModelList.add(GetHMGLocationsModel.fromJson(vital));
|
|
} else {
|
|
FindusPharmaciesModelList.add(GetHMGLocationsModel.fromJson(vital));
|
|
}
|
|
|
|
});
|
|
}, onFailure: (String error, int statusCode) {
|
|
hasError = true;
|
|
super.error = error;
|
|
}, body: body);
|
|
}
|
|
}
|