import 'dart:convert'; import 'package:doctor_app_flutter/models/patient_model.dart'; import 'package:flutter/cupertino.dart'; import 'package:http/http.dart' as http; class PatientsProvider with ChangeNotifier { Future getPatientList(PatientModel patient, patientType) async { Map requestHeaders = { 'Content-type': 'application/json', 'Accept': 'application/json', }; const url = 'https://hmgwebservices.com/Services/DoctorApplication.svc/REST/GetMyInPatient'; try { final response = await http.post(url, headers: requestHeaders, body: json.encode({ "ProjectID": patient.PatientID, "ClinicID": patient.ClinicID, "DoctorID": patient.DoctorID, "FirstName": patient.FirstName, "MiddleName": patient.MiddleName, "LastName": patient.LastName, "PatientMobileNumber": patient.PatientMobileNumber, "PatientIdentificationID": patient.PatientIdentificationID, "PatientID": patient.PatientID, "From": patient.From, "To": patient.To, "LanguageID": patient.LanguageID, "stamp": patient.stamp, "IPAdress": patient.IPAdress, "VersionID": patient.VersionID, "Channel": patient.Channel, "TokenID": patient.TokenID, "SessionID": patient.SessionID, "IsLoginForDoctorApp": patient.IsLoginForDoctorApp, "PatientOutSA": patient.PatientOutSA })); return Future.value(json.decode(response.body)); } catch (error) { throw error; } } }