Conflicts:
	lib/models/patient/patiant_info_model.dart
	pubspec.lock
merge-requests/65/head
her_username 6 years ago
commit 111d90d56f

@ -6,12 +6,41 @@ const ONLY_DATE = "[0-9/]";
const BASE_URL = 'https://uat.hmgwebservices.com/Services/'; const BASE_URL = 'https://uat.hmgwebservices.com/Services/';
const PHARMACY_ITEMS_URL = "Lists.svc/REST/GetPharmcyItems"; const PHARMACY_ITEMS_URL = "Lists.svc/REST/GetPharmcyItems";
const PHARMACY_LIST_URL = "Patients.svc/REST/GetPharmcyList"; const PHARMACY_LIST_URL = "Patients.svc/REST/GetPharmcyList";
const GET_PROJECTS = 'Lists.svc/REST/GetProjectForDoctorAPP';
const GET_PATIENT_VITAL_SIGN = 'Doctors.svc/REST/Doctor_GetPatientVitalSign';
const GET_PATIENT_LAB_OREDERS =
'DoctorApplication.svc/REST/GetPatientLabOreders';
const GET_PRESCRIPTION = 'Patients.svc/REST/GetPrescriptionApptList';
const GET_RADIOLOGY = 'DoctorApplication.svc/REST/GetPatientRadResult';
//*********change value to decode json from Dropdown ************ //*********change value to decode json from Dropdown ************
var SERVICES_PATIANT = ["GetMyOutPatient", "GetMyInPatient", "GtMyDischargePatient","GtMyReferredPatient","GtMyDischargeReferralPatient","GtMyTomorrowPatient","GtMyReferralPatient"]; var SERVICES_PATIANT = [
var SERVICES_PATIANT2 = ["List_MyOutPatient", "List_MyInPatient","List_MyDischargePatient" ,"List_MyReferredPatient","List_MyDischargeReferralPatient","List_MyTomorrowPatient","List_MyReferralPatient"]; "GetMyOutPatient",
var SERVICES_PATIANT_HEADER = ["OutPatient", "InPatient", "Discharge","Referred","Referral Discharge","Tomorrow","Referral"]; "GetMyInPatient",
"GtMyDischargePatient",
"GtMyReferredPatient",
"GtMyDischargeReferralPatient",
"GtMyTomorrowPatient",
"GtMyReferralPatient"
];
var SERVICES_PATIANT2 = [
"List_MyOutPatient",
"List_MyInPatient",
"List_MyDischargePatient",
"List_MyReferredPatient",
"List_MyDischargeReferralPatient",
"List_MyTomorrowPatient",
"List_MyReferralPatient"
];
var SERVICES_PATIANT_HEADER = [
"OutPatient",
"InPatient",
"Discharge",
"Referred",
"Referral Discharge",
"Tomorrow",
"Referral"
];
//****************** //******************
// Colors ////// by : ibrahim // Colors ////// by : ibrahim
const PRIMARY_COLOR = 0xff58434F; const PRIMARY_COLOR = 0xff58434F;

@ -1,4 +1,8 @@
final TOKEN = 'token'; final TOKEN = 'token';
final PROJECT_ID="projectID"; final PROJECT_ID='projectID';
final SLECTED_PATIENT_TYPE="slectedPatientType"; //===========amjad============
final APP_Language = "language"; final DOCTOR_ID='doctorID';
//=======================
final SLECTED_PATIENT_TYPE='slectedPatientType';
final APP_Language = 'language';
final DOCTOR_PROFILE = 'doctorProfile';

@ -0,0 +1,43 @@
/*
*@author: Elham Rababah
*@Date:17/5/2020
*@param:
*@return:
*@desc: Clinic Model
*/
class ClinicModel {
Null setupID;
int projectID;
int doctorID;
int clinicID;
bool isActive;
String clinicName;
ClinicModel(
{this.setupID,
this.projectID,
this.doctorID,
this.clinicID,
this.isActive,
this.clinicName});
ClinicModel.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
projectID = json['ProjectID'];
doctorID = json['DoctorID'];
clinicID = json['ClinicID'];
isActive = json['IsActive'];
clinicName = json['ClinicName'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID;
data['ProjectID'] = this.projectID;
data['DoctorID'] = this.doctorID;
data['ClinicID'] = this.clinicID;
data['IsActive'] = this.isActive;
data['ClinicName'] = this.clinicName;
return data;
}
}

