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";
@ -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,57 +34,75 @@ 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;
@ -94,12 +116,16 @@ class AuthProvider with ChangeNotifier {
*@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 {
localRes= response;
},
onFailure: (String error, int statusCode) {
throw error; throw error;
// print('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;
@ -65,26 +63,21 @@ class PatientsProvider with ChangeNotifier {
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 = true; isError = false;
error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; this.error = '';
} }, onFailure: (String error, int statusCode) {
}
} else {
isLoading = false; isLoading = false;
isError = true; isError = true;
error = 'Please Check The Internet Connection'; this.error = error;
} }, body: patient);
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 = true; isError = false;
error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; this.error = '';
} }, onFailure: (String error, int statusCode) {
}
} else {
isLoading = false; isLoading = false;
isError = true; isError = true;
error = 'Please Check The Internet Connection'; this.error = error;
} }, body: patient);
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 = true; isError = false;
error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; this.error = '';
} }, onFailure: (String error, int statusCode) {
}
} else {
isLoading = false; isLoading = false;
isError = true; isError = true;
error = 'Please Check The Internet Connection'; this.error = error;
} }, body: patient);
notifyListeners(); notifyListeners();
} catch (err) { } catch (err) {
handelCatchErrorCase(err); handelCatchErrorCase(err);
@ -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 = true; isError = false;
error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; this.error = '';
} }, onFailure: (String error, int statusCode) {
}
} else {
isLoading = false; isLoading = false;
isError = true; isError = true;
error = 'Please Check The Internet Connection'; this.error = error;
} }, body: patient);
notifyListeners(); notifyListeners();
} catch (err) { } catch (err) {
handelCatchErrorCase(err); handelCatchErrorCase(err);
@ -407,31 +348,17 @@ class PatientsProvider with ChangeNotifier {
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;
if (statusCode < 200 || statusCode >= 400 || json == null) { this.error = '';
isError = true; }, onFailure: (String error, int statusCode) {
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;
error = res['ErrorMessage'] ?? res['ErrorEndUserMessage'];
}
}
} else {
isLoading = false; isLoading = false;
isError = true; isError = true;
error = 'Please Check The Internet Connection'; this.error = error;
} }, body: patient);
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;
if (statusCode < 200 || statusCode >= 400 || json == null) { this.error = '';
isError = true; }, onFailure: (String error, int statusCode) {
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;
error = res['ErrorMessage'] ?? res['ErrorEndUserMessage'];
}
}
} else {
isLoading = false; isLoading = false;
isError = true; isError = true;
error = 'Please Check The Internet Connection'; this.error = error;
} }, body: patient);
notifyListeners(); notifyListeners();
} catch (err) { } catch (err) {
handelCatchErrorCase(err); handelCatchErrorCase(err);
@ -480,45 +394,23 @@ 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.projectID = projectID;
_doctorsByClinicIdRequest.clinicID = clinicId; _doctorsByClinicIdRequest.clinicID = clinicId;
_doctorsByClinicIdRequest.tokenID = token; await BaseAppClient.post(PATIENT_GET_DOCTOR_BY_CLINIC_URL,
onSuccess: (dynamic response, int statusCode) {
final response = await AppClient.post(PATIENT_GET_DOCTOR_BY_CLINIC_URL, doctorsList = response['List_Doctors_All'];
body: json.encode(_doctorsByClinicIdRequest));
final int statusCode = response.statusCode;
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;
error = res['ErrorMessage'] ?? res['ErrorEndUserMessage'];
isLoading = false; isLoading = false;
} isError = false;
} this.error = '';
} else { }, onFailure: (String error, int statusCode) {
isLoading = false; isLoading = false;
isError = true; isError = true;
error = 'Please Check The Internet Connection'; this.error = error;
} }, body: _doctorsByClinicIdRequest.toJson());
notifyListeners(); notifyListeners();
} catch (err) { } catch (err) {
handelCatchErrorCase(err); handelCatchErrorCase(err);
isLoading = false;
} }
} }
@ -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;
final response = await AppClient.post(PATIENT_GET_CLINIC_BY_PROJECT_URL,
body: json.encode(_clinicByProjectIdRequest));
final int statusCode = response.statusCode;
isLoading = false; isLoading = false;
isError = false;
if (statusCode < 200 || statusCode >= 400 || json == null) { this.error = '';
isError = true; }, onFailure: (String error, int statusCode) {
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;
error = res['ErrorMessage'] ?? res['ErrorEndUserMessage'];
}
}
} else {
isLoading = false; isLoading = false;
isError = true; isError = true;
error = 'Please Check The Internet Connection'; this.error = error;
} }, body: _clinicByProjectIdRequest.toJson());
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));
final int statusCode = response.statusCode;
isLoading = false; isLoading = false;
if (statusCode < 200 || statusCode >= 400 || json == null) { isError = false;
isError = true; this.error = '';
error = 'Error While Fetching data'; }, onFailure: (String error, int statusCode) {
} else {
var res = json.decode(response.body);
print('$res');
if (res['MessageStatus'] == 1) {
referalFrequancyList = res['list_STPReferralFrequency'];
} else {
isError = true;
error = res['ErrorMessage'] ?? res['ErrorEndUserMessage'];
}
}
} else {
isLoading = false; isLoading = false;
isError = true; isError = true;
error = 'Please Check The Internet Connection'; this.error = error;
} }, body: _referralFrequencyRequest.toJson());
notifyListeners(); notifyListeners();
} catch (err) { } catch (err) {
handelCatchErrorCase(err); handelCatchErrorCase(err);

@ -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;
@ -159,9 +160,9 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
} else { } else {
setState(() { setState(() {
isError = true; isError = true;
error = 'No patient';
isLoading = false; isLoading = false;
}); });
DrAppToastMsg.showErrorToast('No patient');
} }
break; break;
case "1": case "1":
@ -176,21 +177,28 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
}); });
} else { } else {
setState(() { setState(() {
error = 'No patient';
isError = true; isError = true;
isLoading = false; isLoading = false;
}); });
DrAppToastMsg.showErrorToast('No patient');
break; break;
} }
} }
} else { } else {
setState(() { setState(() {
error = response['ErrorEndUserMessage'] ?? response['ErrorMessage'] ;
isLoading = false; isLoading = false;
isError = true; isError = true;
}); });
DrAppToastMsg.showErrorToast(response['ErrorEndUserMessage'] ?? response['ErrorMessage']);
} }
}).catchError((error){
setState(() {
isLoading = false;
});
helpers.showErrorToast(error);
//DrAppToastMsg.showErrorToast(error);
}); });
} }
// } // }
} }

