Merge branch 'ibrahim-merge' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into development

 Conflicts:
	lib/client/base_app_client.dart
	lib/config/config.dart
	lib/screens/auth/login_screen.dart
	lib/screens/medicine/medicine_search_screen.dart
	lib/widgets/auth/verfiy_account.dart
merge-requests/113/head
Mohammad ALjammal 6 years ago
commit c7f1c6d174

@ -3,14 +3,9 @@ import 'dart:convert';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/models/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor_profile_model.dart';
import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import 'package:http_interceptor/http_methods.dart';
import 'package:http_interceptor/models/request_data.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
Helpers helpers = new Helpers(); Helpers helpers = new Helpers();
@ -75,6 +70,7 @@ class BaseAppClient {
var parsed = json.decode(response.body.toString()); var parsed = json.decode(response.body.toString());
if (!parsed['IsAuthenticated']) { if (!parsed['IsAuthenticated']) {
await helpers.logout(); await helpers.logout();
helpers.showErrorToast('Your session expired Please login agian'); helpers.showErrorToast('Your session expired Please login agian');
} else if (parsed['MessageStatus'] == 1) { } else if (parsed['MessageStatus'] == 1) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);

@ -2,7 +2,7 @@ const MAX_SMALL_SCREEN = 660;
const ONLY_NUMBERS = "[0-9]"; const ONLY_NUMBERS = "[0-9]";
const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_LETTERS = "[a-zA-Z &'\"]";
const ONLY_DATE = "[0-9/]"; const ONLY_DATE = "[0-9/]";
const BASE_URL = 'https://hmgwebservices.com/Services/'; const BASE_URL = 'https://hmgwebservices.com/Services/';
//const BASE_URL = 'https://uat.hmgwebservices.com/Services/'; //const BASE_URL = 'https://uat.hmgwebservices.com/Services/';
const PHARMACY_ITEMS_URL = "Lists.svc/REST/GetPharmcyItems_Region"; const PHARMACY_ITEMS_URL = "Lists.svc/REST/GetPharmcyItems_Region";
const PHARMACY_LIST_URL = "Patients.svc/REST/GetPharmcyList"; const PHARMACY_LIST_URL = "Patients.svc/REST/GetPharmcyList";
@ -24,7 +24,7 @@ const GET_PATIENT_LAB_OREDERS =
const GET_PRESCRIPTION = 'Patients.svc/REST/GetPrescriptionApptList'; const GET_PRESCRIPTION = 'Patients.svc/REST/GetPrescriptionApptList';
const GET_RADIOLOGY = 'DoctorApplication.svc/REST/GetPatientRadResult'; const GET_RADIOLOGY = 'DoctorApplication.svc/REST/GetPatientRadResult';
var selectedPatientType = 0; var selectedPatientType = 0;
//*********change value to decode json from Dropdown ************ //*********change value to decode json from Dropdown ************
var SERVICES_PATIANT = [ var SERVICES_PATIANT = [
@ -70,7 +70,7 @@ const IS_LOGIN_FOR_DOCTOR_APP = true;
const PATIENT_OUT_SA = false; const PATIENT_OUT_SA = false;
/// Timer Info /// Timer Info
const TIMER_MIN =10; const TIMER_MIN = 10;
class AppGlobal{ class AppGlobal{
static var CONTEX; static var CONTEX;
} }

@ -1,27 +1,31 @@
import 'dart:convert'; import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/client/app_client.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import '../models/user_model.dart'; import '../models/user_model.dart';
const LOGIN_URL = const LOGIN_URL = 'Sentry.svc/REST/MemberLogIN_New';
'Sentry.svc/REST/MemberLogIN_New'; const INSERT_DEVICE_IMEI = 'Sentry.svc/REST/DoctorApplication_INSERTDeviceIMEI';
const INSERT_DEVICE_IMEI =
'Sentry.svc/REST/DoctorApplication_INSERTDeviceIMEI';
const SELECT_DEVICE_IMEI = const SELECT_DEVICE_IMEI =
'Sentry.svc/REST/DoctorApplication_SELECTDeviceIMEIbyIMEI'; 'Sentry.svc/REST/DoctorApplication_SELECTDeviceIMEIbyIMEI';
const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE = const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE =
'Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType'; 'Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType';
const MEMBER_CHECK_ACTIVATION_CODE_NEW ='Sentry.svc/REST/MemberCheckActivationCode_New'; const MEMBER_CHECK_ACTIVATION_CODE_NEW =
'Sentry.svc/REST/MemberCheckActivationCode_New';
const GET_DOC_PROFILES = 'Doctors.svc/REST/GetDocProfiles'; const GET_DOC_PROFILES = 'Doctors.svc/REST/GetDocProfiles';
class AuthProvider with ChangeNotifier {
Future<Map> login(UserModel userInfo) async {
const url = LOGIN_URL;
class AuthProvider with ChangeNotifier {
Future<dynamic> login(UserModel userInfo) async {
try { try {
final response = await AppClient.post(url, dynamic localRes;
body: json.encode({
await BaseAppClient.post(LOGIN_URL,
onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: {
"UserID": userInfo.UserID, "UserID": userInfo.UserID,
"Password": userInfo.Password, "Password": userInfo.Password,
"ProjectID": userInfo.ProjectID, "ProjectID": userInfo.ProjectID,
@ -30,76 +34,98 @@ class AuthProvider with ChangeNotifier {
"VersionID": userInfo.VersionID, "VersionID": userInfo.VersionID,
"Channel": userInfo.Channel, "Channel": userInfo.Channel,
"SessionID": userInfo.SessionID "SessionID": userInfo.SessionID
})); });
return Future.value(json.decode(response.body));
return Future.value(localRes);
} catch (error) { } catch (error) {
print(error); print(error);
throw error; throw error;
} }
} }
Future<Map> insertDeviceImei(imei) async { Future<dynamic> insertDeviceImei(imei) async {
const url = INSERT_DEVICE_IMEI;
try { try {
final response = await AppClient.post(url, body: json.encode(imei)); dynamic localRes;
return Future.value(json.decode(response.body));
await BaseAppClient.post(INSERT_DEVICE_IMEI,
onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: imei);
return Future.value(localRes);
} catch (error) { } catch (error) {
print(error); print(error);
throw error; throw error;
} }
} }
Future<Map> selectDeviceImei(imei) async { Future<dynamic> selectDeviceImei(imei) async {
const url = SELECT_DEVICE_IMEI;
try { try {
final response = await AppClient.post(url, body: json.encode(imei)); dynamic localRes;
return Future.value(json.decode(response.body)); await BaseAppClient.post(SELECT_DEVICE_IMEI,
onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: imei);
return Future.value(localRes);
} catch (error) { } catch (error) {
print(error); print(error);
throw error; throw error;
} }
} }
Future<Map> sendActivationCodeByOtpNotificationType( Future sendActivationCodeByOtpNotificationType(
activationCodeModel) async { activationCodeModel) async {
const url = SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE;
try { try {
final response = await AppClient.post(url, body: json.encode(activationCodeModel)); var localRes;
return Future.value(json.decode(response.body)); await BaseAppClient.post(SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE,
onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: activationCodeModel);
return Future.value(localRes);
} catch (error) { } catch (error) {
print(error); print(error);
throw error; throw error;
} }
} }
Future<Map> memberCheckActivationCodeNew(activationCodeModel) async { Future<dynamic> memberCheckActivationCodeNew(activationCodeModel) async {
const url = MEMBER_CHECK_ACTIVATION_CODE_NEW;
try { try {
final response = await AppClient.post(url, body: json.encode(activationCodeModel)); dynamic localRes;
return Future.value(json.decode(response.body)); await BaseAppClient.post(MEMBER_CHECK_ACTIVATION_CODE_NEW,
onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: activationCodeModel);
return Future.value(localRes);
} catch (error) { } catch (error) {
print(error); print(error);
throw error; throw error;
} }
} }
/* /*
*@author: Elham Rababah *@author: Elham Rababah
*@Date:17/5/2020 *@Date:17/5/2020
*@param: docInfo *@param: docInfo
*@return:Future<Map> *@return:Future<Map>
*@desc: getDocProfiles *@desc: getDocProfiles
*/ */
Future<Map> getDocProfiles(docInfo) async { Future<dynamic> getDocProfiles(docInfo) async {
const url = GET_DOC_PROFILES;
try { try {
final response = await AppClient.post(url, body: json.encode(docInfo)); dynamic localRes;
return Future.value(json.decode(response.body)); await BaseAppClient.post(GET_DOC_PROFILES,
onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: docInfo);
return Future.value(localRes);
} catch (error) { } catch (error) {
print(error); print(error);
throw error; throw error;

@ -1,11 +1,8 @@
import 'dart:convert'; import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/client/app_client.dart';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
class HospitalProvider with ChangeNotifier { class HospitalProvider with ChangeNotifier {
Future<Map> getProjectsList() async { Future<Map> getProjectsList() async {
const url = GET_PROJECTS; const url = GET_PROJECTS;
var info = { var info = {
@ -18,12 +15,17 @@ class HospitalProvider with ChangeNotifier {
"SessionID": "i1UJwCTSqt", "SessionID": "i1UJwCTSqt",
"IsLoginForDoctorApp": true "IsLoginForDoctorApp": true
}; };
try { dynamic localRes ;
final response = await AppClient.post(url, body: json.encode(info));
return Future.value(json.decode(response.body)); await BaseAppClient.post(url,
} catch (error) { onSuccess: ( response, statusCode) async {
throw error; localRes= response;
// print('error'); },
} onFailure: (String error, int statusCode) {
throw error;
},
body: info);
return Future.value(localRes);
} }
} }

@ -16,13 +16,10 @@ import 'package:doctor_app_flutter/models/patient/prescription_res_model.dart';
import 'package:doctor_app_flutter/models/patient/radiology_res_model.dart'; import 'package:doctor_app_flutter/models/patient/radiology_res_model.dart';
import 'package:doctor_app_flutter/models/patient/refer_to_doctor_request.dart'; import 'package:doctor_app_flutter/models/patient/refer_to_doctor_request.dart';
import 'package:doctor_app_flutter/models/prescription_report.dart'; import 'package:doctor_app_flutter/models/prescription_report.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:http/http.dart';
import 'package:http_interceptor/http_client_with_interceptor.dart';
import '../client/app_client.dart';
import '../config/config.dart'; import '../config/config.dart';
import '../interceptor/http_interceptor.dart';
import '../models/patient/lab_orders_res_model.dart'; import '../models/patient/lab_orders_res_model.dart';
import '../models/patient/patiant_info_model.dart'; import '../models/patient/patiant_info_model.dart';
import '../models/patient/patient_model.dart'; import '../models/patient/patient_model.dart';
@ -32,6 +29,7 @@ import '../models/patient/vital_sign_res_model.dart';
import '../util/helpers.dart'; import '../util/helpers.dart';
Helpers helpers = Helpers(); Helpers helpers = Helpers();
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
class PatientsProvider with ChangeNotifier { class PatientsProvider with ChangeNotifier {
bool isLoading = false; bool isLoading = false;
@ -60,31 +58,26 @@ class PatientsProvider with ChangeNotifier {
var referalFrequancyList = []; var referalFrequancyList = [];
DoctorsByClinicIdRequest _doctorsByClinicIdRequest = DoctorsByClinicIdRequest _doctorsByClinicIdRequest =
DoctorsByClinicIdRequest(); DoctorsByClinicIdRequest();
STPReferralFrequencyRequest _referralFrequencyRequest = STPReferralFrequencyRequest _referralFrequencyRequest =
STPReferralFrequencyRequest(); STPReferralFrequencyRequest();
ClinicByProjectIdRequest _clinicByProjectIdRequest = ClinicByProjectIdRequest _clinicByProjectIdRequest =
ClinicByProjectIdRequest(); ClinicByProjectIdRequest();
ReferToDoctorRequest _referToDoctorRequest ; ReferToDoctorRequest _referToDoctorRequest = ReferToDoctorRequest();
Client client =
HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]);
PatiantInformtion _selectedPatient; PatiantInformtion _selectedPatient;
Future<Map> getPatientList(PatientModel patient, patientType) async { Future<dynamic> getPatientList(PatientModel patient, patientType) async {
/* const url =
BASE_URL+'DoctorApplication.svc/REST/GetMyInPatient';*/
int val = int.parse(patientType); int val = int.parse(patientType);
//**********Modify url by amjad amireh for patiant type*********
final url =
BASE_URL + "DoctorApplication.svc/REST/" + SERVICES_PATIANT[val];
// print("a===========$url=======a");
try { try {
final response = await client.post(url, dynamic localRes;
body: json.encode({ await BaseAppClient.post('DoctorApplication.svc/REST/' + SERVICES_PATIANT[val],
onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: {
"ProjectID": patient.ProjectID, "ProjectID": patient.ProjectID,
"ClinicID": patient.ClinicID, "ClinicID": patient.ClinicID,
"DoctorID": patient.DoctorID, "DoctorID": patient.DoctorID,
@ -105,13 +98,12 @@ class PatientsProvider with ChangeNotifier {
"SessionID": patient.SessionID, "SessionID": patient.SessionID,
"IsLoginForDoctorApp": patient.IsLoginForDoctorApp, "IsLoginForDoctorApp": patient.IsLoginForDoctorApp,
"PatientOutSA": patient.PatientOutSA "PatientOutSA": patient.PatientOutSA
})); });
//**********************
//***********************
return Future.value(json.decode(response.body)); return Future.value(localRes);
} catch (err) { } catch (error) {
throw err; print(error);
throw error;
} }
} }
@ -133,21 +125,10 @@ class PatientsProvider with ChangeNotifier {
setBasicData(); setBasicData();
try { try {
if (await Helpers.checkConnection()) { await BaseAppClient.post(GET_PATIENT_VITAL_SIGN,
final response = await AppClient.post(GET_PATIENT_VITAL_SIGN, onSuccess: (dynamic response, int statusCode) {
body: json.encode(patient));
final int statusCode = response.statusCode;
isLoading = false;
if (statusCode < 200 || statusCode >= 400 || json == null) {
isError = true;
error = 'Error While Fetching data';
} else {
var res = json.decode(response.body);
print('$res');
if (res['MessageStatus'] == 1) {
patientVitalSignList = []; patientVitalSignList = [];
res['List_DoctorPatientVitalSign'].forEach((v) { response['List_DoctorPatientVitalSign'].forEach((v) {
patientVitalSignList.add(new VitalSignResModel.fromJson(v)); patientVitalSignList.add(new VitalSignResModel.fromJson(v));
}); });
@ -160,21 +141,22 @@ class PatientsProvider with ChangeNotifier {
a.vitalSignDate.microsecondsSinceEpoch; a.vitalSignDate.microsecondsSinceEpoch;
}); });
patientVitalSignOrderdSubList.clear(); patientVitalSignOrderdSubList.clear();
for (int x = 0; x < 20; x++) { int length = patientVitalSignOrderdSubListTemp.length >= 20
? 20
: patientVitalSignOrderdSubListTemp.length;
for (int x = 0; x < length; x++) {
patientVitalSignOrderdSubList patientVitalSignOrderdSubList
.add(patientVitalSignOrderdSubListTemp[x]); .add(patientVitalSignOrderdSubListTemp[x]);
} }
} }
} else { isLoading = false;
isError = false;
this.error = '';
}, onFailure: (String error, int statusCode) {
isLoading = false;
isError = true; isError = true;
error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; this.error = error;
} }, body: patient);
}
} else {
isLoading = false;
isError = true;
error = 'Please Check The Internet Connection';
}
notifyListeners(); notifyListeners();
} catch (err) { } catch (err) {
handelCatchErrorCase(err); handelCatchErrorCase(err);
@ -193,33 +175,20 @@ class PatientsProvider with ChangeNotifier {
setBasicData(); setBasicData();
try { try {
if (await Helpers.checkConnection()) { await BaseAppClient.post(GET_PATIENT_LAB_OREDERS,
final response = await AppClient.post(GET_PATIENT_LAB_OREDERS, onSuccess: (dynamic response, int statusCode) {
body: json.encode(patient));
final int statusCode = response.statusCode;
isLoading = false;
if (statusCode < 200 || statusCode >= 400 || json == null) {
isError = true;
error = 'Error While Fetching data';
} else {
var res = json.decode(response.body);
print('$res');
if (res['MessageStatus'] == 1) {
patientLabResultOrdersList = []; patientLabResultOrdersList = [];
res['List_GetLabOreders'].forEach((v) { response['List_GetLabOreders'].forEach((v) {
patientLabResultOrdersList.add(new LabOrdersResModel.fromJson(v)); patientLabResultOrdersList.add(new LabOrdersResModel.fromJson(v));
}); });
} else { isLoading = false;
isError = false;
this.error = '';
}, onFailure: (String error, int statusCode) {
isLoading = false;
isError = true; isError = true;
error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; this.error = error;
} }, body: patient);
}
} else {
isLoading = false;
isError = true;
error = 'Please Check The Internet Connection';
}
notifyListeners(); notifyListeners();
} catch (err) { } catch (err) {
handelCatchErrorCase(err); handelCatchErrorCase(err);
@ -234,36 +203,21 @@ class PatientsProvider with ChangeNotifier {
*/ */
getOutPatientPrescriptions(patient) async { getOutPatientPrescriptions(patient) async {
setBasicData(); setBasicData();
try { try {
if (await Helpers.checkConnection()) { await BaseAppClient.post(GET_PRESCRIPTION,
final response = onSuccess: (dynamic response, int statusCode) {
await AppClient.post(GET_PRESCRIPTION, body: json.encode(patient));
final int statusCode = response.statusCode;
isLoading = false;
if (statusCode < 200 || statusCode >= 400 || json == null) {
isError = true;
error = 'Error While Fetching data';
} else {
var res = json.decode(response.body);
print('$res');
if (res['MessageStatus'] == 1) {
patientPrescriptionsList = []; patientPrescriptionsList = [];
res['PatientPrescriptionList'].forEach((v) { response['PatientPrescriptionList'].forEach((v) {
patientPrescriptionsList patientPrescriptionsList.add(new PrescriptionResModel.fromJson(v));
.add(new PrescriptionResModel.fromJson(v));
}); });
} else { isLoading = false;
isError = false;
this.error = '';
}, onFailure: (String error, int statusCode) {
isLoading = false;
isError = true; isError = true;
error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; this.error = error;
} }, body: patient);
}
} else {
isLoading = false;
isError = true;
error = 'Please Check The Internet Connection';
}
notifyListeners(); notifyListeners();
} catch (err) { } catch (err) {
handelCatchErrorCase(err); handelCatchErrorCase(err);
@ -284,13 +238,13 @@ class PatientsProvider with ChangeNotifier {
await BaseAppClient.post( await BaseAppClient.post(
'DoctorApplication.svc/REST/GetPrescriptionReportForInPatient', 'DoctorApplication.svc/REST/GetPrescriptionReportForInPatient',
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
response['List_PrescriptionReportForInPatient'].forEach((v) { response['List_PrescriptionReportForInPatient'].forEach((v) {
prescriptionReportForInPatientList prescriptionReportForInPatientList
.add(PrescriptionReportForInPatient.fromJson(v)); .add(PrescriptionReportForInPatient.fromJson(v));
}); });
isError = false; isError = false;
isLoading = false; isLoading = false;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
isError = true; isError = true;
isLoading = false; isLoading = false;
this.error = error; this.error = error;
@ -309,16 +263,16 @@ class PatientsProvider with ChangeNotifier {
notifyListeners(); notifyListeners();
await BaseAppClient.post('Patients.svc/REST/GetPrescriptionReport', await BaseAppClient.post('Patients.svc/REST/GetPrescriptionReport',
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
response['ListPRM'].forEach((v) { response['ListPRM'].forEach((v) {
prescriptionReport.add(PrescriptionReport.fromJson(v)); prescriptionReport.add(PrescriptionReport.fromJson(v));
}); });
isError = false; isError = false;
isLoading = false; isLoading = false;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
isError = true; isError = true;
isLoading = false; isLoading = false;
this.error = error; this.error = error;
}, body: prescriptionReqModel); }, body: prescriptionReqModel);
notifyListeners(); notifyListeners();
} }
@ -347,33 +301,20 @@ class PatientsProvider with ChangeNotifier {
// notifyListeners(); // notifyListeners();
setBasicData(); setBasicData();
try { try {
if (await Helpers.checkConnection()) { await BaseAppClient.post(GET_RADIOLOGY,
final response = onSuccess: (dynamic response, int statusCode) {
await AppClient.post(GET_RADIOLOGY, body: json.encode(patient));
final int statusCode = response.statusCode;
isLoading = false;
if (statusCode < 200 || statusCode >= 400 || json == null) {
isError = true;
error = 'Error While Fetching data';
} else {
var res = json.decode(response.body);
print('$res');
if (res['MessageStatus'] == 1) {
patientRadiologyList = []; patientRadiologyList = [];
res['List_GetRadOreders'].forEach((v) { response['List_GetRadOreders'].forEach((v) {
patientRadiologyList.add(new RadiologyResModel.fromJson(v)); patientRadiologyList.add(new RadiologyResModel.fromJson(v));
}); });
} else { isLoading = false;
isError = false;
this.error = '';
}, onFailure: (String error, int statusCode) {
isLoading = false;
isError = true; isError = true;
error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; this.error = error;
} }, body: patient);
}
} else {
isLoading = false;
isError = true;
error = 'Please Check The Internet Connection';
}
notifyListeners(); notifyListeners();
} catch (err) { } catch (err) {
handelCatchErrorCase(err); handelCatchErrorCase(err);
@ -391,47 +332,33 @@ class PatientsProvider with ChangeNotifier {
requestLabResult.patientTypeID = labOrdersResModel.patientType; requestLabResult.patientTypeID = labOrdersResModel.patientType;
await BaseAppClient.post('DoctorApplication.svc/REST/GetPatientLabResults', await BaseAppClient.post('DoctorApplication.svc/REST/GetPatientLabResults',
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
isError = false; isError = false;
isLoading = false; isLoading = false;
response['List_GetLabNormal'].forEach((v) { response['List_GetLabNormal'].forEach((v) {
labResultList.add(new LabResult.fromJson(v)); labResultList.add(new LabResult.fromJson(v));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
isError = true; isError = true;
isLoading = false; isLoading = false;
this.error = error; this.error = error;
}, body: requestLabResult.toJson()); }, body: requestLabResult.toJson());
notifyListeners(); notifyListeners();
} }
getPatientInsuranceApprovals(patient) async { getPatientInsuranceApprovals(patient) async {
setBasicData(); setBasicData();
try { try {
if (await Helpers.checkConnection()) { await BaseAppClient.post(PATIENT_INSURANCE_APPROVALS_URL,
final response = await AppClient.post(PATIENT_INSURANCE_APPROVALS_URL, onSuccess: (dynamic response, int statusCode) {
body: json.encode(patient)); insuranceApporvalsList = response['List_ApprovalMain_InPatient'];
final int statusCode = response.statusCode; isLoading = false;
isLoading = false; isError = false;
this.error = '';
if (statusCode < 200 || statusCode >= 400 || json == null) { }, onFailure: (String error, int statusCode) {
isError = true; isLoading = false;
error = 'Error While Fetching data';
} else {
var res = json.decode(response.body);
print('$res');
if (res['MessageStatus'] == 1) {
//patientRadiologyList = [];
insuranceApporvalsList = res['List_ApprovalMain_InPatient'];
} else {
isError = true; isError = true;
error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; this.error = error;
} }, body: patient);
}
} else {
isLoading = false;
isError = true;
error = 'Please Check The Internet Connection';
}
notifyListeners(); notifyListeners();
} catch (err) { } catch (err) {
handelCatchErrorCase(err); handelCatchErrorCase(err);
@ -445,30 +372,17 @@ class PatientsProvider with ChangeNotifier {
getPatientProgressNote(patient) async { getPatientProgressNote(patient) async {
setBasicData(); setBasicData();
try { try {
if (await Helpers.checkConnection()) { await BaseAppClient.post(PATIENT_PROGRESS_NOTE_URL,
final response = await AppClient.post(PATIENT_PROGRESS_NOTE_URL, onSuccess: (dynamic response, int statusCode) {
body: json.encode(patient)); patientProgressNoteList = response['List_GetPregressNoteForInPatient'];
final int statusCode = response.statusCode; isLoading = false;
isLoading = false; isError = false;
this.error = '';
if (statusCode < 200 || statusCode >= 400 || json == null) { }, onFailure: (String error, int statusCode) {
isError = true; isLoading = false;
error = 'Error While Fetching data';
} else {
var res = json.decode(response.body);
print('$res');
if (res['MessageStatus'] == 1) {
patientProgressNoteList = res['List_GetPregressNoteForInPatient'];
} else {
isError = true; isError = true;
error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; this.error = error;
} }, body: patient);
}
} else {
isLoading = false;
isError = true;
error = 'Please Check The Internet Connection';
}
notifyListeners(); notifyListeners();
} catch (err) { } catch (err) {
handelCatchErrorCase(err); handelCatchErrorCase(err);
@ -480,51 +394,29 @@ class PatientsProvider with ChangeNotifier {
*@desc: getDoctorsList *@desc: getDoctorsList
*/ */
getDoctorsList(String clinicId) async { getDoctorsList(String clinicId) async {
String token = await sharedPref.getString(TOKEN);
int projectID = await sharedPref.getInt(PROJECT_ID);
setBasicData(); setBasicData();
try { try {
if (await Helpers.checkConnection()) { _doctorsByClinicIdRequest.clinicID = clinicId;
_doctorsByClinicIdRequest.projectID = projectID; await BaseAppClient.post(PATIENT_GET_DOCTOR_BY_CLINIC_URL,
_doctorsByClinicIdRequest.clinicID = clinicId; onSuccess: (dynamic response, int statusCode) {
_doctorsByClinicIdRequest.tokenID = token; doctorsList = response['List_Doctors_All'];
isLoading = false;
final response = await AppClient.post(PATIENT_GET_DOCTOR_BY_CLINIC_URL, isError = false;
body: json.encode(_doctorsByClinicIdRequest)); this.error = '';
final int statusCode = response.statusCode; }, onFailure: (String error, int statusCode) {
isLoading = false;
if (statusCode < 200 || statusCode >= 400 || json == null) {
isError = true;
error = 'Error While Fetching data';
isLoading = false;
} else {
var res = json.decode(response.body);
print('$res');
if (res['MessageStatus'] == 1) {
doctorsList = res['List_Doctors_All'];
isLoading = false;
} else {
isError = true; isError = true;
error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; this.error = error;
isLoading = false; }, body: _doctorsByClinicIdRequest.toJson());
}
}
} else {
isLoading = false;
isError = true;
error = 'Please Check The Internet Connection';
}
notifyListeners(); notifyListeners();
} catch (err) { } catch (err) {
handelCatchErrorCase(err); handelCatchErrorCase(err);
isLoading = false;
} }
} }
List getDoctorNameList() { List getDoctorNameList() {
var doctorNamelist = var doctorNamelist =
doctorsList.map((value) => value['DoctorName'].toString()).toList(); doctorsList.map((value) => value['DoctorName'].toString()).toList();
return doctorNamelist; return doctorNamelist;
} }
@ -533,37 +425,19 @@ class PatientsProvider with ChangeNotifier {
*@desc: getClinicsList *@desc: getClinicsList
*/ */
getClinicsList() async { getClinicsList() async {
String token = await sharedPref.getString(TOKEN);
setBasicData(); setBasicData();
try { try {
if (await Helpers.checkConnection()) { await BaseAppClient.post(PATIENT_GET_CLINIC_BY_PROJECT_URL,
int projectID = await sharedPref.getInt(PROJECT_ID); onSuccess: (dynamic response, int statusCode) {
_clinicByProjectIdRequest.projectID = projectID; clinicsList = response['List_Clinic_All'];
_clinicByProjectIdRequest.tokenID = token; isLoading = false;
isError = false;
final response = await AppClient.post(PATIENT_GET_CLINIC_BY_PROJECT_URL, this.error = '';
body: json.encode(_clinicByProjectIdRequest)); }, onFailure: (String error, int statusCode) {
final int statusCode = response.statusCode; isLoading = false;
isLoading = false;
if (statusCode < 200 || statusCode >= 400 || json == null) {
isError = true;
error = 'Error While Fetching data';
} else {
var res = json.decode(response.body);
print('$res');
if (res['MessageStatus'] == 1) {
clinicsList = res['List_Clinic_All'];
} else {
isError = true; isError = true;
error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; this.error = error;
} }, body: _clinicByProjectIdRequest.toJson());
}
} else {
isLoading = false;
isError = true;
error = 'Please Check The Internet Connection';
}
notifyListeners(); notifyListeners();
} catch (err) { } catch (err) {
handelCatchErrorCase(err); handelCatchErrorCase(err);
@ -582,33 +456,19 @@ class PatientsProvider with ChangeNotifier {
*@desc: getReferralFrequancyList *@desc: getReferralFrequancyList
*/ */
getReferralFrequancyList() async { getReferralFrequancyList() async {
String token = await sharedPref.getString(TOKEN);
setBasicData(); setBasicData();
try { try {
if (await Helpers.checkConnection()) { await BaseAppClient.post(PATIENT_GET_LIST_REFERAL_URL,
_referralFrequencyRequest.tokenID = token; onSuccess: (dynamic response, int statusCode) {
final response = await AppClient.post(PATIENT_GET_LIST_REFERAL_URL, referalFrequancyList = response['list_STPReferralFrequency'];
body: json.encode(_referralFrequencyRequest)); isLoading = false;
final int statusCode = response.statusCode; isError = false;
isLoading = false; this.error = '';
if (statusCode < 200 || statusCode >= 400 || json == null) { }, onFailure: (String error, int statusCode) {
isError = true; isLoading = false;
error = 'Error While Fetching data';
} else {
var res = json.decode(response.body);
print('$res');
if (res['MessageStatus'] == 1) {
referalFrequancyList = res['list_STPReferralFrequency'];
} else {
isError = true; isError = true;
error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; this.error = error;
} }, body: _referralFrequencyRequest.toJson());
}
} else {
isLoading = false;
isError = true;
error = 'Please Check The Internet Connection';
}
notifyListeners(); notifyListeners();
} catch (err) { } catch (err) {
handelCatchErrorCase(err); handelCatchErrorCase(err);
@ -628,23 +488,23 @@ class PatientsProvider with ChangeNotifier {
*/ */
referToDoctor(context, referToDoctor(context,
{String selectedDoctorID, {String selectedDoctorID,
String selectedClinicID, String selectedClinicID,
int admissionNo, int admissionNo,
String extension, String extension,
String priority, String priority,
String frequency, String frequency,
String referringDoctorRemarks, String referringDoctorRemarks,
int patientID, int patientID,
int patientTypeID, int patientTypeID,
String roomID, String roomID,
int projectID}) async { int projectID}) async {
setBasicData(); setBasicData();
try { try {
if (await Helpers.checkConnection()) { if (await Helpers.checkConnection()) {
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel doctorProfile =
new DoctorProfileModel.fromJson(profile); new DoctorProfileModel.fromJson(profile);
int doctorID = doctorProfile.doctorID; int doctorID = doctorProfile.doctorID;
int clinicId = doctorProfile.clinicID; int clinicId = doctorProfile.clinicID;
_referToDoctorRequest = ReferToDoctorRequest( _referToDoctorRequest = ReferToDoctorRequest(

@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart'; import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart';
import 'package:doctor_app_flutter/providers/patients_provider.dart'; import 'package:doctor_app_flutter/providers/patients_provider.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; import 'package:doctor_app_flutter/widgets/shared/app_button.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -23,7 +24,7 @@ class QrReaderScreen extends StatefulWidget {
} }
class _QrReaderScreenState extends State<QrReaderScreen> { class _QrReaderScreenState extends State<QrReaderScreen> {
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
bool isLoading = false; bool isLoading = false;
bool isError = false; bool isError = false;
@ -72,9 +73,9 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
height: 7, height: 7,
), ),
AppText( AppText(
'scan Qr code to retrieve patient profile', 'scan Qr code to retrieve patient profile',
fontSize: 14, fontSize: 14,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
textAlign: TextAlign.center textAlign: TextAlign.center
), ),
SizedBox( SizedBox(
@ -123,15 +124,15 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
/// var result = await BarcodeScanner.scan(); /// var result = await BarcodeScanner.scan();
/// int patientID = get from qr result /// int patientID = get from qr result
var result = await BarcodeScanner.scan(); var result = await BarcodeScanner.scan();
// if (result.rawContent == "") { // if (result.rawContent == "") {
List<String> listOfParams = result.rawContent.split(','); List<String> listOfParams = result.rawContent.split(',');
String patientType = "1"; String patientType = "1";
setState(() { setState(() {
isLoading = true; isLoading = true;
isError = false; isError = false;
patientList = []; patientList = [];
}); });
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
// Map profile = await sharedPref.getObj(DOCTOR_PROFILE); // Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
// DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); // DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile);
// patient.PatientID = 8808; // patient.PatientID = 8808;
@ -140,57 +141,64 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
// patient.setClinicID = doctorProfile.clinicID; // patient.setClinicID = doctorProfile.clinicID;
// patient.setProjectID = doctorProfile.projectID; // patient.setProjectID = doctorProfile.projectID;
// Provider.of<PatientsProvider>(context, listen: false); // Provider.of<PatientsProvider>(context, listen: false);
patient.PatientID = 8808; patient.PatientID = 8808;
patient.TokenID = token; patient.TokenID = token;
Provider.of<PatientsProvider>(context, listen: false) Provider.of<PatientsProvider>(context, listen: false)
.getPatientList(patient, "1") .getPatientList(patient, "1")
.then((response) { .then((response) {
if (response['MessageStatus'] == 1) { if (response['MessageStatus'] == 1) {
switch (patientType) { switch (patientType) {
case "0": case "0":
if (response['List_MyOutPatient'] != null) { if (response['List_MyOutPatient'] != null) {
setState(() { setState(() {
patientList = ModelResponse.fromJson(response['List_MyOutPatient']).list; patientList = ModelResponse.fromJson(response['List_MyOutPatient']).list;
isLoading = false; isLoading = false;
}); });
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
"patient": patientList[0], "patient": patientList[0],
}); });
} else { } else {
setState(() { setState(() {
isError = true; isError = true;
error = 'No patient'; isLoading = false;
isLoading = false; });
}); DrAppToastMsg.showErrorToast('No patient');
} }
break;
case "1":
if (response['List_MyInPatient'] != null) {
setState(() {
patientList = ModelResponse.fromJson(response['List_MyInPatient']).list;
isLoading = false;
error = "";
});
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
"patient": patientList[0],
});
} else {
setState(() {
isError = true;
isLoading = false;
});
DrAppToastMsg.showErrorToast('No patient');
break; break;
case "1": }
if (response['List_MyInPatient'] != null) {
setState(() {
patientList = ModelResponse.fromJson(response['List_MyInPatient']).list;
isLoading = false;
error = "";
});
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
"patient": patientList[0],
});
} else {
setState(() {
error = 'No patient';
isError = true;
isLoading = false;
});
break;
}
}
} else {
setState(() {
error = response['ErrorEndUserMessage'] ?? response['ErrorMessage'] ;
isLoading = false;
isError = true;
});
} }
} else {
setState(() {
isLoading = false;
isError = true;
});
DrAppToastMsg.showErrorToast(response['ErrorEndUserMessage'] ?? response['ErrorMessage']);
}
}).catchError((error){
setState(() {
isLoading = false;
}); });
} helpers.showErrorToast(error);
// } //DrAppToastMsg.showErrorToast(error);
});
}
// }
} }

@ -41,10 +41,10 @@ class _LoginsreenState extends State<Loginsreen> {
}); });
} }
/* /*
*@author: Elham Rababah *@author: Elham Rababah
*@Date:19/4/2020 *@Date:19/4/2020
*@param: isLoading *@param: isLoading
*@return: *@return:
*@desc: Change Isloading attribute in order to show or hide loader *@desc: Change Isloading attribute in order to show or hide loader
*/ */
@ -56,7 +56,7 @@ class _LoginsreenState extends State<Loginsreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AppGlobal.CONTEX = context;
getSharedPref(); getSharedPref();
return AppScaffold( return AppScaffold(
isLoading: _isLoading, isLoading: _isLoading,
@ -80,24 +80,24 @@ class _LoginsreenState extends State<Loginsreen> {
children: <Widget>[ children: <Widget>[
(platformImei == null) (platformImei == null)
? Column( ? Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AuthHeader(loginType.knownUser), AuthHeader(loginType.knownUser),
LoginForm( LoginForm(
changeLoadingStata: changeLoadingStata:
changeLoadingStata, changeLoadingStata,
), ),
], ],
) )
: Column( : Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AuthHeader(loginType.unknownUser), AuthHeader(loginType.unknownUser),
KnownUserLogin(), KnownUserLogin(),
], ],
), ),
])); ]));
} }
} }

@ -6,8 +6,6 @@ import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indei
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../config/size_config.dart';
import '../../widgets/shared/app_scaffold_widget.dart';
class MyScheduleScreen extends StatelessWidget { class MyScheduleScreen extends StatelessWidget {
ScheduleProvider scheduleProvider; ScheduleProvider scheduleProvider;

@ -63,10 +63,11 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
), ),
Container( Container(
margin: EdgeInsets.only(bottom: 5, margin: EdgeInsets.only(
left: 10, bottom: SizeConfig.heightMultiplier * 1,
right: 10, right: SizeConfig.heightMultiplier * 2,
top: 0), left: SizeConfig.heightMultiplier * 2,
top: SizeConfig.heightMultiplier * 1),
child: Wrap( child: Wrap(
alignment: WrapAlignment.center, alignment: WrapAlignment.center,
children: <Widget>[ children: <Widget>[
@ -86,15 +87,18 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
"You find " + (data == null ? "0": data.length.toString())+" items in search", "You find " +
(data == null ? "0" : data.length.toString()) +
" items in search",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
margin: 5,), margin: 5,
),
], ],
), ),
), ),
Expanded( Expanded(
child: Container( child: Container(
width: SizeConfig.screenWidth * 0.97, width: SizeConfig.screenWidth * 0.90,
child: !_medicineProvider.isFinished child: !_medicineProvider.isFinished
? DrAppCircularProgressIndeicator() ? DrAppCircularProgressIndeicator()
: _medicineProvider.hasError : _medicineProvider.hasError
@ -104,32 +108,33 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
style: TextStyle( style: TextStyle(
color: Theme.of(context).errorColor), color: Theme.of(context).errorColor),
), ),
):ListView.builder( )
scrollDirection: Axis.vertical, : ListView.builder(
shrinkWrap: true, scrollDirection: Axis.vertical,
itemCount: data == null ? 0 : data.length, shrinkWrap: true,
itemBuilder: (BuildContext context, int index) { itemCount: data == null ? 0 : data.length,
itemBuilder: (BuildContext context, int index) {
return InkWell( return InkWell(
child: MedicineItemWidget( child: MedicineItemWidget(
label: data[index]["ItemDescription"], label: data[index]["ItemDescription"],
url: data[index]["ProductImageBase64"], url: data[index]["ProductImageBase64"],
), ),
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => ChangeNotifierProvider( builder: (context) =>
create: (_) => MedicineProvider(), ChangeNotifierProvider(
child: PharmaciesListScreen( create: (_) => MedicineProvider(),
itemID: data[index]["ItemID"], url: data[index]["ProductImageBase64"]), child: PharmaciesListScreen(
), itemID: data[index]["ItemID"], url: data[index]["ProductImageBase64"]),
),
),
);
},
);
},
), ),
);
},
);
},
),
), ),
), ),
], ],

@ -79,116 +79,112 @@ class _RadiologyScreenState extends State<RadiologyScreen> {
body: patientsProv.isLoading body: patientsProv.isLoading
? DrAppCircularProgressIndeicator() ? DrAppCircularProgressIndeicator()
: patientsProv.isError : patientsProv.isError
? DrAppEmbeddedError(error: patientsProv.error) ? DrAppEmbeddedError(error: patientsProv.error)
: patientsProv.patientRadiologyList.length == 0 : patientsProv.patientRadiologyList.length == 0
? DrAppEmbeddedError(error: 'You don\'t have any Vital Sign') ? DrAppEmbeddedError(error: 'You don\'t have any Vital Sign')
: Container( : Container(
margin: EdgeInsets.fromLTRB( margin: EdgeInsets.fromLTRB(
SizeConfig.realScreenWidth * 0.05, SizeConfig.realScreenWidth * 0.05,
0, 0,
SizeConfig.realScreenWidth * 0.05, SizeConfig.realScreenWidth * 0.05,
0), 0),
child: Container( child: Container(
margin: EdgeInsets.symmetric(vertical: 10), margin: EdgeInsets.symmetric(vertical: 10),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(20.0), Radius.circular(20.0),
), ),
), ),
child: ListView.builder( child: ListView.builder(
itemCount: patientsProv.patientRadiologyList.length, itemCount: patientsProv.patientRadiologyList.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return InkWell( return InkWell(
onTap: () { onTap: () {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute(builder: (context) => RadiologyReportScreen(reportData: patientsProv.patientRadiologyList[index].reportData,)),); MaterialPageRoute(builder: (context) => RadiologyReportScreen(reportData: patientsProv.patientRadiologyList[index].reportData,)),);
}, },
child: Container( child: Container(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(10)), BorderRadius.all(Radius.circular(10)),
border: Border( border: Border(
bottom: BorderSide( bottom: BorderSide(
color: Colors.grey, width: 0.5), color: Colors.grey, width: 0.5),
top: BorderSide( top: BorderSide(
color: Colors.grey, width: 0.5), color: Colors.grey, width: 0.5),
left: BorderSide( left: BorderSide(
color: Colors.grey, width: 0.5), color: Colors.grey, width: 0.5),
right: BorderSide( right: BorderSide(
color: Colors.grey, width: 0.5), color: Colors.grey, width: 0.5),
),
),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
LargeAvatar(
url: patientsProv
.patientRadiologyList[index]
.doctorImageURL,
),
Expanded(
child: Padding(
padding:
const EdgeInsets.fromLTRB(
8, 0, 0, 0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
'${patientsProv.patientRadiologyList[index].doctorName}',
fontSize: 2.5 *
SizeConfig
.textMultiplier,
fontWeight:
FontWeight.bold),
SizedBox(
height: 8,
),
AppText(
'Invoice No:${patientsProv.patientRadiologyList[index].invoiceNo}',
fontSize: 2 *
SizeConfig
.textMultiplier,
),
SizedBox(
height: 8,
), ),
), AppText(
child: Column( ' ${patientsProv.patientRadiologyList[index].clinicName}',
crossAxisAlignment: fontSize: 2 *
CrossAxisAlignment.start, SizeConfig
children: <Widget>[ .textMultiplier,
Row( color: Theme.of(context)
children: <Widget>[ .primaryColor,
LargeAvatar( ),
url: patientsProv SizedBox(
.patientRadiologyList[index] height: 8,
.doctorImageURL, ),
name: patientsProv ],
.patientLabResultOrdersList[
index]
.doctorName,
),
Expanded(
child: Padding(
padding:
const EdgeInsets.fromLTRB(
8, 0, 0, 0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
'${patientsProv.patientRadiologyList[index].doctorName}',
fontSize: 2.5 *
SizeConfig
.textMultiplier,
fontWeight:
FontWeight.bold),
SizedBox(
height: 8,
),
AppText(
'Invoice No:${patientsProv.patientRadiologyList[index].invoiceNo}',
fontSize: 2 *
SizeConfig
.textMultiplier,
),
SizedBox(
height: 8,
),
AppText(
' ${patientsProv.patientRadiologyList[index].clinicName}',
fontSize: 2 *
SizeConfig
.textMultiplier,
color: Theme.of(context)
.primaryColor,
),
SizedBox(
height: 8,
),
],
),
),
)
],
),
],
),
), ),
); ),
}), )
), ],
),
],
), ),
),
);
}),
),
),
); );
} }
} }

