merge ibrahim

merge-requests/111/head
Mohammad ALjammal 6 years ago
parent 80664439d9
commit 692674fac0

@ -2,10 +2,18 @@ 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/interceptor/http_interceptor.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/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:http/http.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
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();
Helpers helpers = new Helpers();
/* /*
*@author: Mohammad Aljammal *@author: Mohammad Aljammal
@ -14,6 +22,7 @@ import 'package:http/http.dart';
*@return: *@return:
*@desc: *@desc:
*/ */
///Example ///Example
/* /*
await BaseAppClient.post('', await BaseAppClient.post('',
@ -22,8 +31,6 @@ import 'package:http/http.dart';
body: null); body: null);
* */ * */
class BaseAppClient { class BaseAppClient {
static Client client = HttpInterceptor().getClient();
static post( static post(
String endPoint, { String endPoint, {
Map<String, dynamic> body, Map<String, dynamic> body,
@ -31,15 +38,21 @@ class BaseAppClient {
Function(String error, int statusCode) onFailure, Function(String error, int statusCode) onFailure,
}) async { }) async {
String url = BASE_URL + endPoint; String url = BASE_URL + endPoint;
RequestData data = RequestData(body: body,baseUrl: url,method: Method.POST);
try { try {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
if (profile != null) {
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
body['DoctorID'] = doctorProfile.doctorID; body['DoctorID'] = doctorProfile?.doctorID;
body['EditedBy'] = doctorProfile.doctorID; body['EditedBy'] = doctorProfile?.doctorID;
body['ProjectID'] = doctorProfile.projectID; body['ProjectID'] = doctorProfile?.projectID;
body['ClinicID'] = doctorProfile.clinicID; // if (!body.containsKey('ClinicID'))
body['TokenID'] = token; body['ClinicID'] = doctorProfile?.clinicID;
}
body['TokenID'] = token ?? '';
body['LanguageID'] = LANGUAGE_ID; body['LanguageID'] = LANGUAGE_ID;
body['stamp'] = STAMP; body['stamp'] = STAMP;
body['IPAdress'] = IP_ADDRESS; body['IPAdress'] = IP_ADDRESS;
@ -48,15 +61,25 @@ class BaseAppClient {
body['SessionID'] = SESSION_ID; body['SessionID'] = SESSION_ID;
body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP; body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP;
body['PatientOutSA'] = PATIENT_OUT_SA; body['PatientOutSA'] = PATIENT_OUT_SA;
print("URL : $url");
print("Body : ${json.encode(body)}");
if (await Helpers.checkConnection()) { if (await Helpers.checkConnection()) {
final response = await client.post(url, body: json.encode(body)); final response = await http.post(url,
body: json.encode(body),
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json'
});
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure('Error While Fetching data', statusCode); onFailure('Error While Fetching data', statusCode);
} else { } else {
var parsed = json.decode(response.body.toString()); var parsed = json.decode(response.body.toString());
if (parsed['MessageStatus'] == 1) { if (!parsed['IsAuthenticated']) {
Navigator.of(AppGlobal.CONTEX).pushNamed(LOGIN);
helpers.showErrorToast('Your session expired Please login agian');
} else if (parsed['MessageStatus'] == 1) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else { } else {
onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],

@ -68,3 +68,7 @@ const PATIENT_OUT_SA = false;
/// Timer Info /// Timer Info
const TIMER_MIN =10; const TIMER_MIN =10;
class AppGlobal{
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';
@ -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,20 +177,27 @@ 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);
}); });
} }
// } // }

@ -1,5 +1,6 @@
import 'dart:async'; import 'dart:async';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
@ -11,8 +12,8 @@ import '../../widgets/auth/login_form.dart';
import '../../widgets/shared/app_scaffold_widget.dart'; import '../../widgets/shared/app_scaffold_widget.dart';
import '../../widgets/shared/dr_app_circular_progress_Indeicator.dart'; import '../../widgets/shared/dr_app_circular_progress_Indeicator.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
class Loginsreen extends StatefulWidget { class Loginsreen extends StatefulWidget {
@override @override
_LoginsreenState createState() => _LoginsreenState(); _LoginsreenState createState() => _LoginsreenState();
@ -55,6 +56,7 @@ class _LoginsreenState extends State<Loginsreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
getSharedPref(); getSharedPref();
return AppScaffold( return AppScaffold(
isLoading: _isLoading, isLoading: _isLoading,

@ -15,7 +15,8 @@ class MyScheduleScreen extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
scheduleProvider = Provider.of(context); scheduleProvider = Provider.of(context);
return Scaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).mySchedule,
body: scheduleProvider.isLoading body: scheduleProvider.isLoading
? DrAppCircularProgressIndeicator() ? DrAppCircularProgressIndeicator()
: scheduleProvider.isError : scheduleProvider.isError

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

@ -36,7 +36,7 @@ class _LoginFormState extends State<LoginForm> {
String _platformImei = 'Unknown'; String _platformImei = 'Unknown';
String uniqueId = "Unknown"; String uniqueId = "Unknown";
var projectsList = []; var projectsList = [];
bool _isInit = true;
FocusNode focusPass; FocusNode focusPass;
FocusNode focusProject; FocusNode focusProject;
@ -56,14 +56,22 @@ class _LoginFormState extends State<LoginForm> {
initPlatformState(); initPlatformState();
} }
@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();
final focusProject = FocusNode(); final focusProject = FocusNode();
if (projectsList.length == 0) {
getProjectsList();
}
AuthProvider authProv = Provider.of<AuthProvider>(context); AuthProvider authProv = Provider.of<AuthProvider>(context);
return Form( return Form(
@ -89,8 +97,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(
@ -109,7 +118,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);
}, },
@ -134,22 +143,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);
@ -204,7 +199,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() {
@ -214,6 +218,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();
@ -227,7 +236,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");
@ -237,7 +246,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);

@ -191,20 +191,13 @@ class _VerifyAccountState extends State<VerifyAccount> {
validator: validateCodeDigit)) validator: validateCodeDigit))
], ],
), ),
// buildSizedBox(40),
buildSizedBox(20), buildSizedBox(20),
buildText(), buildText(),
// buildSizedBox(10.0),
// Text()
buildSizedBox(40), buildSizedBox(40),
// buildSizedBox(),
RaisedButton( RaisedButton(
onPressed: () { onPressed: () {
verifyAccount( verifyAccount(
authProv, widget.changeLoadingStata); authProv, widget.changeLoadingStata);
// Navigator.of(context).pushNamed(HOME);
}, },
elevation: 0.0, elevation: 0.0,
child: Container( child: Container(
@ -273,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),
),
);
} }
/* /*
@ -284,6 +286,16 @@ class _VerifyAccountState extends State<VerifyAccount> {
*@desc: buildText *@desc: buildText
*/ */
RichText buildText() { RichText buildText() {
String medthodName;
switch (model['OTP_SendType']) {
case 1:
medthodName = 'SMS';
break;
case 2:
medthodName = 'WhatsApp';
break;
default:
}
var text = RichText( var text = RichText(
text: new TextSpan( text: new TextSpan(
style: new TextStyle( style: new TextStyle(
@ -293,7 +305,7 @@ class _VerifyAccountState extends State<VerifyAccount> {
new TextSpan( new TextSpan(
text: 'Login Code ', text: 'Login Code ',
style: TextStyle(fontWeight: FontWeight.w700)), style: TextStyle(fontWeight: FontWeight.w700)),
new TextSpan(text: 'By SMS, Please enter the code') new TextSpan(text: 'By ${medthodName}, Please enter the code')
])); ]));
return text; return text;
} }
@ -322,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 model = { Map<String, dynamic> model = {
"activationCode": activationCode, "activationCode": activationCode,
"DoctorID": _loggedUser['DoctorID'], "DoctorID": _loggedUser['DoctorID'],
"LogInTokenID": _loggedUser['LogInTokenID'], "LogInTokenID": _loggedUser['LogInTokenID'],
@ -381,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(
@ -421,7 +433,7 @@ class _VerifyAccountState extends State<VerifyAccount> {
projectID: clinicInfo.projectID, projectID: clinicInfo.projectID,
tokenID: '', tokenID: '',
languageID: 2); languageID: 2);
authProv.getDocProfiles(docInfo).then((res) { authProv.getDocProfiles(docInfo.toJson()).then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
print("DoctorProfileList ${res['DoctorProfileList'][0]}"); print("DoctorProfileList ${res['DoctorProfileList'][0]}");
loginProcessCompleted(res['DoctorProfileList'][0], changeLoadingStata); loginProcessCompleted(res['DoctorProfileList'][0], changeLoadingStata);

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

@ -35,25 +35,27 @@ class LargeAvatar extends StatelessWidget {
), ),
), ),
); );
} else if (name == null || name.isEmpty) { } else if (name != null || name.isNotEmpty) {
return Center( return Center(
child: AppText( child: AppText(
'DR', name[0].toUpperCase(),
color: Colors.white, color: Colors.white,
fontSize: 18,
fontWeight: FontWeight.bold,
)); ));
} else { } else {
return Center( return Center(
child: AppText( child: AppText(
name[0].toUpperCase(), 'DR',
color: Colors.white, color: Colors.white,
fontSize: 18,
fontWeight: FontWeight.bold,
)); ));
} }
} }
@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

Loading…
Cancel
Save