@ -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,

@ -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,12 +108,12 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
style: TextStyle( style: TextStyle(
color: Theme.of(context).errorColor), color: Theme.of(context).errorColor),
), ),
):ListView.builder( )
: ListView.builder(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
shrinkWrap: true, shrinkWrap: true,
itemCount: data == null ? 0 : data.length, itemCount: data == null ? 0 : data.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return InkWell( return InkWell(
child: MedicineItemWidget( child: MedicineItemWidget(
label: data[index]["ItemDescription"], label: data[index]["ItemDescription"],
@ -119,7 +123,8 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => ChangeNotifierProvider( builder: (context) =>
ChangeNotifierProvider(
create: (_) => MedicineProvider(), create: (_) => MedicineProvider(),
child: PharmaciesListScreen( child: PharmaciesListScreen(
itemID: data[index]["ItemID"], url: data[index]["ProductImageBase64"]), itemID: data[index]["ItemID"], url: data[index]["ProductImageBase64"]),

@ -132,10 +132,6 @@ class _RadiologyScreenState extends State<RadiologyScreen> {
url: patientsProv url: patientsProv
.patientRadiologyList[index] .patientRadiologyList[index]
.doctorImageURL, .doctorImageURL,
name: patientsProv
.patientLabResultOrdersList[
index]
.doctorName,
), ),
Expanded( Expanded(
child: Padding( child: Padding(

@ -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,6 +164,7 @@ class Helpers {
), ),
); );
} }
/* /*
*@author: Amjad Amireh *@author: Amjad Amireh
*@Date:5/5/2020 *@Date:5/5/2020
@ -171,7 +172,7 @@ class Helpers {
*@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>[
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ 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);
@ -214,7 +212,16 @@ class _LoginFormState extends State<LoginForm> {
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);

@ -266,7 +266,16 @@ class _VerifyAccountState extends State<VerifyAccount> {
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(

@ -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,7 +42,13 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Row( InkWell(
onTap: () {
setState(() {
_showDetails = !_showDetails;
});
},
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
AppText( AppText(
@ -50,17 +56,13 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
fontSize: 2.5 * SizeConfig.textMultiplier, fontSize: 2.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
InkWell( Icon(_showDetails
onTap: () {
setState(() {
_showDetails = !_showDetails;
});
},
child: Icon(_showDetails
? Icons.keyboard_arrow_up ? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down)), : Icons.keyboard_arrow_down),
], ],
), ),
),
!_showDetails !_showDetails
? Container() ? Container()
: AnimatedContainer( : AnimatedContainer(
@ -87,6 +89,7 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
1.7 * SizeConfig.textMultiplier, 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
SizedBox(height: 5,),
AppText( AppText(
'${widget.myReferralPatientModel.referringDoctor}', '${widget.myReferralPatientModel.referringDoctor}',
fontSize: fontSize:
@ -108,6 +111,7 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
1.7 * SizeConfig.textMultiplier, 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
SizedBox(height: 5,),
AppText( AppText(
widget.myReferralPatientModel widget.myReferralPatientModel
.referringClinicDescription, .referringClinicDescription,
@ -135,6 +139,7 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
1.7 * SizeConfig.textMultiplier, 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
SizedBox(height: 5,),
AppText( AppText(
'${widget.myReferralPatientModel.referringClinicDescription}', '${widget.myReferralPatientModel.referringClinicDescription}',
fontSize: fontSize:
@ -157,6 +162,7 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
1.7 * SizeConfig.textMultiplier, 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
SizedBox(height: 5,),
AppText( AppText(
widget.myReferralPatientModel widget.myReferralPatientModel
.frequencyDescription, .frequencyDescription,
@ -184,6 +190,7 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
1.7 * SizeConfig.textMultiplier, 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
SizedBox(height: 5,),
AppText( AppText(
'${widget.myReferralPatientModel.priorityDescription}', '${widget.myReferralPatientModel.priorityDescription}',
fontSize: fontSize:
@ -206,6 +213,7 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
1.7 * SizeConfig.textMultiplier, 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
SizedBox(height: 5,),
AppText( AppText(
Helpers.getDateFormatted(widget Helpers.getDateFormatted(widget
.myReferralPatientModel .myReferralPatientModel

@ -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