import 'dart:io'; import 'package:doctor_app_flutter/models/patient_model.dart'; import 'package:flutter/cupertino.dart'; import 'package:http/http.dart' as http; import 'dart:convert'; 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": 12, "ClinicID": 17, "DoctorID": 98129, "FirstName": "0", "MiddleName": "0", "LastName": "0", "PatientMobileNumber": "0", "PatientIdentificationID": "0", "PatientID": 0, "From": "0", "To": "0", "LanguageID": 2, "stamp": "2020-03-02T13:56:39.170Z", "IPAdress": "11.11.11.11", "VersionID": 1.2, "Channel": 9, "TokenID": "2Fi7HoIHB0eDyekVa6tCJg==", "SessionID": "5G0yXn0Jnq", "IsLoginForDoctorApp": true, "PatientOutSA": false })); // var response = await http.post(url, body: {'name': 'doodle', 'color': 'blue'}); print('Response status: ${response.statusCode}'); print('Response body: ${response.body}'); return Future.value(json.decode(response.body)); notifyListeners(); } catch (error) { print(error.toString()); print('error'); } } }