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.
doctor_app_flutter/lib/providers/medicine_provider.dart

55 lines
1.9 KiB
Dart

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<Map> 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<Map> 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;
}
}
}