import 'dart:convert'; import 'package:doctor_app_flutter/client/app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/models/pharmacies_List_request_model.dart'; import 'package:doctor_app_flutter/models/pharmacies_items_request_model.dart'; import 'package:flutter/cupertino.dart'; class MedicineProvider with ChangeNotifier { Future getMedicineItem(PharmaciesItemsRequestModel medicine) async { try { final response = await AppClient.post(PHARMACY_ITEMS_URL, body: json.encode({ "PHR_itemName": medicine.PHR_itemName, "LanguageID": medicine.LanguageID, "stamp": medicine.stamp, "IPAdress": medicine.IPAdress, "VersionID": medicine.VersionID, "TokenID": medicine.TokenID, "SessionID": medicine.SessionID, "IsLoginForDoctorApp": medicine.IsLoginForDoctorApp, "PatientOutSA": medicine.PatientOutSA, "PatientTypeID": medicine.PatientTypeID })); return Future.value(json.decode(response.body)); } catch (error) { throw error; } } Future getPharmaciesList(PharmaciesListRequestModel pharmacy) async { try { final response = await AppClient.post(PHARMACY_LIST_URL, body: json.encode({ "ItemID": pharmacy.ItemID, "LanguageID": pharmacy.LanguageID, "stamp": pharmacy.stamp, "IPAdress": pharmacy.IPAdress, "VersionID": pharmacy.VersionID, "TokenID": pharmacy.TokenID, "SessionID": pharmacy.SessionID, "IsLoginForDoctorApp": pharmacy.IsLoginForDoctorApp, "PatientOutSA": pharmacy.PatientOutSA, "Channel": pharmacy.Channel, "PatientTypeID": pharmacy.PatientTypeID })); return Future.value(json.decode(response.body)); } catch (error) { throw error; } } }