@ -0,0 +1,176 @@
class DoctorProfileModel {
int doctorID;
String doctorName;
Null doctorNameN;
int clinicID;
String clinicDescription;
Null clinicDescriptionN;
Null licenseExpiry;
int employmentType;
Null setupID;
int projectID;
String projectName;
String nationalityID;
String nationalityName;
Null nationalityNameN;
int gender;
String genderDescription;
Null genderDescriptionN;
Null doctorTitle;
Null projectNameN;
bool isAllowWaitList;
String titleDescription;
Null titleDescriptionN;
Null isRegistered;
Null isDoctorDummy;
bool isActive;
Null isDoctorAppointmentDisplayed;
bool doctorClinicActive;
Null isbookingAllowed;
String doctorCases;
Null doctorPicture;
String doctorProfileInfo;
List<String> specialty;
int actualDoctorRate;
String doctorImageURL;
int doctorRate;
String doctorTitleForProfile;
bool isAppointmentAllowed;
String nationalityFlagURL;
int noOfPatientsRate;
String qR;
int serviceID;
DoctorProfileModel(
{this.doctorID,
this.doctorName,
this.doctorNameN,
this.clinicID,
this.clinicDescription,
this.clinicDescriptionN,
this.licenseExpiry,
this.employmentType,
this.setupID,
this.projectID,
this.projectName,
this.nationalityID,
this.nationalityName,
this.nationalityNameN,
this.gender,
this.genderDescription,
this.genderDescriptionN,
this.doctorTitle,
this.projectNameN,
this.isAllowWaitList,
this.titleDescription,
this.titleDescriptionN,
this.isRegistered,
this.isDoctorDummy,
this.isActive,
this.isDoctorAppointmentDisplayed,
this.doctorClinicActive,
this.isbookingAllowed,
this.doctorCases,
this.doctorPicture,
this.doctorProfileInfo,
this.specialty,
this.actualDoctorRate,
this.doctorImageURL,
this.doctorRate,
this.doctorTitleForProfile,
this.isAppointmentAllowed,
this.nationalityFlagURL,
this.noOfPatientsRate,
this.qR,
this.serviceID});
DoctorProfileModel.fromJson(Map<String, dynamic> json) {
doctorID = json['DoctorID'];
doctorName = json['DoctorName'];
doctorNameN = json['DoctorNameN'];
clinicID = json['ClinicID'];
clinicDescription = json['ClinicDescription'];
clinicDescriptionN = json['ClinicDescriptionN'];
licenseExpiry = json['LicenseExpiry'];
employmentType = json['EmploymentType'];
setupID = json['SetupID'];
projectID = json['ProjectID'];
projectName = json['ProjectName'];
nationalityID = json['NationalityID'];
nationalityName = json['NationalityName'];
nationalityNameN = json['NationalityNameN'];
gender = json['Gender'];
genderDescription = json['Gender_Description'];
genderDescriptionN = json['Gender_DescriptionN'];
doctorTitle = json['DoctorTitle'];
projectNameN = json['ProjectNameN'];
isAllowWaitList = json['IsAllowWaitList'];
titleDescription = json['Title_Description'];
titleDescriptionN = json['Title_DescriptionN'];
isRegistered = json['IsRegistered'];
isDoctorDummy = json['IsDoctorDummy'];
isActive = json['IsActive'];
isDoctorAppointmentDisplayed = json['IsDoctorAppointmentDisplayed'];
doctorClinicActive = json['DoctorClinicActive'];
isbookingAllowed = json['IsbookingAllowed'];
doctorCases = json['DoctorCases'];
doctorPicture = json['DoctorPicture'];
doctorProfileInfo = json['DoctorProfileInfo'];
specialty = json['Specialty'].cast<String>();
actualDoctorRate = json['ActualDoctorRate'];
doctorImageURL = json['DoctorImageURL'];
doctorRate = json['DoctorRate'];
doctorTitleForProfile = json['DoctorTitleForProfile'];
isAppointmentAllowed = json['IsAppointmentAllowed'];
nationalityFlagURL = json['NationalityFlagURL'];
noOfPatientsRate = json['NoOfPatientsRate'];
qR = json['QR'];
serviceID = json['ServiceID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['DoctorID'] = this.doctorID;
data['DoctorName'] = this.doctorName;
data['DoctorNameN'] = this.doctorNameN;
data['ClinicID'] = this.clinicID;
data['ClinicDescription'] = this.clinicDescription;
data['ClinicDescriptionN'] = this.clinicDescriptionN;
data['LicenseExpiry'] = this.licenseExpiry;
data['EmploymentType'] = this.employmentType;
data['SetupID'] = this.setupID;
data['ProjectID'] = this.projectID;
data['ProjectName'] = this.projectName;
data['NationalityID'] = this.nationalityID;
data['NationalityName'] = this.nationalityName;
data['NationalityNameN'] = this.nationalityNameN;
data['Gender'] = this.gender;
data['Gender_Description'] = this.genderDescription;
data['Gender_DescriptionN'] = this.genderDescriptionN;
data['DoctorTitle'] = this.doctorTitle;
data['ProjectNameN'] = this.projectNameN;
data['IsAllowWaitList'] = this.isAllowWaitList;
data['Title_Description'] = this.titleDescription;
data['Title_DescriptionN'] = this.titleDescriptionN;
data['IsRegistered'] = this.isRegistered;
data['IsDoctorDummy'] = this.isDoctorDummy;
data['IsActive'] = this.isActive;
data['IsDoctorAppointmentDisplayed'] = this.isDoctorAppointmentDisplayed;
data['DoctorClinicActive'] = this.doctorClinicActive;
data['IsbookingAllowed'] = this.isbookingAllowed;
data['DoctorCases'] = this.doctorCases;
data['DoctorPicture'] = this.doctorPicture;
data['DoctorProfileInfo'] = this.doctorProfileInfo;
data['Specialty'] = this.specialty;
data['ActualDoctorRate'] = this.actualDoctorRate;
data['DoctorImageURL'] = this.doctorImageURL;
data['DoctorRate'] = this.doctorRate;
data['DoctorTitleForProfile'] = this.doctorTitleForProfile;
data['IsAppointmentAllowed'] = this.isAppointmentAllowed;
data['NationalityFlagURL'] = this.nationalityFlagURL;
data['NoOfPatientsRate'] = this.noOfPatientsRate;
data['QR'] = this.qR;
data['ServiceID'] = this.serviceID;
return data;
}
}

@ -51,6 +51,7 @@ class PatiantInformtion {
String genderDescription; String genderDescription;
String nursingStationName; String nursingStationName;
String appointmentDate; String appointmentDate;
String startTime;
PatiantInformtion({ PatiantInformtion({
this.list, this.list,
@ -87,7 +88,8 @@ class PatiantInformtion {
this.genderDescription, this.genderDescription,
this.nursingStationName, this.nursingStationName,
this.appointmentDate, this.appointmentDate,
this.startTime,
}); });
factory PatiantInformtion.fromJson(Map<String, dynamic> json) => PatiantInformtion( factory PatiantInformtion.fromJson(Map<String, dynamic> json) => PatiantInformtion(
@ -124,6 +126,7 @@ class PatiantInformtion {
genderDescription: json["GenderDescription"], genderDescription: json["GenderDescription"],
nursingStationName: json["NursingStationName"], nursingStationName: json["NursingStationName"],
appointmentDate: json["AppointmentDate"]?? '', appointmentDate: json["AppointmentDate"]?? '',
startTime: json["StartTime"],
); );

@ -1,8 +1,18 @@
/*
*@author:Modified by amjad add getter and setter Amjad Amireh
*@Date:11/5/2020
*@param:
*@return:PatientsScreen Search textbox filter
*@desc:
*/
class PatientModel { class PatientModel {
int ProjectID; int ProjectID;
int ClinicID; int ClinicID;
int DoctorID; int DoctorID;
String FirstName; String FirstName;
String MiddleName; String MiddleName;
String LastName; String LastName;
String PatientMobileNumber; String PatientMobileNumber;
@ -21,13 +31,87 @@ class PatientModel {
bool PatientOutSA; bool PatientOutSA;
getFirstName() { int get getProjectID => ProjectID;
return this.FirstName;
} set setProjectID(int ProjectID) => this.ProjectID = ProjectID;
int get getClinicID => ClinicID;
set setClinicID(int ClinicID) => this.ClinicID = ClinicID;
int get getDoctorID => DoctorID;
set setDoctorID(int DoctorID) => this.DoctorID = DoctorID;
String get getFirstName => FirstName;
set setFirstName(String FirstName) => this.FirstName = FirstName;
String get getMiddleName => MiddleName;
set setMiddleName(String MiddleName) => this.MiddleName = MiddleName;
String get getLastName => LastName;
set setLastName(String LastName) => this.LastName = LastName;
String get getPatientMobileNumber => PatientMobileNumber;
set setPatientMobileNumber(String PatientMobileNumber) => this.PatientMobileNumber = PatientMobileNumber;
// String get getPatientIdentificationID => PatientIdentificationID;
// set setPatientIdentificationID(String PatientIdentificationID) => this.PatientIdentificationID = PatientIdentificationID;
int get getPatientID => PatientID;
set setPatientID(int PatientID) => this.PatientID = PatientID;
String get getFrom => From;
set setFrom(String From) => this.From = From;
String get getTo => To;
set setTo(String To) => this.To = To;
int get getLanguageID => LanguageID;
set setLanguageID(int LanguageID) => this.LanguageID = LanguageID;
String get getStamp => stamp;
set setStamp(String stamp) => this.stamp = stamp;
String get getIPAdress => IPAdress;
set setIPAdress(String IPAdress) => this.IPAdress = IPAdress;
double get getVersionID => VersionID;
set setVersionID(double VersionID) => this.VersionID = VersionID;
int get getChannel => Channel;
set setChannel(int Channel) => this.Channel = Channel;
String get getTokenID => TokenID;
set setTokenID(String TokenID) => this.TokenID = TokenID;
String get getSessionID => SessionID;
set setSessionID(String SessionID) => this.SessionID = SessionID;
bool get getIsLoginForDoctorApp => IsLoginForDoctorApp;
set setIsLoginForDoctorApp(bool IsLoginForDoctorApp) => this.IsLoginForDoctorApp = IsLoginForDoctorApp;
bool get getPatientOutSA => PatientOutSA;
set setPatientOutSA(bool PatientOutSA) => this.PatientOutSA = PatientOutSA;
setFirstName( FirstName) {
this.FirstName = FirstName;
}

@ -38,7 +38,7 @@ class PrescriptionResModel {
String nationalityFlagURL; String nationalityFlagURL;
int noOfPatientsRate; int noOfPatientsRate;
String qR; String qR;
List<String> speciality; List<dynamic> speciality;
PrescriptionResModel( PrescriptionResModel(
{this.setupID, {this.setupID,
@ -108,7 +108,7 @@ class PrescriptionResModel {
nationalityFlagURL = json['NationalityFlagURL']; nationalityFlagURL = json['NationalityFlagURL'];
noOfPatientsRate = json['NoOfPatientsRate']; noOfPatientsRate = json['NoOfPatientsRate'];
qR = json['QR']; qR = json['QR'];
speciality = json['Speciality'].cast<String>(); speciality = json['Speciality'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {

@ -0,0 +1,71 @@
/*
*@author: Elham Rababah
*@Date:17/5/2020
*@param:
*@return:
*@desc: ProfileReqModel
*/
class ProfileReqModel {
int projectID;
int clinicID;
int doctorID;
bool isRegistered;
bool license;
int languageID;
String stamp;
String iPAdress;
double versionID;
int channel;
String tokenID;
String sessionID;
bool isLoginForDoctorApp;
ProfileReqModel(
{this.projectID,
this.clinicID,
this.doctorID,
this.isRegistered =true,
this.license,
this.languageID,
this.stamp = '2020-04-26T09:32:18.317Z',
this.iPAdress='11.11.11.11',
this.versionID=1.2,
this.channel=9,
this.sessionID='E2bsEeYEJo',
this.tokenID,
this.isLoginForDoctorApp = true});
ProfileReqModel.fromJson(Map<String, dynamic> json) {
projectID = json['ProjectID'];
clinicID = json['ClinicID'];
doctorID = json['doctorID'];
isRegistered = json['IsRegistered'];
license = json['License'];
languageID = json['LanguageID'];
stamp = json['stamp'];
iPAdress = json['IPAdress'];
versionID = json['VersionID'];
channel = json['Channel'];
tokenID = json['TokenID'];
sessionID = json['SessionID'];
isLoginForDoctorApp = json['IsLoginForDoctorApp'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ProjectID'] = this.projectID;
data['ClinicID'] = this.clinicID;
data['doctorID'] = this.doctorID;
data['IsRegistered'] = this.isRegistered;
data['License'] = this.license;
data['LanguageID'] = this.languageID;
data['stamp'] = this.stamp;
data['IPAdress'] = this.iPAdress;
data['VersionID'] = this.versionID;
data['Channel'] = this.channel;
data['TokenID'] = this.tokenID;
data['SessionID'] = this.sessionID;
data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp;
return data;
}
}

@ -14,6 +14,7 @@ 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';
class AuthProvider with ChangeNotifier { class AuthProvider with ChangeNotifier {
Future<Map> login(UserModel userInfo) async { Future<Map> login(UserModel userInfo) async {
const url = LOGIN_URL; const url = LOGIN_URL;
@ -85,4 +86,23 @@ class AuthProvider with ChangeNotifier {
throw error; throw error;
} }
} }
/*
*@author: Elham Rababah
*@Date:17/5/2020
*@param: docInfo
*@return:Future<Map>
*@desc: getDocProfiles
*/
Future<Map> getDocProfiles(docInfo) async {
const url = GET_DOC_PROFILES;
try {
final response = await AppClient.post(url, body: json.encode(docInfo));
return Future.value(json.decode(response.body));
} catch (error) {
print(error);
throw error;
}
}
} }

@ -1,23 +1,11 @@
import 'dart:convert'; import 'dart:convert';
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:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import '../interceptor/http_interceptor.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';
const GET_PROJECTS = BASE_URL + 'Lists.svc/REST/GetProjectForDoctorAPP';
class HospitalProvider with ChangeNotifier { class HospitalProvider with ChangeNotifier {
Client client =
HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]);
Future<Map> getProjectsList() async { Future<Map> getProjectsList() async {
const url = GET_PROJECTS; const url = GET_PROJECTS;
var info = { var info = {
@ -31,7 +19,7 @@ class HospitalProvider with ChangeNotifier {
"IsLoginForDoctorApp": true "IsLoginForDoctorApp": true
}; };
try { try {
final response = await client.post(url, body: json.encode(info)); final response = await AppClient.post(url, body: json.encode(info));
return Future.value(json.decode(response.body)); return Future.value(json.decode(response.body));
} catch (error) { } catch (error) {
throw error; throw error;

@ -1,28 +1,21 @@
import 'dart:convert'; import 'dart:convert';
import 'package:doctor_app_flutter/models/patient/lab_orders_res_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/prescription_req_model.dart';
import 'package:doctor_app_flutter/models/patient/prescription_res_model.dart';
import 'package:doctor_app_flutter/models/patient/radiology_res_model.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:http/http.dart'; import 'package:http/http.dart';
import 'package:http_interceptor/http_client_with_interceptor.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 '../interceptor/http_interceptor.dart';
import '../models/patient/lab_orders_res_model.dart';
import '../models/patient/patiant_info_model.dart';
import '../models/patient/patient_model.dart'; import '../models/patient/patient_model.dart';
import '../models/patient/prescription_res_model.dart';
import '../models/patient/radiology_res_model.dart';
import '../models/patient/vital_sign_res_model.dart'; import '../models/patient/vital_sign_res_model.dart';
import '../util/helpers.dart'; import '../util/helpers.dart';
const GET_PATIENT_VITAL_SIGN = Helpers helpers = Helpers();
BASE_URL + 'Doctors.svc/REST/Doctor_GetPatientVitalSign';
const GET_PATIENT_LAB_OREDERS =
BASE_URL + 'DoctorApplication.svc/REST/GetPatientLabOreders';
const GET_PRESCRIPTION = BASE_URL + 'Patients.svc/REST/GetPrescriptionApptList';
const GET_RADIOLOGY =
BASE_URL + 'DoctorApplication.svc/REST/GetPatientRadResult';
class PatientsProvider with ChangeNotifier { class PatientsProvider with ChangeNotifier {
bool isLoading = false; bool isLoading = false;
@ -41,11 +34,12 @@ class PatientsProvider with ChangeNotifier {
Future<Map> getPatientList(PatientModel patient, patientType) async { Future<Map> getPatientList(PatientModel patient, patientType) async {
/* const url = /* const url =
BASE_URL+'DoctorApplication.svc/REST/GetMyInPatient';*/ BASE_URL+'DoctorApplication.svc/REST/GetMyInPatient';*/
// var srvicePatiant = ["GetMyOutPatient", "GetMyInPatient", "GtMyDischargePatient","GtMyReferredPatient","GtMyDischargeReferralPatient","GtMyTomorrowPatient","GtMyReferralPatient"];
// print("a=SERVICES_PATIANT[patientType]========='=======a");
int val = int.parse(patientType); int val = int.parse(patientType);
final url =BASE_URL+"DoctorApplication.svc/REST/"+ SERVICES_PATIANT[val];///"https://uat.hmgwebservices.com/Services/Doctors.svc/REST/"; //**********Modify url by amjad amireh for patiant type*********
//BASE_URL + 'DoctorApplication.svc/REST/' + SERVICES_PATIANT[val];
final url =
BASE_URL + "DoctorApplication.svc/REST/" + SERVICES_PATIANT[val];
// print("a===========$url=======a"); // print("a===========$url=======a");
try { try {
@ -76,8 +70,8 @@ class PatientsProvider with ChangeNotifier {
//*********************** //***********************
return Future.value(json.decode(response.body)); return Future.value(json.decode(response.body));
} catch (error) { } catch (err) {
throw error; throw err;
} }
} }
@ -100,7 +94,7 @@ class PatientsProvider with ChangeNotifier {
try { try {
if (await Helpers.checkConnection()) { if (await Helpers.checkConnection()) {
final response = await client.post(GET_PATIENT_VITAL_SIGN, final response = await AppClient.post(GET_PATIENT_VITAL_SIGN,
body: json.encode(patient)); body: json.encode(patient));
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
isLoading = false; isLoading = false;
@ -128,20 +122,11 @@ class PatientsProvider with ChangeNotifier {
error = 'Please Check The Internet Connection'; error = 'Please Check The Internet Connection';
} }
notifyListeners(); notifyListeners();
} catch (error) { } catch (err) {
throw error; handelCatchErrorCase(err);
} }
} }
PatiantInformtion getSelectedPatient() {
return _selectedPatient;
}
setSelectedPatient(PatiantInformtion patient) {
// return _selectedPatient;
_selectedPatient = patient;
}
/*@author: Elham Rababah /*@author: Elham Rababah
*@Date:27/4/2020 *@Date:27/4/2020
*@param: patient *@param: patient
@ -155,7 +140,7 @@ class PatientsProvider with ChangeNotifier {
try { try {
if (await Helpers.checkConnection()) { if (await Helpers.checkConnection()) {
final response = await client.post(GET_PATIENT_LAB_OREDERS, final response = await AppClient.post(GET_PATIENT_LAB_OREDERS,
body: json.encode(patient)); body: json.encode(patient));
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
isLoading = false; isLoading = false;
@ -168,7 +153,6 @@ class PatientsProvider with ChangeNotifier {
print('$res'); print('$res');
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
patientLabResultOrdersList = []; patientLabResultOrdersList = [];
print("res['List_GetLabOreders']");
res['List_GetLabOreders'].forEach((v) { res['List_GetLabOreders'].forEach((v) {
patientLabResultOrdersList.add(new LabOrdersResModel.fromJson(v)); patientLabResultOrdersList.add(new LabOrdersResModel.fromJson(v));
}); });
@ -183,8 +167,8 @@ class PatientsProvider with ChangeNotifier {
error = 'Please Check The Internet Connection'; error = 'Please Check The Internet Connection';
} }
notifyListeners(); notifyListeners();
} catch (error) { } catch (err) {
throw error; handelCatchErrorCase(err);
} }
} }
@ -202,7 +186,7 @@ class PatientsProvider with ChangeNotifier {
try { try {
if (await Helpers.checkConnection()) { if (await Helpers.checkConnection()) {
final response = final response =
await client.post(GET_PRESCRIPTION, body: json.encode(patient)); await AppClient.post(GET_PRESCRIPTION, body: json.encode(patient));
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
isLoading = false; isLoading = false;
@ -214,7 +198,6 @@ class PatientsProvider with ChangeNotifier {
print('$res'); print('$res');
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
patientPrescriptionsList = []; patientPrescriptionsList = [];
print("res['PatientPrescriptionList']");
res['PatientPrescriptionList'].forEach((v) { res['PatientPrescriptionList'].forEach((v) {
patientPrescriptionsList patientPrescriptionsList
.add(new PrescriptionResModel.fromJson(v)); .add(new PrescriptionResModel.fromJson(v));
@ -230,11 +213,25 @@ class PatientsProvider with ChangeNotifier {
error = 'Please Check The Internet Connection'; error = 'Please Check The Internet Connection';
} }
notifyListeners(); notifyListeners();
} catch (error) { } catch (err) {
throw error; handelCatchErrorCase(err);
} }
} }
/*@author: Elham Rababah
*@Date:12/5/2020
*@param: patient
*@return:
*@desc: getPatientRadiology
*/
handelCatchErrorCase(err) {
isLoading = false;
isError = true;
error = helpers.generateContactAdminMsg(err);
notifyListeners();
throw err;
}
/*@author: Elham Rababah /*@author: Elham Rababah
*@Date:3/5/2020 *@Date:3/5/2020
*@param: patient *@param: patient
@ -248,7 +245,7 @@ class PatientsProvider with ChangeNotifier {
try { try {
if (await Helpers.checkConnection()) { if (await Helpers.checkConnection()) {
final response = final response =
await client.post(GET_RADIOLOGY, body: json.encode(patient)); await AppClient.post(GET_RADIOLOGY, body: json.encode(patient));
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
isLoading = false; isLoading = false;
@ -260,7 +257,6 @@ class PatientsProvider with ChangeNotifier {
print('$res'); print('$res');
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
patientRadiologyList = []; patientRadiologyList = [];
print("res['List_GetRadOreders']");
res['List_GetRadOreders'].forEach((v) { res['List_GetRadOreders'].forEach((v) {
patientRadiologyList.add(new RadiologyResModel.fromJson(v)); patientRadiologyList.add(new RadiologyResModel.fromJson(v));
}); });
@ -275,8 +271,8 @@ class PatientsProvider with ChangeNotifier {
error = 'Please Check The Internet Connection'; error = 'Please Check The Internet Connection';
} }
notifyListeners(); notifyListeners();
} catch (error) { } catch (err) {
throw error; handelCatchErrorCase(err);
} }
} }
} }

@ -18,7 +18,7 @@ class ProjectProvider with ChangeNotifier{
} }
void loadSharedPrefLanguage() async { void loadSharedPrefLanguage() async {
currentLanguage = await sharedPref.getString(APP_Language); currentLanguage = await sharedPref.getString(APP_Language);
_appLocale = Locale(currentLanguage ?? 'ar'); _appLocale = Locale(currentLanguage ?? 'en');
_isArabic = currentLanguage != null _isArabic = currentLanguage != null
? currentLanguage == 'ar' ? true : false ? currentLanguage == 'ar' ? true : false
: false; : false;

@ -1,3 +1,5 @@
import './screens/patients/profile/vital_sign/body_measurements_screen.dart';
import './screens/QR_reader_screen.dart'; import './screens/QR_reader_screen.dart';
import './screens/auth/change_password_screen.dart'; import './screens/auth/change_password_screen.dart';
import './screens/auth/login_screen.dart'; import './screens/auth/login_screen.dart';
@ -46,8 +48,7 @@ const String LAB_ORDERS = 'patients/lab_orders';
const String PRESCRIPTIONS = 'patients/prescription'; const String PRESCRIPTIONS = 'patients/prescription';
const String RADIOLOGY = 'patients/radiology'; const String RADIOLOGY = 'patients/radiology';
const String VITAL_SIGN_DETAILS = 'patients/vital-sign-details'; const String VITAL_SIGN_DETAILS = 'patients/vital-sign-details';
const String BODY_MEASUREMENTS = 'patients/body-measurements';
var routes = { var routes = {
HOME: (_) => DashboardScreen(), HOME: (_) => DashboardScreen(),
@ -63,15 +64,17 @@ var routes = {
SETTINGS: (_) => SettingsScreen(), SETTINGS: (_) => SettingsScreen(),
CHANGE_PASSWORD: (_) => ChangePasswordScreen(), CHANGE_PASSWORD: (_) => ChangePasswordScreen(),
VERIFY_ACCOUNT: (_) => VerifyAccountScreen(), VERIFY_ACCOUNT: (_) => VerifyAccountScreen(),
VERIFICATION_METHODS:(_)=> VerificationMethodsScreen(), VERIFICATION_METHODS: (_) => VerificationMethodsScreen(),
PATIENTS_PROFILE:(_)=> PatientProfileScreen(), PATIENTS_PROFILE: (_) => PatientProfileScreen(),
PHARMACIES_LIST: (_) => PharmaciesListScreen(itemID: null,), PHARMACIES_LIST: (_) => PharmaciesListScreen(
itemID: null,
),
VITAL_SIGN: (_) => VitalSignScreen(), VITAL_SIGN: (_) => VitalSignScreen(),
MESSAGES: (_) => MessagesScreen(), MESSAGES: (_) => MessagesScreen(),
SERVICES: (_) => ServicesScreen(), SERVICES: (_) => ServicesScreen(),
LAB_ORDERS:(_)=>LabOrdersScreen(), LAB_ORDERS: (_) => LabOrdersScreen(),
PRESCRIPTIONS:(_)=>PrescriptionScreen(), PRESCRIPTIONS: (_) => PrescriptionScreen(),
RADIOLOGY:(_)=>RadiologyScreen(), RADIOLOGY: (_) => RadiologyScreen(),
VITAL_SIGN_DETAILS:(_)=>VitalSignDetailsScreen(), VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(),
BODY_MEASUREMENTS: (_) => BodyMeasurementsScreen()
}; };

@ -72,7 +72,7 @@ class _LoginsreenState extends State<Loginsreen> {
return Text('Error: ${snapshot.error}'); return Text('Error: ${snapshot.error}');
} else { } else {
return Container( return Container(
margin: EdgeInsetsDirectional.fromSTEB(30, 0, 0, 30), margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 30),
alignment: Alignment.topLeft, alignment: Alignment.topLeft,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,

@ -46,8 +46,9 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AuthHeader(loginType.verificationMethods), AuthHeader(loginType.verificationMethods),
VerificationMethods(changeLoadingStata: VerificationMethods(
changeLoadingStata,), changeLoadingStata: changeLoadingStata,
),
], ],
), ),
), ),

@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/routes.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:flutter/services.dart'; import 'package:flutter/services.dart';
import '../../config/size_config.dart'; import '../../config/size_config.dart';
@ -16,8 +17,10 @@ import 'package:flutter/rendering.dart';
import '../../lookups/patient_lookup.dart'; import '../../lookups/patient_lookup.dart';
import '../../widgets/patients/dynamic_elements.dart'; import '../../widgets/patients/dynamic_elements.dart';
import '../../config/config.dart'; import '../../config/config.dart';
import '../../models/doctor_profile_model.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
Helpers helpers = Helpers();
// OWNER : Ibrahim albitar // OWNER : Ibrahim albitar
// DATE : 19-04-2020 // DATE : 19-04-2020
@ -31,14 +34,11 @@ class PatientSearchScreen extends StatefulWidget {
class _PatientSearchScreenState extends State<PatientSearchScreen> { class _PatientSearchScreenState extends State<PatientSearchScreen> {
String _selectedType = '1'; String _selectedType = '1';
String _selectedLocation = '1'; String _selectedLocation = '1';
String error = '';
final GlobalKey<FormState> _formKey = GlobalKey<FormState>(); final GlobalKey<FormState> _formKey = GlobalKey<FormState>();
bool _autoValidate = false; bool _autoValidate = false;
var _patientSearchFormValues = PatientModel( var _patientSearchFormValues = PatientModel(
ProjectID: 15,
ClinicID: 0,
DoctorID: 4709,
FirstName: "0", FirstName: "0",
MiddleName: "0", MiddleName: "0",
LastName: "0", LastName: "0",
@ -58,32 +58,47 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
PatientOutSA: false); PatientOutSA: false);
void _validateInputs() async { void _validateInputs() async {
print("####IBRAHIM TEST#####" + _patientSearchFormValues.From); try {
// _patientSearchFormValues.TokenID = Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile =
new DoctorProfileModel.fromJson(profile);
if (_formKey.currentState.validate()) {
_formKey.currentState.save();
if (_formKey.currentState.validate()) { //*********************************** */
// If all data are correct then save data to out variables sharedPref.setString(TOKEN, '@dm!n');
// _formKey.currentState.save(); sharedPref.setString(SLECTED_PATIENT_TYPE, _selectedType);
sharedPref.setString(TOKEN,'@dm!n'); print('_selectedType${_selectedType}');
sharedPref.setString(SLECTED_PATIENT_TYPE,_selectedType); String token = await sharedPref.getString(TOKEN);
print('_selectedType${_selectedType}');
String token = await sharedPref.getString(TOKEN); _patientSearchFormValues.TokenID = token;
int projectID = await sharedPref.getInt(PROJECT_ID); _patientSearchFormValues.ProjectID = doctorProfile.projectID ;//15
_patientSearchFormValues.TokenID = token; _patientSearchFormValues.DoctorID = doctorProfile.doctorID;
_patientSearchFormValues.ProjectID = 15;//projectID; _patientSearchFormValues.ClinicID = doctorProfile.clinicID;
// print(_patientSearchFormValues.PatientMobileNumber+"dfdfdfddf");
Navigator.of(context).pushNamed(PATIENTS, arguments: { Navigator.of(context).pushNamed(PATIENTS, arguments: {
"patientSearchForm": _patientSearchFormValues, "patientSearchForm": _patientSearchFormValues,
"selectedType": _selectedType "selectedType": _selectedType
}); });
} else { } else {
// If all data are not valid then start auto validation. // If all data are not valid then start auto validation.
setState(() { setState(() {
_autoValidate = true; _autoValidate = true;
}); });
}
} catch (err) {
handelCatchErrorCase(err);
} }
} }
handelCatchErrorCase(err) {
//isLoading = false;
//isError = true;
error = helpers.generateContactAdminMsg(err);
//notifyListeners();
throw err;
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return AppScaffold(
@ -173,7 +188,15 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
AppTextFormField( AppTextFormField(
hintText: 'First Name', hintText: 'First Name',
onSaved: (value) { onSaved: (value) {
_patientSearchFormValues.FirstName = value; value == null
? _patientSearchFormValues.setFirstName =
"0"
: _patientSearchFormValues.setFirstName =
value;
if (value.toString().trim().isEmpty) {
_patientSearchFormValues.setFirstName = "0";
}
}, },
// validator: (value) { // validator: (value) {
// return TextValidator().validateName(value); // return TextValidator().validateName(value);
@ -185,7 +208,14 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
AppTextFormField( AppTextFormField(
hintText: 'Middle Name', hintText: 'Middle Name',
onSaved: (value) { onSaved: (value) {
_patientSearchFormValues.MiddleName = value; value == null
? _patientSearchFormValues.setMiddleName =
"0"
: _patientSearchFormValues.setMiddleName =
value;
if (value.toString().trim().isEmpty) {
_patientSearchFormValues.setMiddleName = "0";
}
}, },
// validator: (value) { // validator: (value) {
// return TextValidator().validateName(value); // return TextValidator().validateName(value);
@ -197,7 +227,13 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
AppTextFormField( AppTextFormField(
hintText: 'Last Name', hintText: 'Last Name',
onSaved: (value) { onSaved: (value) {
_patientSearchFormValues.LastName = value; value == null
? _patientSearchFormValues.setLastName = "0"
: _patientSearchFormValues.setLastName =
value;
if (value.toString().trim().isEmpty) {
_patientSearchFormValues.setLastName = "0";
}
}, },
// validator: (value) { // validator: (value) {
// return TextValidator().validateName(value); // return TextValidator().validateName(value);
@ -214,8 +250,16 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
// }, // },
inputFormatter: ONLY_NUMBERS, inputFormatter: ONLY_NUMBERS,
onSaved: (value) { onSaved: (value) {
_patientSearchFormValues.PatientMobileNumber = value == null
value; ? _patientSearchFormValues
.setPatientMobileNumber = "0"
: _patientSearchFormValues
.setPatientMobileNumber = value;
if (value.toString().trim().isEmpty) {
_patientSearchFormValues
.setPatientMobileNumber = "0";
}
}, },
), ),
SizedBox( SizedBox(
@ -227,7 +271,15 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
// //
inputFormatter: ONLY_NUMBERS, inputFormatter: ONLY_NUMBERS,
onSaved: (value) { onSaved: (value) {
_patientSearchFormValues.PatientID = 89000; // _patientSearchFormValues.PatientID = 89000;
value == null
? _patientSearchFormValues.setPatientID = 0
: _patientSearchFormValues.setPatientID =
int.parse(value);
if (value.toString().trim().isEmpty) {
_patientSearchFormValues.setPatientID = 0;
}
}), }),
SizedBox( SizedBox(
height: 10, height: 10,

@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -201,8 +202,24 @@ class _PatientsScreenState extends State<PatientsScreen> {
return newDate.toString(); return newDate.toString();
} }
convertDateFormat2(String str) {
String timeConvert;
const start = "/Date(";
const end = "+0300)";
final startIndex = str.indexOf(start);
final endIndex = str.indexOf(end, startIndex + start.length);
var date = new DateTime.fromMillisecondsSinceEpoch(
int.parse(str.substring(startIndex + start.length, endIndex)));
String newDate = date.year.toString() +
"/" +
date.month.toString().padLeft(2, '0') +
"/" +
date.day.toString().padLeft(2, '0');
return newDate.toString();
}
filterBooking(String str) { filterBooking(String str) {
this.responseModelList = this.responseModelList2; this.responseModelList = this.responseModelList2;
@ -231,27 +248,26 @@ class _PatientsScreenState extends State<PatientsScreen> {
} }
} }
String checkDate(String dateString) { String checkDate(String dateString) {
String date;
DateTime checkedTime = DateTime.parse(dateString); DateTime checkedTime = DateTime.parse(dateString);
DateTime currentTime = DateTime.now(); DateTime currentTime = DateTime.now();
if ((currentTime.year == checkedTime.year) && if ((currentTime.year == checkedTime.year) &&
(currentTime.month == checkedTime.month) && (currentTime.month == checkedTime.month) &&
(currentTime.day == checkedTime.day)) { (currentTime.day == checkedTime.day)) {
return "TODAY"; return "Today";
} else if ((currentTime.year == checkedTime.year) && } else if ((currentTime.year == checkedTime.year) &&
(currentTime.month == checkedTime.month)) { (currentTime.month == checkedTime.month)) {
if ((currentTime.day - checkedTime.day) == 1) { if ((currentTime.day - checkedTime.day) == 1) {
return "YESTERDAY"; return "YESTERDAY";
} else if ((currentTime.day - checkedTime.day) == -1) { } else if ((currentTime.day - checkedTime.day) == -1) {
return "TOMORROW"; return "Tomorrow";
} }
if ((currentTime.day - checkedTime.day) <= -2) { if ((currentTime.day - checkedTime.day) <= -2) {
return "Next Week"; return "Next Week";
} else { } else {
return "Old Date"; return "Old Date";
} }
} }
return "Old Date"; return "Old Date";
@ -268,114 +284,120 @@ class _PatientsScreenState extends State<PatientsScreen> {
body: patientsProv.isLoading body: patientsProv.isLoading
? DrAppCircularProgressIndeicator() ? DrAppCircularProgressIndeicator()
: patientsProv.isError : patientsProv.isError
? Center( ? DrAppEmbeddedError(error: patientsProv.error)
child: Text( : litems == null
patientsProv.error, ? DrAppEmbeddedError(
style: TextStyle(color: Theme.of(context).errorColor), error: 'You don\'t have any ' +
), patientTypetitle +
) " patiant")
: Container( : Container(
child:
child: ListView(scrollDirection: Axis.vertical, children: < ListView(scrollDirection: Axis.vertical, children: <
Widget>[ Widget>[
Container( Container(
child: litems == null child: litems == null
? Column( ? Column(
children: <Widget>[ children: <Widget>[
Container( Container(
child: Center( child: Center(
child: child: Padding(
DrAppCircularProgressIndeicator()), padding: const EdgeInsets.fromLTRB(
), 0, 250, 0, 0),
Container( child:
child: Text( DrAppCircularProgressIndeicator(),
"Sorry There is No Data", )),
style: TextStyle( ),
color: Theme.of(context).errorColor), ],
),
) )
], : Column(
) children: <Widget>[
: Column( Padding(
children: <Widget>[ padding: EdgeInsets.only(
Padding( top: MediaQuery.of(context)
padding: EdgeInsets.only( .size
top: .height *
MediaQuery.of(context).size.height *
0.03), 0.03),
child: SERVICES_PATIANT2[ child: SERVICES_PATIANT2[
int.parse(patientType)] == int.parse(patientType)] ==
"List_MyOutPatient" "List_MyOutPatient"
? _locationBar(context) ? _locationBar(context)
: Container(), : Container(),
), ),
SizedBox(height: 10.0), SizedBox(height: 10.0),
Container( Container(
width: SizeConfig.screenWidth * 0.80, width: SizeConfig.screenWidth * 0.80,
child: TextField( child: TextField(
controller: _controller, controller: _controller,
onChanged: (String str) { onChanged: (String str) {
this.searchData(str);
this.searchData(str);
},
decoration: buildInputDecoration(
context, 'Search patiant'),
),
),
Container(
margin: EdgeInsets.fromLTRB(15, 0, 15, 0),
child: Column(
children: responseModelList
.map((PatiantInformtion item) {
return InkWell(
child: CardWithBgWidget(
widget: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
item.firstName +
" " +
item.lastName +
"- " +
item.patientId.toString(),
fontSize: 2.5 *
SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
SizedBox(
height: 8,
),
SERVICES_PATIANT2[int.parse(
patientType)] ==
"List_MyOutPatient"
? AppText(
convertDate(item
.appointmentDate
.toString()),
fontSize: 2.5 *
SizeConfig
.textMultiplier)
: AppText(
item.nationalityName,
fontSize: 2.5 *
SizeConfig
.textMultiplier)
],
),
),
onTap: () {
Navigator.of(context).pushNamed(
PATIENTS_PROFILE,
arguments: {"patient": item});
}, },
); decoration: buildInputDecoration(
}).toList(), context, 'Search patiant'),
), ),
), ),
], Container(
)) margin:
]))); EdgeInsets.fromLTRB(15, 0, 15, 0),
child: Column(
children: responseModelList
.map((PatiantInformtion item) {
return InkWell(
child: CardWithBgWidget(
widget: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
item.firstName +
" " +
item.lastName +
"- " +
item.patientId
.toString(),
fontSize: 2.5 *
SizeConfig
.textMultiplier,
fontWeight:
FontWeight.bold,
),
SizedBox(
height: 8,
),
SERVICES_PATIANT2[int.parse(
patientType)] ==
"List_MyOutPatient"
? AppText(
convertDateFormat2(item
.appointmentDate
.toString())+" "+"-"+" "+item.startTime
,
fontSize: 2.5 *
SizeConfig
.textMultiplier)
: AppText(
item
.nationalityName,
fontSize: 2.5 *
SizeConfig
.textMultiplier)
],
),
),
onTap: () {
Navigator.of(context).pushNamed(
PATIENTS_PROFILE,
arguments: {
"patient": item
});
},
);
}).toList(),
),
),
],
))
])));
} }
//***********amjad update**buildInputDecoration ***to search box******** //***********amjad update**buildInputDecoration ***to search box********
@ -418,15 +440,12 @@ class _PatientsScreenState extends State<PatientsScreen> {
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
), ),
onTap: () { onTap: () {
print(_locations.indexOf(item)); print(_locations.indexOf(item));
filterBooking(item.toString()); filterBooking(item.toString());
setState(() { setState(() {
_activeLocation = _locations.indexOf(item); _activeLocation = _locations.indexOf(item);
}); });
}), }),
_isActive _isActive

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -78,19 +79,9 @@ class _LabOrdersScreenState extends State<LabOrdersScreen> {
body: patientsProv.isLoading body: patientsProv.isLoading
? DrAppCircularProgressIndeicator() ? DrAppCircularProgressIndeicator()
: patientsProv.isError : patientsProv.isError
? Center( ? DrAppEmbeddedError(error: patientsProv.error)
child: Text(
patientsProv.error,
style: TextStyle(color: Theme.of(context).errorColor),
),
)
: patientsProv.patientLabResultOrdersList.length == 0 : patientsProv.patientLabResultOrdersList.length == 0
? Center( ? DrAppEmbeddedError(error: 'You don\'t have any Orders')
child: Text(
'You don\'t have any Orders',
style: TextStyle(color: Theme.of(context).errorColor),
),
)
: Container( : Container(
margin: EdgeInsets.fromLTRB( margin: EdgeInsets.fromLTRB(
SizeConfig.realScreenWidth * 0.05, SizeConfig.realScreenWidth * 0.05,

@ -12,6 +12,7 @@ import '../../../../widgets/shared/app_texts_widget.dart';
import '../../../../widgets/shared/card_with_bg_widget.dart'; import '../../../../widgets/shared/card_with_bg_widget.dart';
import '../../../../widgets/shared/dr_app_circular_progress_Indeicator.dart'; import '../../../../widgets/shared/dr_app_circular_progress_Indeicator.dart';
import '../../../../widgets/shared/profile_image_widget.dart'; import '../../../../widgets/shared/profile_image_widget.dart';
import '../../../../widgets/shared/errors/dr_app_embedded_error.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
@ -78,19 +79,10 @@ class _PrescriptionScreenState extends State<PrescriptionScreen> {
body: patientsProv.isLoading body: patientsProv.isLoading
? DrAppCircularProgressIndeicator() ? DrAppCircularProgressIndeicator()
: patientsProv.isError : patientsProv.isError
? Center( ? DrAppEmbeddedError(error: patientsProv.error)
child: Text(
patientsProv.error,
style: TextStyle(color: Theme.of(context).errorColor),
),
)
: patientsProv.patientPrescriptionsList.length == 0 : patientsProv.patientPrescriptionsList.length == 0
? Center( ? DrAppEmbeddedError(
child: Text( error: 'You don\'t have any Prescriptions')
'You don\'t have any Prescriptions',
style: TextStyle(color: Theme.of(context).errorColor),
),
)
: Container( : Container(
margin: EdgeInsets.fromLTRB( margin: EdgeInsets.fromLTRB(
SizeConfig.realScreenWidth * 0.05, SizeConfig.realScreenWidth * 0.05,

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -78,19 +79,9 @@ class _RadiologyScreenState extends State<RadiologyScreen> {
body: patientsProv.isLoading body: patientsProv.isLoading
? DrAppCircularProgressIndeicator() ? DrAppCircularProgressIndeicator()
: patientsProv.isError : patientsProv.isError
? Center( ? DrAppEmbeddedError(error: patientsProv.error)
child: Text(
patientsProv.error,
style: TextStyle(color: Theme.of(context).errorColor),
),
)
: patientsProv.patientRadiologyList.length == 0 : patientsProv.patientRadiologyList.length == 0
? Center( ? DrAppEmbeddedError(error: 'You don\'t have any Vital Sign')
child: Text(
'You don\'t have any Vital Sign',
style: TextStyle(color: Theme.of(context).errorColor),
),
)
: Container( : Container(
margin: EdgeInsets.fromLTRB( margin: EdgeInsets.fromLTRB(
SizeConfig.realScreenWidth * 0.05, SizeConfig.realScreenWidth * 0.05,
@ -120,11 +111,12 @@ class _RadiologyScreenState extends State<RadiologyScreen> {
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
AppText( AppText(
'${patientsProv.patientRadiologyList[index].doctorName}', '${patientsProv.patientRadiologyList[index].doctorName}',
fontSize: 2.5 * fontSize: 2.5 *
SizeConfig.textMultiplier, SizeConfig
fontWeight: FontWeight.bold .textMultiplier,
), fontWeight:
FontWeight.bold),
SizedBox( SizedBox(
height: 8, height: 8,
), ),
@ -132,7 +124,6 @@ class _RadiologyScreenState extends State<RadiologyScreen> {
'Invoice No:${patientsProv.patientRadiologyList[index].invoiceNo}', 'Invoice No:${patientsProv.patientRadiologyList[index].invoiceNo}',
fontSize: 2 * fontSize: 2 *
SizeConfig.textMultiplier, SizeConfig.textMultiplier,
), ),
SizedBox( SizedBox(
height: 8, height: 8,

@ -0,0 +1,143 @@
import 'package:charts_flutter/flutter.dart' as charts;
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign_res_model.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:flutter/material.dart';
class BodyMeasurementsScreen extends StatelessWidget {
BodyMeasurementsScreen();
List<VitalSignResModel> vitalList;
@override
Widget build(BuildContext context) {
_seriesData = List<charts.Series<Pollution, String>>();
_seriesPieData = List<charts.Series<Task, String>>();
_seriesLineData = List<charts.Series<Sales, int>>();
_generateData();
return AppScaffold(
appBarTitle: 'Body Measurements',
body: RoundedContainer(
height: SizeConfig.realScreenHeight*0.4,
child: Padding(
padding: EdgeInsets.all(8.0),
child: Container(
child: Center(
child: Column(
children: <Widget>[
Text(
'Body Mass Index',
style: TextStyle(
fontSize: 24.0, fontWeight: FontWeight.bold),
),
Expanded(
child: charts.BarChart(
_seriesData,
animate: true,
barGroupingType: charts.BarGroupingType.grouped,
// behaviors: [new charts.SeriesLegend()],
// primaryMeasureAxis: ,
animationDuration: Duration(seconds: 5),
),
),
],
),
),
),
),
),
);
}
List<charts.Series<Pollution, String>> _seriesData;
List<charts.Series<Task, String>> _seriesPieData;
List<charts.Series<Sales, int>> _seriesLineData;
_generateData() {
var data1 = [
new Pollution(1980, 'USA', 40),
];
_seriesData.add(
charts.Series(
domainFn: (Pollution pollution, _) => '',
measureFn: (Pollution pollution, _) => pollution.quantity,
id: '2017',
data: data1,
fillPatternFn: (_, __) => charts.FillPatternType.solid,
fillColorFn: (Pollution pollution, _) =>
charts.ColorUtil.fromDartColor(Color(0xff990099)),
),
);
_seriesData.add(
charts.Series(
domainFn: (Pollution pollution, _) => '',
measureFn: (Pollution pollution, _) => pollution.quantity,
id: '2017',
data: data1,
fillPatternFn: (_, __) => charts.FillPatternType.solid,
fillColorFn: (Pollution pollution, _) =>
charts.ColorUtil.fromDartColor(Color(0xff990099)),
),
);
_seriesData.add(
charts.Series(
domainFn: (Pollution pollution, _) => '',
measureFn: (Pollution pollution, _) => pollution.quantity,
id: '2017',
data: data1,
fillPatternFn: (_, __) => charts.FillPatternType.solid,
fillColorFn: (Pollution pollution, _) =>
charts.ColorUtil.fromDartColor(Color(0xff990099)),
),
);
_seriesData.add(
charts.Series(
domainFn: (Pollution pollution, _) => '',
measureFn: (Pollution pollution, _) => pollution.quantity,
id: '2017',
data: data1,
fillPatternFn: (_, __) => charts.FillPatternType.solid,
fillColorFn: (Pollution pollution, _) =>
charts.ColorUtil.fromDartColor(Color(0xff990099)),
),
);
_seriesData.add(
charts.Series(
domainFn: (Pollution pollution, _) => '',
measureFn: (Pollution pollution, _) => pollution.quantity,
id: '2017',
data: data1,
fillPatternFn: (_, __) => charts.FillPatternType.solid,
fillColorFn: (Pollution pollution, _) =>
charts.ColorUtil.fromDartColor(Color(0xff990099)),
),
);
}
}
class Pollution {
String place;
int year;
int quantity;
Pollution(this.year, this.place, this.quantity);
}
class Task {
String task;
double taskvalue;
Color colorval;
Task(this.task, this.taskvalue, this.colorval);
}
class Sales {
int yearval;
int salesval;
Sales(this.yearval, this.salesval);
}

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/routes.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../../../config/size_config.dart'; import '../../../../config/size_config.dart';
@ -10,7 +11,7 @@ class VitalSignDetailsScreen extends StatelessWidget {
// VitalSignDetailsScreen({Key key, this.vitalSing}) : super(key: key); // VitalSignDetailsScreen({Key key, this.vitalSing}) : super(key: key);
VitalSignResModel vitalSing; VitalSignResModel vitalSing;
String url = "assets/images/"; String url = "assets/images/";
final double contWidth = SizeConfig.realScreenWidth * 0.70; final double contWidth = SizeConfig.realScreenWidth * 0.70;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -19,7 +20,7 @@ class VitalSignDetailsScreen extends StatelessWidget {
return AppScaffold( return AppScaffold(
appBarTitle: "vital Sing ", appBarTitle: "vital Sing ",
body: RoundedContainer( body: RoundedContainer(
height: SizeConfig.realScreenHeight *0.7, height: SizeConfig.realScreenHeight * 0.7,
child: CustomScrollView( child: CustomScrollView(
primary: false, primary: false,
slivers: <Widget>[ slivers: <Widget>[
@ -31,18 +32,22 @@ class VitalSignDetailsScreen extends StatelessWidget {
mainAxisSpacing: 0, mainAxisSpacing: 0,
crossAxisCount: 3, crossAxisCount: 3,
children: <Widget>[ children: <Widget>[
InkWell(
onTap: (){
Navigator.of(context).pushNamed(BODY_MEASUREMENTS);
},
child: CircleAvatarWidget(
des: 'Body Measurements',
url: url + 'heartbeat.png',
),
),
CircleAvatarWidget( CircleAvatarWidget(
des: 'Body Measurements',
url: url + 'heartbeat.png',
), CircleAvatarWidget(
des: 'Temperature', des: 'Temperature',
url: url + 'heartbeat.png', url: url + 'heartbeat.png',
), ),
CircleAvatarWidget( CircleAvatarWidget(
des: 'Pulse', des: 'Pulse',
url: url + 'heartbeat.png', url: url + 'heartbeat.png',
), ),
CircleAvatarWidget( CircleAvatarWidget(
des: 'Respiration', des: 'Respiration',
@ -52,10 +57,11 @@ class VitalSignDetailsScreen extends StatelessWidget {
des: 'Blood Pressure', des: 'Blood Pressure',
url: url + 'heartbeat.png', url: url + 'heartbeat.png',
), ),
CircleAvatarWidget( CircleAvatarWidget(
des: 'Oxygenation', des: 'Oxygenation',
url: url + 'heartbeat.png', url: url + 'heartbeat.png',
), CircleAvatarWidget( ),
CircleAvatarWidget(
des: 'Pain Scale', des: 'Pain Scale',
url: url + 'heartbeat.png', url: url + 'heartbeat.png',
), ),

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -81,19 +82,9 @@ class _VitalSignScreenState extends State<VitalSignScreen> {
body: patientsProv.isLoading body: patientsProv.isLoading
? DrAppCircularProgressIndeicator() ? DrAppCircularProgressIndeicator()
: patientsProv.isError : patientsProv.isError
? Center( ? DrAppEmbeddedError(error: patientsProv.error)
child: Text(
patientsProv.error,
style: TextStyle(color: Theme.of(context).errorColor),
),
)
: patientsProv.patientVitalSignList.length == 0 : patientsProv.patientVitalSignList.length == 0
? Center( ? DrAppEmbeddedError(error: 'You don\'t have any Vital Sign')
child: Text(
'You don\'t have any Vital Sign',
style: TextStyle(color: Theme.of(context).errorColor),
),
)
: Container( : Container(
margin: EdgeInsets.fromLTRB( margin: EdgeInsets.fromLTRB(
SizeConfig.realScreenWidth * 0.05, SizeConfig.realScreenWidth * 0.05,
@ -151,7 +142,11 @@ class _VitalSignScreenState extends State<VitalSignScreen> {
), ),
), ),
onTap: () { onTap: () {
Navigator.of(context).pushNamed(VITAL_SIGN_DETAILS,arguments: {'vitalSing':patientsProv.patientVitalSignList[index]}); Navigator.of(context)
.pushNamed(VITAL_SIGN_DETAILS, arguments: {
'vitalSing':
patientsProv.patientVitalSignList[index]
});
}, },
); );
}), }),

@ -48,7 +48,7 @@ class Helpers {
children: items.map((item) { children: items.map((item) {
return Text( return Text(
'${item["$decKey"]}', '${item["$decKey"]}',
style: TextStyle(fontSize: 20), style: TextStyle(fontSize: SizeConfig.textMultiplier *3),
); );
}).toList(), }).toList(),
@ -70,7 +70,7 @@ class Helpers {
*@desc: showErrorToast *@desc: showErrorToast
*/ */
showErrorToast([msg = null]) { showErrorToast([msg = null]) {
String localMsg = 'Something wrong happened, please contact the admin'; String localMsg = generateContactAdminMsg();
if (msg != null) { if (msg != null) {
localMsg = msg.toString(); localMsg = msg.toString();
@ -96,4 +96,22 @@ class Helpers {
return false; return false;
} }
} }
/*
*@author: Elham Rababah
*@Date:12/5/2020
*@param:
*@return: String
*@desc: generate Contact Admin Msg
*/
generateContactAdminMsg([err = null]) {
String localMsg = 'Something wrong happened, please contact the admin';
if (err != null) {
localMsg = localMsg +'\n \n'+ err.toString();
}
return localMsg;
} }
}

@ -23,7 +23,7 @@ class AuthHeader extends StatelessWidget {
children: <Widget>[ children: <Widget>[
Container( Container(
margin: SizeConfig.isMobile margin: SizeConfig.isMobile
? EdgeInsetsDirectional.fromSTEB(0, 50, 0, 0) ? EdgeInsetsDirectional.fromSTEB(0, SizeConfig.realScreenHeight*0.03, 0, 0)
: EdgeInsetsDirectional.fromSTEB( : EdgeInsetsDirectional.fromSTEB(
SizeConfig.realScreenWidth * 0.13, 0, 0, 0), SizeConfig.realScreenWidth * 0.13, 0, 0, 0),
child: buildImageLogo(), child: buildImageLogo(),

@ -1,4 +1,7 @@
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/clinic_model.dart';
import 'package:doctor_app_flutter/models/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/profile_req_Model.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -32,6 +35,7 @@ class _VerifyAccountState extends State<VerifyAccount> {
}; };
Future _loggedUserFuture; Future _loggedUserFuture;
var _loggedUser; var _loggedUser;
AuthProvider authProv;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -46,7 +50,7 @@ class _VerifyAccountState extends State<VerifyAccount> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AuthProvider authProv = Provider.of<AuthProvider>(context); authProv = Provider.of<AuthProvider>(context);
return FutureBuilder( return FutureBuilder(
future: Future.wait([_loggedUserFuture]), future: Future.wait([_loggedUserFuture]),
@ -200,6 +204,7 @@ class _VerifyAccountState extends State<VerifyAccount> {
} }
return null; return null;
} }
/* /*
*@author: Elham Rababah *@author: Elham Rababah
*@Date:28/4/2020 *@Date:28/4/2020
@ -256,7 +261,7 @@ class _VerifyAccountState extends State<VerifyAccount> {
*@return: *@return:
*@desc: verify Account func call sendActivationCodeByOtpNotificationType service *@desc: verify Account func call sendActivationCodeByOtpNotificationType service
*/ */
verifyAccount(AuthProvider authProv, Function changeLoadingStata) async{ verifyAccount(AuthProvider authProv, Function changeLoadingStata) async {
if (verifyAccountForm.currentState.validate()) { if (verifyAccountForm.currentState.validate()) {
changeLoadingStata(true); changeLoadingStata(true);
@ -285,11 +290,22 @@ class _VerifyAccountState extends State<VerifyAccount> {
changeLoadingStata(true); changeLoadingStata(true);
authProv.memberCheckActivationCodeNew(model).then((res) { authProv.memberCheckActivationCodeNew(model).then((res) {
changeLoadingStata(false); // changeLoadingStata(false);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
sharedPref.setString(TOKEN, res['AuthenticationTokenID']); sharedPref.setString(TOKEN, res['AuthenticationTokenID']);
Navigator.of(context).pushNamed(HOME); if (res['List_DoctorProfile'] != null) {
loginProcessCompleted(res['List_DoctorProfile'][0],changeLoadingStata);
} else {
_asyncSimpleDialog(context, res['List_DoctorsClinic'], 'ClinicName',
'Please Select Clinic')
.then((clinicInfo) {
ClinicModel clinic = ClinicModel.fromJson(clinicInfo);
print(clinicInfo);
getDocProfiles(clinic, changeLoadingStata);
});
}
} else { } else {
changeLoadingStata(false);
helpers.showErrorToast(res['ErrorEndUserMessage']); helpers.showErrorToast(res['ErrorEndUserMessage']);
} }
}).catchError((err) { }).catchError((err) {
@ -302,4 +318,68 @@ class _VerifyAccountState extends State<VerifyAccount> {
// changeLoadingStata(false); // changeLoadingStata(false);
} }
} }
/*
*@author: Elham Rababah
*@Date:17/5/2020
*@param: Map<String, dynamic> profile, Function changeLoadingStata
*@return:
*@desc: loginProcessCompleted
*/
loginProcessCompleted(Map<String, dynamic> profile, Function changeLoadingStata) {
changeLoadingStata(false);
sharedPref.setObj(DOCTOR_PROFILE, profile);
Navigator.of(context).pushNamed(HOME);
}
Future<dynamic> _asyncSimpleDialog(
BuildContext context, List list, String txtKey,
[String text = '']) async {
return await showDialog<dynamic>(
context: context,
barrierDismissible: true,
builder: (BuildContext context) {
return SimpleDialog(
title: Text(text),
children: list.map((value) {
return SimpleDialogOption(
onPressed: () {
Navigator.pop(context,
value); //here passing the index to be return on item selection
},
child: Text(value[txtKey]), //item value
);
}).toList(),
);
});
}
/*
*@author: Elham Rababah
*@Date:17/5/2020
*@param: ClinicModel clinicInfo, Function changeLoadingStata
*@return:
*@desc: getDocProfiles
*/
getDocProfiles(ClinicModel clinicInfo, Function changeLoadingStata) {
ProfileReqModel docInfo = new ProfileReqModel(
doctorID: clinicInfo.doctorID,
clinicID: clinicInfo.clinicID,
license: true,
projectID: clinicInfo.projectID,
tokenID: '',
languageID: 2);
authProv.getDocProfiles(docInfo).then((res) {
if (res['MessageStatus'] == 1) {
print("DoctorProfileList ${res['DoctorProfileList'][0]}");
loginProcessCompleted(res['DoctorProfileList'][0], changeLoadingStata);
} else {
changeLoadingStata(false);
helpers.showErrorToast(res['ErrorEndUserMessage']);
}
}).catchError((err) {
print('$err');
});
}
} }

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -57,7 +58,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
return Text('Error: ${snapshot.error}'); return Text('Error: ${snapshot.error}');
} else { } else {
return Container( return Container(
width: SizeConfig.realScreenWidth * 0.90, width: SizeConfig.realScreenWidth * 0.80,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
@ -68,55 +69,54 @@ class _VerificationMethodsState extends State<VerificationMethods> {
), ),
), ),
SizedBox( SizedBox(
height: 40, height: 20,
), ),
Container( Container(
width: SizeConfig.realScreenWidth * 80, height: SizeConfig.realScreenHeight * 0.6,
child: Column( child: CustomScrollView(
crossAxisAlignment: CrossAxisAlignment.start, primary: false,
children: <Widget>[ slivers: <Widget>[
Row( SliverPadding(
mainAxisAlignment: spaceBetweenMethods, padding: const EdgeInsets.all(0),
children: <Widget>[ sliver: SliverGrid.count(
buildVerificationMethod( // childAspectRatio: 0.7,
context, crossAxisSpacing: 0,
'assets/images/verification_fingerprint_icon.png', mainAxisSpacing: 5,
'Fingerprint', crossAxisCount: 2,
() {}), children: <Widget>[
buildVerificationMethod( buildVerificationMethod(
context, context,
'assets/images/verification_faceid_icon.png', 'assets/images/verification_fingerprint_icon.png',
'Face ID', 'Fingerprint',
() {}), () {}),
], buildVerificationMethod(
context,
'assets/images/verification_faceid_icon.png',
'Face ID',
() {}),
buildVerificationMethod(
context,
'assets/images/verification_whatsapp_icon.png',
'WhatsApp', () {
sendActivationCodeByOtpNotificationType(
2, authProv);
}),
buildVerificationMethod(
context,
'assets/images/verification_sms_icon.png',
'SMS', () {
sendActivationCodeByOtpNotificationType(
1, authProv);
}),
],
),
), ),
SizedBox(
height: 40,
),
Row(
mainAxisAlignment: spaceBetweenMethods,
children: <Widget>[
buildVerificationMethod(
context,
'assets/images/verification_whatsapp_icon.png',
'WhatsApp', () {
sendActivationCodeByOtpNotificationType(
2, authProv);
}),
buildVerificationMethod(
context,
'assets/images/verification_sms_icon.png',
'SMS', () {
sendActivationCodeByOtpNotificationType(
1, authProv);
}),
],
)
], ],
), ),
// height: 500,
), ),
SizedBox( SizedBox(
height: SizeConfig.heightMultiplier * 2, // height: 20,
) )
], ],
), ),
@ -126,41 +126,43 @@ class _VerificationMethodsState extends State<VerificationMethods> {
}); });
} }
InkWell buildVerificationMethod(context, url, dec, Function fun) { Center buildVerificationMethod(context, url, dec, Function fun) {
return InkWell( return Center(
onTap: fun, child: InkWell(
child: Container( onTap: fun,
// height: SizeConfig.heightMultiplier *2, child: Container(
height: SizeConfig.heightMultiplier * 19, // height: SizeConfig.heightMultiplier *2,
width: SizeConfig.widthMultiplier * 37, height: SizeConfig.heightMultiplier * 19,
width: SizeConfig.widthMultiplier * 37,
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
width: 1, width: 1,
color: Hexcolor( color: Hexcolor(
'#CCCCCC') // <--- border width here '#CCCCCC') // <--- border width here
),
borderRadius: BorderRadius.all(Radius.circular(10))),
child: Column(
children: <Widget>[
Container(
margin: EdgeInsetsDirectional.only(
top: SizeConfig.heightMultiplier * 0.5),
child: Image.asset(
url,
height: SizeConfig.heightMultiplier * 11,
fit: BoxFit.cover,
), ),
borderRadius: BorderRadius.all(Radius.circular(10))),
child: Column(
children: <Widget>[
Container(
margin: EdgeInsetsDirectional.only(
top: SizeConfig.heightMultiplier * 0.5),
child: Image.asset(
url,
height: SizeConfig.heightMultiplier * 10,
fit: BoxFit.cover,
), ),
), SizedBox(
SizedBox( height: 10,
height: 10, ),
), Text(
Text( dec,
dec, style: TextStyle(fontSize: SizeConfig.textMultiplier * 2),
style: TextStyle(fontSize: SizeConfig.textMultiplier * 2), )
) ],
], ),
), ),
), ),
); );
@ -180,7 +182,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
Map model = { Map model = {
"LogInTokenID": _loggedUser['LogInTokenID'], "LogInTokenID": _loggedUser['LogInTokenID'],
"Channel": 9, "Channel": 9,
"MobileNumber": 785228065,//_loggedUser['MobileNumber'], "MobileNumber": 785228065, //_loggedUser['MobileNumber'],
"IPAdress": "11.11.11.11", "IPAdress": "11.11.11.11",
"LanguageID": 2, "LanguageID": 2,
"ProjectID": 15, //TODO : this should become daynamci "ProjectID": 15, //TODO : this should become daynamci

@ -50,35 +50,61 @@ class _DynamicElementsState extends State<DynamicElements> {
AppTextFormField( AppTextFormField(
textInputType: TextInputType.number, textInputType: TextInputType.number,
hintText: 'From', hintText: 'From',
controller: _fromDateController, controller: _fromDateController, //_fromDateController,
// validator: (value) {
// return TextValidator().validateDate(_fromDateController.text);
// },
inputFormatter: ONLY_DATE, inputFormatter: ONLY_DATE,
onTap: () { onTap: () {
_presentDatePicker('_selectedFromDate'); _presentDatePicker('_selectedFromDate');
}, },
// validator: (value) {
// return TextValidator().validateDate(_fromDateController.text);
// },
/*
*@author: Amjad Amireh
*@Date:13/5/2020
*@param:
*@return:check if field empty added static value
*@desc:
*/
onSaved: (value) { onSaved: (value) {
widget._patientSearchFormValues.From = _fromDateController.text; if (_fromDateController.text.toString().trim().isEmpty) {
widget._patientSearchFormValues.From = "0";
} else {
widget._patientSearchFormValues.From =
_fromDateController.text;
}
}, },
), ),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
AppTextFormField( AppTextFormField(
textInputType: TextInputType.number, textInputType: TextInputType.number,
hintText: 'TO', hintText: 'TO',
controller: _toDateController, controller: _fromDateController, //_toDateController,
onTap: () { onTap: () {
_presentDatePicker('_selectedToDate'); _presentDatePicker('_selectedToDate');
}, },
// validator: (value) { // validator: (value) {
// return TextValidator().validateDate(_toDateController.text); // return TextValidator().validateDate(_toDateController.text);
// }, // },
/*
*@author: Amjad Amireh
*@Date:13/5/2020
*@param:
*@return:check if field empty added static value
*@desc:
*/
inputFormatter: ONLY_DATE, inputFormatter: ONLY_DATE,
onSaved: (value) { onSaved: (value) {
widget._patientSearchFormValues.To = _toDateController.text; if (_toDateController.text.toString().trim().isEmpty) {
widget._patientSearchFormValues.To = "0";
} else {
widget._patientSearchFormValues.To = _toDateController.text;
}
}, },
), ),
], ],

@ -1,9 +1,6 @@
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/providers/patients_provider.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import '../../../config/size_config.dart'; import '../../../config/size_config.dart';
import '../../shared/profile_image_widget.dart'; import '../../shared/profile_image_widget.dart';

@ -0,0 +1,28 @@
import 'package:flutter/material.dart';
/*
*@author: Elham Rababah
*@Date:12/5/2020
*@param: error
*@return: StatelessWidget
*@desc: DrAppEmbeddedError class
*/
class DrAppEmbeddedError extends StatelessWidget {
const DrAppEmbeddedError({
Key key,
@required this.error,
}) : super(key: key);
final String error;
@override
Widget build(BuildContext context) {
return Center(
child: Text(
error,
style: TextStyle(color: Theme.of(context).errorColor),
textAlign: TextAlign.center,
),
);
}
}

@ -35,6 +35,7 @@ dependencies:
connectivity: ^0.4.8+2 connectivity: ^0.4.8+2
maps_launcher: ^1.2.0 maps_launcher: ^1.2.0
url_launcher: ^5.4.5 url_launcher: ^5.4.5
charts_flutter: ^0.9.0
# Qr code Scanner # Qr code Scanner
barcode_scan: ^3.0.1 barcode_scan: ^3.0.1

Loading…
Cancel
Save