|
|
|
|
@ -20,24 +20,24 @@ class DoctorReplyProvider with ChangeNotifier {
|
|
|
|
|
bool isLoading = true;
|
|
|
|
|
bool isError = false;
|
|
|
|
|
String error = '';
|
|
|
|
|
RequestDoctorReply _requestSchedule = RequestDoctorReply();
|
|
|
|
|
RequestDoctorReply _requestDoctorReply = RequestDoctorReply();
|
|
|
|
|
|
|
|
|
|
DoctorReplyProvider() {
|
|
|
|
|
getDoctorSchedule();
|
|
|
|
|
getDoctorReply();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getDoctorSchedule() async {
|
|
|
|
|
getDoctorReply() async {
|
|
|
|
|
const url = BASE_URL + 'DoctorApplication.svc/REST/GtMyPatientsQuestions';
|
|
|
|
|
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
|
|
|
|
|
String token = await sharedPref.getString(TOKEN);
|
|
|
|
|
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
|
|
|
|
|
_requestSchedule.doctorID = doctorProfile.doctorID;
|
|
|
|
|
_requestSchedule.projectID = doctorProfile.projectID;
|
|
|
|
|
_requestSchedule.tokenID = token;
|
|
|
|
|
_requestDoctorReply.doctorID = doctorProfile.doctorID;
|
|
|
|
|
_requestDoctorReply.projectID = doctorProfile.projectID;
|
|
|
|
|
_requestDoctorReply.tokenID = token;
|
|
|
|
|
try {
|
|
|
|
|
if (await Helpers.checkConnection()) {
|
|
|
|
|
final response = await client.post(url,
|
|
|
|
|
body: json.encode(_requestSchedule.toJson()));
|
|
|
|
|
body: json.encode(_requestDoctorReply.toJson()));
|
|
|
|
|
final int statusCode = response.statusCode;
|
|
|
|
|
if (statusCode < 200 || statusCode >= 400 || json == null) {
|
|
|
|
|
isLoading = false;
|
|
|
|
|
|