@ -82,4 +82,14 @@ class DrAppSharedPreferances {
} }
return json.decode(string); return json.decode(string);
} }
clear() async {
final SharedPreferences prefs = await _prefs;
prefs.clear();
}
remove(String key) async {
final SharedPreferences prefs = await _prefs;
prefs.remove(key);
}
} }

@ -1,12 +1,16 @@
import 'package:doctor_app_flutter/models/list_doctor_working_hours_table_model.dart'; import 'package:doctor_app_flutter/models/list_doctor_working_hours_table_model.dart';
import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:doctor_app_flutter/config/config.dart';
import '../config/size_config.dart'; import '../config/size_config.dart';
import '../util/dr_app_toast_msg.dart'; import '../util/dr_app_toast_msg.dart';
import 'package:connectivity/connectivity.dart'; import 'package:connectivity/connectivity.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
/* /*
*@author: Elham Rababah *@author: Elham Rababah
@ -48,10 +52,6 @@ class Helpers {
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
}, },
// padding: const EdgeInsets.symmetric(
// horizontal: 16.0,
// vertical: 5.0,
// ),
), ),
CupertinoButton( CupertinoButton(
child: Text( child: Text(
@ -97,7 +97,7 @@ class Helpers {
children: items.map((item) { children: items.map((item) {
return Text( return Text(
'${item["$decKey"]}', '${item["$decKey"]}',
style: TextStyle(fontSize: SizeConfig.textMultiplier * 3), style: TextStyle(fontSize: SizeConfig.textMultiplier * 2),
); );
}).toList(), }).toList(),
@ -164,14 +164,15 @@ class Helpers {
), ),
); );
} }
/*
/*
*@author: Amjad Amireh *@author: Amjad Amireh
*@Date:5/5/2020 *@Date:5/5/2020
*@param: checkDate *@param: checkDate
*@return: DateTime *@return: DateTime
*@desc: convert String to DateTime *@desc: convert String to DateTime
*/ */
static String checkDate(String dateString) { static String checkDate(String dateString) {
DateTime checkedTime = DateTime.parse(dateString); DateTime checkedTime = DateTime.parse(dateString);
DateTime currentTime = DateTime.now(); DateTime currentTime = DateTime.now();
@ -257,6 +258,7 @@ static String checkDate(String dateString) {
return "Sunday"; return "Sunday";
} }
} }
/* /*
*@author: Mohammad Aljammal *@author: Mohammad Aljammal
*@Date:26/5/2020 *@Date:26/5/2020
@ -275,6 +277,7 @@ static String checkDate(String dateString) {
else else
return ""; return "";
} }
/* /*
*@author: Mohammad Aljammal *@author: Mohammad Aljammal
*@Date:26/5/2020 *@Date:26/5/2020
@ -301,13 +304,14 @@ static String checkDate(String dateString) {
*@return: List<WorkingHours> *@return: List<WorkingHours>
*@desc: convert workingHours string to List<WorkingHours> *@desc: convert workingHours string to List<WorkingHours>
*/ */
static List<WorkingHours> getWorkingHours(String workingHours ){ static List<WorkingHours> getWorkingHours(String workingHours) {
List<WorkingHours> myWorkingHours =[]; List<WorkingHours> myWorkingHours = [];
List<String> listOfHours = workingHours.split('a'); List<String> listOfHours = workingHours.split('a');
listOfHours.forEach((element) { listOfHours.forEach((element) {
WorkingHours workingHours = WorkingHours(); WorkingHours workingHours = WorkingHours();
var from = element.substring(element.indexOf('m ') + 2 , element.indexOf('To')-2); var from = element.substring(
element.indexOf('m ') + 2, element.indexOf('To') - 2);
workingHours.from = from.trim(); workingHours.from = from.trim();
var to = element.substring(element.indexOf('To') + 2); var to = element.substring(element.indexOf('To') + 2);
workingHours.to = to.trim(); workingHours.to = to.trim();
@ -316,9 +320,6 @@ static String checkDate(String dateString) {
return myWorkingHours; return myWorkingHours;
} }
/* /*
*@author: Elham Rababah *@author: Elham Rababah
*@Date:12/5/2020 *@Date:12/5/2020
@ -333,4 +334,13 @@ static String checkDate(String dateString) {
} }
return localMsg; return localMsg;
} }
clearSharedPref() async {
await sharedPref.clear();
}
logout() async {
await clearSharedPref();
Navigator.of(AppGlobal.CONTEX).pushReplacementNamed(LOGIN);
}
} }

@ -69,6 +69,17 @@ class _LoginFormState extends State<LoginForm> {
_isInit = false; _isInit = false;
} }
@override
void didChangeDependencies() {
super.didChangeDependencies();
if (_isInit) {
if (projectsList.length == 0) {
getProjectsList();
}
}
_isInit = false;
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final focusPass = FocusNode(); final focusPass = FocusNode();
@ -99,8 +110,9 @@ class _LoginFormState extends State<LoginForm> {
userInfo.UserID = value.trim(); userInfo.UserID = value.trim();
}, },
onFieldSubmitted: (_) { onFieldSubmitted: (_) {
FocusScope.of(context).requestFocus(focusPass); FocusScope.of(context).nextFocus();
}, },
autofocus: false,
), ),
buildSizedBox(), buildSizedBox(),
TextFormField( TextFormField(
@ -119,7 +131,7 @@ class _LoginFormState extends State<LoginForm> {
userInfo.Password = value; userInfo.Password = value;
}, },
onFieldSubmitted: (_) { onFieldSubmitted: (_) {
FocusScope.of(context).requestFocus(focusProject); FocusScope.of(context).nextFocus();
helpers.showCupertinoPicker( helpers.showCupertinoPicker(
context, projectsList, 'Name', onSelectProject); context, projectsList, 'Name', onSelectProject);
}, },
@ -144,22 +156,8 @@ class _LoginFormState extends State<LoginForm> {
}), }),
buildSizedBox(), buildSizedBox(),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[ children: <Widget>[
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Checkbox(
value: true,
activeColor: Theme.of(context).primaryColor,
onChanged: (bool newValue) {}),
Text("Remember me",
style: TextStyle(
fontSize: 2 * SizeConfig.textMultiplier)),
],
),
),
RaisedButton( RaisedButton(
onPressed: () { onPressed: () {
login(context, authProv, widget.changeLoadingStata); login(context, authProv, widget.changeLoadingStata);
@ -204,17 +202,26 @@ class _LoginFormState extends State<LoginForm> {
*/ */
InputDecoration buildInputDecoration(BuildContext context, hint, asset) { InputDecoration buildInputDecoration(BuildContext context, hint, asset) {
return InputDecoration( return InputDecoration(
prefixIcon: Image.asset(asset), prefixIcon: Image.asset(asset),
hintText: hint, hintText: hint,
hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier), hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(20)), borderRadius: BorderRadius.all(Radius.circular(20)),
borderSide: BorderSide(color: Hexcolor('#CCCCCC')), borderSide: BorderSide(color: Hexcolor('#CCCCCC')),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)), borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Theme.of(context).primaryColor), borderSide: BorderSide(color: Theme.of(context).primaryColor),
)); ),
errorBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Theme.of(context).errorColor),
),
focusedErrorBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Theme.of(context).errorColor),
),
);
} }
SizedBox buildSizedBox() { SizedBox buildSizedBox() {
@ -224,6 +231,11 @@ class _LoginFormState extends State<LoginForm> {
} }
login(context, AuthProvider authProv, Function changeLoadingStata) { login(context, AuthProvider authProv, Function changeLoadingStata) {
FocusScopeNode currentFocus = FocusScope.of(context);
// if (!currentFocus.hasPrimaryFocus) {
// currentFocus.unfocus();
// }
changeLoadingStata(true); changeLoadingStata(true);
if (loginFormKey.currentState.validate()) { if (loginFormKey.currentState.validate()) {
loginFormKey.currentState.save(); loginFormKey.currentState.save();
@ -237,7 +249,7 @@ class _LoginFormState extends State<LoginForm> {
sharedPref.setString(TOKEN, res['LogInTokenID']); sharedPref.setString(TOKEN, res['LogInTokenID']);
print("token" + res['LogInTokenID']); print("token" + res['LogInTokenID']);
Navigator.of(context).pushNamed(VERIFICATION_METHODS); Navigator.of(context).pushReplacementNamed(VERIFICATION_METHODS);
} else { } else {
// handel error // handel error
// widget.showCenterShortLoadingToast("watting"); // widget.showCenterShortLoadingToast("watting");
@ -247,7 +259,7 @@ class _LoginFormState extends State<LoginForm> {
}).catchError((err) { }).catchError((err) {
print('$err'); print('$err');
changeLoadingStata(false); changeLoadingStata(false);
helpers.showErrorToast(); helpers.showErrorToast(err);
}); });
} else { } else {
changeLoadingStata(false); changeLoadingStata(false);
@ -295,7 +307,7 @@ class _LoginFormState extends State<LoginForm> {
// Platform messages may fail, so we use a try/catch PlatformException. // Platform messages may fail, so we use a try/catch PlatformException.
try { try {
platformImei = platformImei =
await ImeiPlugin.getImei(shouldShowRequestPermissionRationale: false); await ImeiPlugin.getImei(shouldShowRequestPermissionRationale: false);
idunique = await ImeiPlugin.getId(); idunique = await ImeiPlugin.getId();
} on PlatformException { } on PlatformException {
platformImei = 'Failed to get platform version.'; platformImei = 'Failed to get platform version.';

@ -257,16 +257,25 @@ class _VerifyAccountState extends State<VerifyAccount> {
*/ */
InputDecoration buildInputDecoration(BuildContext context) { InputDecoration buildInputDecoration(BuildContext context) {
return InputDecoration( return InputDecoration(
// ts/images/password_icon.png // ts/images/password_icon.png
contentPadding: EdgeInsets.only(top: 30, bottom: 30), contentPadding: EdgeInsets.only(top: 30, bottom: 30),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10)), borderRadius: BorderRadius.all(Radius.circular(10)),
borderSide: BorderSide(color: Colors.black), borderSide: BorderSide(color: Colors.black),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)), borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Theme.of(context).primaryColor), borderSide: BorderSide(color: Theme.of(context).primaryColor),
)); ),
errorBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Theme.of(context).errorColor),
),
focusedErrorBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Theme.of(context).errorColor),
),
);
} }
/* /*
@ -325,7 +334,7 @@ class _VerifyAccountState extends State<VerifyAccount> {
verifyAccountFormValue['digit4']; verifyAccountFormValue['digit4'];
print(activationCode); print(activationCode);
int projectID = await sharedPref.getInt(PROJECT_ID); int projectID = await sharedPref.getInt(PROJECT_ID);
Map<String,dynamic> model = { Map<String, dynamic> model = {
"activationCode": activationCode, "activationCode": activationCode,
"DoctorID": _loggedUser['DoctorID'], "DoctorID": _loggedUser['DoctorID'],
"LogInTokenID": _loggedUser['LogInTokenID'], "LogInTokenID": _loggedUser['LogInTokenID'],
@ -384,7 +393,7 @@ class _VerifyAccountState extends State<VerifyAccount> {
Map<String, dynamic> profile, Function changeLoadingStata) { Map<String, dynamic> profile, Function changeLoadingStata) {
changeLoadingStata(false); changeLoadingStata(false);
sharedPref.setObj(DOCTOR_PROFILE, profile); sharedPref.setObj(DOCTOR_PROFILE, profile);
Navigator.of(context).pushNamed(HOME); Navigator.of(context).pushReplacementNamed(HOME);
} }
Future<dynamic> _asyncSimpleDialog( Future<dynamic> _asyncSimpleDialog(

@ -50,7 +50,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
super.didChangeDependencies(); super.didChangeDependencies();
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
verificationMethod = verificationMethod =
routeArgs != null ? routeArgs['verificationMethod'] : null; routeArgs != null ? routeArgs['verificationMethod'] : null;
} }
@override @override
@ -101,17 +101,17 @@ class _VerificationMethodsState extends State<VerificationMethods> {
child: buildFingerprintMethod( child: buildFingerprintMethod(
context, authProv), context, authProv),
replacement: replacement:
buildWhatsAppMethod(context, authProv), buildWhatsAppMethod(context, authProv),
), ),
Visibility( Visibility(
visible: hideSilentMethods() ? false : true, visible: hideSilentMethods() ? false : true,
child: buildFaceIDMethod(context, authProv), child: buildFaceIDMethod(context, authProv),
replacement: replacement:
buildSMSMethod(context, authProv), buildSMSMethod(context, authProv),
), ),
Visibility( Visibility(
visible: visible:
hideSilentMethods() ? false : true, hideSilentMethods() ? false : true,
child: buildWhatsAppMethod( child: buildWhatsAppMethod(
context, authProv)), context, authProv)),
Visibility( Visibility(
@ -126,8 +126,8 @@ class _VerificationMethodsState extends State<VerificationMethods> {
// height: 500, // height: 500,
), ),
SizedBox( SizedBox(
// height: 20, // height: 20,
) )
], ],
), ),
); );
@ -136,7 +136,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
}); });
} }
/* /*
*@author: Elham Rababah *@author: Elham Rababah
*@Date:28/5/2020 *@Date:28/5/2020
*@param: BuildContext context, AuthProvider authProv *@param: BuildContext context, AuthProvider authProv
@ -149,7 +149,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
sendActivationCodeByOtpNotificationType(1, authProv); sendActivationCodeByOtpNotificationType(1, authProv);
}); });
} }
/* /*
*@author: Elham Rababah *@author: Elham Rababah
*@Date:28/5/2020 *@Date:28/5/2020
*@param: BuildContext context, AuthProvider authProv *@param: BuildContext context, AuthProvider authProv
@ -159,9 +159,9 @@ class _VerificationMethodsState extends State<VerificationMethods> {
Center buildWhatsAppMethod(BuildContext context, AuthProvider authProv) { Center buildWhatsAppMethod(BuildContext context, AuthProvider authProv) {
return buildVerificationMethod( return buildVerificationMethod(
context, 'assets/images/verification_whatsapp_icon.png', 'WhatsApp', context, 'assets/images/verification_whatsapp_icon.png', 'WhatsApp',
() { () {
sendActivationCodeByOtpNotificationType(2, authProv); sendActivationCodeByOtpNotificationType(2, authProv);
}); });
} }
/* /*
*@author: Elham Rababah *@author: Elham Rababah
@ -186,8 +186,8 @@ class _VerificationMethodsState extends State<VerificationMethods> {
Center buildFingerprintMethod(BuildContext context, AuthProvider authProv) { Center buildFingerprintMethod(BuildContext context, AuthProvider authProv) {
return buildVerificationMethod(context, return buildVerificationMethod(context,
'assets/images/verification_fingerprint_icon.png', 'Fingerprint', () { 'assets/images/verification_fingerprint_icon.png', 'Fingerprint', () {
sendActivationCodeByOtpNotificationType(4, authProv); sendActivationCodeByOtpNotificationType(4, authProv);
}); });
} }
/* /*
@ -212,7 +212,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
width: 1, width: 1,
color: Hexcolor( color: Hexcolor(
'#CCCCCC') // <--- border width here '#CCCCCC') // <--- border width here
), ),
borderRadius: BorderRadius.all(Radius.circular(10))), borderRadius: BorderRadius.all(Radius.circular(10))),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
@ -251,11 +251,12 @@ class _VerificationMethodsState extends State<VerificationMethods> {
*@desc: send Activation Code By Otp Notification Type *@desc: send Activation Code By Otp Notification Type
*/ */
sendActivationCodeByOtpNotificationType(oTPSendType, AuthProvider authProv) { sendActivationCodeByOtpNotificationType(oTPSendType, AuthProvider authProv) {
// TODO : build enum for verfication method // TODO : build enum for verfication method
if (oTPSendType == 1 || oTPSendType == 2) { if (oTPSendType == 1 || oTPSendType == 2) {
widget.changeLoadingStata(true); widget.changeLoadingStata(true);
Map model = { Map<String,dynamic> model = {
"LogInTokenID": _loggedUser['LogInTokenID'], "LogInTokenID": _loggedUser['LogInTokenID'],
"Channel": 9, "Channel": 9,
"MobileNumber": _loggedUser['MobileNumber'], "MobileNumber": _loggedUser['MobileNumber'],
@ -270,7 +271,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
widget.changeLoadingStata(false); widget.changeLoadingStata(false);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
Navigator.of(context).pushNamed(VERIFY_ACCOUNT, arguments: {'model':model}); Navigator.of(context).pushReplacementNamed(VERIFY_ACCOUNT, arguments: {'model':model});
} else { } else {
print(res['ErrorEndUserMessage']); print(res['ErrorEndUserMessage']);
helpers.showErrorToast(res['ErrorEndUserMessage']); helpers.showErrorToast(res['ErrorEndUserMessage']);

@ -42,269 +42,277 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Row( InkWell(
mainAxisAlignment: MainAxisAlignment.spaceBetween, onTap: () {
children: <Widget>[ setState(() {
AppText( _showDetails = !_showDetails;
'${widget.myReferralPatientModel.firstName} ${widget.myReferralPatientModel.lastName}', });
fontSize: 2.5 * SizeConfig.textMultiplier, },
fontWeight: FontWeight.bold, child: Row(
), mainAxisAlignment: MainAxisAlignment.spaceBetween,
InkWell( children: <Widget>[
onTap: () { AppText(
setState(() { '${widget.myReferralPatientModel.firstName} ${widget.myReferralPatientModel.lastName}',
_showDetails = !_showDetails; fontSize: 2.5 * SizeConfig.textMultiplier,
}); fontWeight: FontWeight.bold,
}, ),
child: Icon(_showDetails Icon(_showDetails
? Icons.keyboard_arrow_up ? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down)), : Icons.keyboard_arrow_down),
],
],
),
), ),
!_showDetails !_showDetails
? Container() ? Container()
: AnimatedContainer( : AnimatedContainer(
duration: Duration(milliseconds: 200), duration: Duration(milliseconds: 200),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
SizedBox(height: 5,), SizedBox(height: 5,),
Divider(color: Color(0xFF000000),height: 0.5,), Divider(color: Color(0xFF000000),height: 0.5,),
Table( Table(
border: TableBorder.symmetric(inside: BorderSide(width: 0.5),), border: TableBorder.symmetric(inside: BorderSide(width: 0.5),),
children: [
TableRow(
children: [ children: [
TableRow( Container(
children: [ margin: EdgeInsets.all(2.5),
Container( padding: EdgeInsets.all(5),
margin: EdgeInsets.all(2.5), child: Column(
padding: EdgeInsets.all(5), crossAxisAlignment: CrossAxisAlignment.start,
child: Column( children: <Widget>[
crossAxisAlignment: CrossAxisAlignment.start, AppText(
children: <Widget>[ 'File No',
AppText( fontSize:
'File No', 1.7 * SizeConfig.textMultiplier,
fontSize: fontWeight: FontWeight.bold,
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
'${widget.myReferralPatientModel.referringDoctor}',
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
), ),
), SizedBox(height: 5,),
Container( AppText(
margin: EdgeInsets.only(left: 4,top: 2.5,right: 2.5,bottom: 2.5), '${widget.myReferralPatientModel.referringDoctor}',
padding: EdgeInsets.all(5), fontSize:
child: Column( 1.7 * SizeConfig.textMultiplier,
crossAxisAlignment: CrossAxisAlignment.start, fontWeight: FontWeight.w300,
children: <Widget>[ )
AppText( ],
'Referring Doctor', ),
fontSize: ),
1.7 * SizeConfig.textMultiplier, Container(
fontWeight: FontWeight.bold, margin: EdgeInsets.only(left: 4,top: 2.5,right: 2.5,bottom: 2.5),
), padding: EdgeInsets.all(5),
AppText( child: Column(
widget.myReferralPatientModel crossAxisAlignment: CrossAxisAlignment.start,
.referringClinicDescription, children: <Widget>[
fontSize: AppText(
1.7 * SizeConfig.textMultiplier, 'Referring Doctor',
fontWeight: FontWeight.w300, fontSize:
) 1.7 * SizeConfig.textMultiplier,
], fontWeight: FontWeight.bold,
), ),
), SizedBox(height: 5,),
] AppText(
widget.myReferralPatientModel
.referringClinicDescription,
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
), ),
TableRow( ]
children: [ ),
Container( TableRow(
margin: EdgeInsets.all(2.5), children: [
padding: EdgeInsets.all(5), Container(
child: Column( margin: EdgeInsets.all(2.5),
crossAxisAlignment: padding: EdgeInsets.all(5),
CrossAxisAlignment.start, child: Column(
children: <Widget>[ crossAxisAlignment:
AppText( CrossAxisAlignment.start,
'Referring Clinic', children: <Widget>[
fontSize: AppText(
1.7 * SizeConfig.textMultiplier, 'Referring Clinic',
fontWeight: FontWeight.bold, fontSize:
), 1.7 * SizeConfig.textMultiplier,
AppText( fontWeight: FontWeight.bold,
'${widget.myReferralPatientModel.referringClinicDescription}',
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
), ),
Container( SizedBox(height: 5,),
margin: EdgeInsets.only(left: 4,top: 2.5,right: 2.5,bottom: 2.5), AppText(
padding: EdgeInsets.all(5), '${widget.myReferralPatientModel.referringClinicDescription}',
child: Column( fontSize:
crossAxisAlignment: 1.7 * SizeConfig.textMultiplier,
CrossAxisAlignment.start, fontWeight: FontWeight.w300,
children: <Widget>[
AppText(
'Frequency',
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
widget.myReferralPatientModel
.frequencyDescription,
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
) )
] ],
),
), ),
TableRow( Container(
children: [ margin: EdgeInsets.only(left: 4,top: 2.5,right: 2.5,bottom: 2.5),
Container( padding: EdgeInsets.all(5),
margin: EdgeInsets.all(2.5), child: Column(
padding: EdgeInsets.all(5), crossAxisAlignment:
child: Column( CrossAxisAlignment.start,
crossAxisAlignment: children: <Widget>[
CrossAxisAlignment.start, AppText(
children: <Widget>[ 'Frequency',
AppText( fontSize:
'Priority', 1.7 * SizeConfig.textMultiplier,
fontSize: fontWeight: FontWeight.bold,
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
'${widget.myReferralPatientModel.priorityDescription}',
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
), ),
SizedBox(height: 5,),
AppText(
widget.myReferralPatientModel
.frequencyDescription,
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
)
]
),
TableRow(
children: [
Container(
margin: EdgeInsets.all(2.5),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
'Priority',
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
), ),
Container( SizedBox(height: 5,),
margin: EdgeInsets.only(left: 4,top: 2.5,right: 2.5,bottom: 2.5), AppText(
padding: EdgeInsets.all(5), '${widget.myReferralPatientModel.priorityDescription}',
child: Column( fontSize:
crossAxisAlignment: 1.7 * SizeConfig.textMultiplier,
CrossAxisAlignment.start, fontWeight: FontWeight.w300,
children: <Widget>[
AppText(
'Max Response Time',
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
Helpers.getDateFormatted(widget
.myReferralPatientModel
.mAXResponseTime),
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
) )
], ],
), ),
),
Container(
margin: EdgeInsets.only(left: 4,top: 2.5,right: 2.5,bottom: 2.5),
padding: EdgeInsets.all(5),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
'Max Response Time',
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
SizedBox(height: 5,),
AppText(
Helpers.getDateFormatted(widget
.myReferralPatientModel
.mAXResponseTime),
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
)
],
),
], ],
), ),
Divider(color: Color(0xFF000000),height: 0.5,), Divider(color: Color(0xFF000000),height: 0.5,),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
'Clinic Details and Remarks', 'Clinic Details and Remarks',
fontSize: 1.7 * SizeConfig.textMultiplier, fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
textAlign: TextAlign.start,), textAlign: TextAlign.start,),
Texts( Texts(
'${widget.myReferralPatientModel.referringDoctorRemarks}', '${widget.myReferralPatientModel.referringDoctorRemarks}',
style: "bodyText1", style: "bodyText1",
readMore: true, readMore: true,
textAlign: TextAlign.start,
maxLength: 100)
],
),
SizedBox(
height: 5,
),
AppText(
'Answer/Suggestions',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start, textAlign: TextAlign.start,
), maxLength: 100)
SizedBox( ],
height: 5, ),
), SizedBox(
Form( height: 5,
key: _formKey, ),
child: TextFields( AppText(
maxLines: 2, 'Answer/Suggestions',
minLines: 2, fontSize: 1.7 * SizeConfig.textMultiplier,
hintText: 'Answer the patient', fontWeight: FontWeight.bold,
fontWeight: FontWeight.normal, textAlign: TextAlign.start,
initialValue: widget.myReferralPatientModel.referredDoctorRemarks ?? '', ),
readOnly: _isLoading, SizedBox(
validator: (value) { height: 5,
if (value.isEmpty) ),
return "please enter answer"; Form(
else key: _formKey,
return null; child: TextFields(
}, maxLines: 2,
), minLines: 2,
), hintText: 'Answer the patient',
SizedBox(height: 10.0), fontWeight: FontWeight.normal,
SizedBox(height: 10.0), initialValue: widget.myReferralPatientModel.referredDoctorRemarks ?? '',
Container( readOnly: _isLoading,
width: double.infinity, validator: (value) {
margin: EdgeInsets.only(left: 10,right: 10), if (value.isEmpty)
child: Button( return "please enter answer";
onTap: () async { else
final form = _formKey.currentState; return null;
if (form.validate()) { },
setState(() { ),
_isLoading = true; ),
}); SizedBox(height: 10.0),
try { SizedBox(height: 10.0),
await Provider.of<MyReferralPatientProvider>(context, listen: false).replay(answerController.text.toString(), widget.myReferralPatientModel); Container(
setState(() { width: double.infinity,
_isLoading = false; margin: EdgeInsets.only(left: 10,right: 10),
}); child: Button(
DrAppToastMsg.showSuccesToast('Reply Successfully'); onTap: () async {
final form = _formKey.currentState;
if (form.validate()) {
setState(() {
_isLoading = true;
});
try {
await Provider.of<MyReferralPatientProvider>(context, listen: false).replay(answerController.text.toString(), widget.myReferralPatientModel);
setState(() {
_isLoading = false;
});
DrAppToastMsg.showSuccesToast('Reply Successfully');
} catch (e) { } catch (e) {
setState(() { setState(() {
_isLoading = false; _isLoading = false;
}); });
DrAppToastMsg.showErrorToast(e); DrAppToastMsg.showErrorToast(e);
} }
} }
}, },
title: 'Reply', title: 'Reply',
loading: _isLoading, loading: _isLoading,
),
)
],
), ),
) )
],
),
)
], ],
), ),
), ),

@ -54,6 +54,8 @@ class LargeAvatar extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var vlr = name;
var asd;
return InkWell( return InkWell(
onTap: disableProfileView onTap: disableProfileView
? null ? null

@ -74,7 +74,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
child: PatientProfileButton( child: PatientProfileButton(
key: key, key: key,
patient: patient, patient: patient,
route: PRESCRIPTIONS, route: REFER_PATIENT,
name: 'Refer Patient', name: 'Refer Patient',
icon: 'note.png')), icon: 'note.png')),
Visibility( Visibility(

@ -1,13 +1,8 @@
import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/widgets/shared/profile_image_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import '../../config/size_config.dart';
import '../../presentation/doctor_app_icons.dart'; import '../../presentation/doctor_app_icons.dart';
import '../../widgets/shared/app_drawer_widget.dart';
import '../../widgets/shared/app_loader_widget.dart'; import '../../widgets/shared/app_loader_widget.dart';
import '../../widgets/shared/custom_shape_clipper.dart';
class AppScaffold extends StatelessWidget { class AppScaffold extends StatelessWidget {
String appBarTitle; String appBarTitle;

Loading…
Cancel
Save