merge-requests/79/head
unknown 4 years ago
commit 8c46c93e86

2
.gitignore vendored

@ -39,3 +39,5 @@ lib/generated_plugin_registrant.dart
.vscode/settings.json .vscode/settings.json
.vscode/settings.json .vscode/settings.json
.vscode/settings.json .vscode/settings.json
.vscode/settings.json
.vscode/settings.json

@ -1,7 +1,7 @@
{ {
"commentBox.styles": { "commentBox.styles": {
"defaultStyle": { "defaultStyle": {
"commentStartToken": "/* \n *@author: ibrahim albitar \n *@Date:27/4/2020 \n *@param: \n *@return:\n *@desc: ", "commentStartToken": "/* \n *@author: Amjad Amireh \n *@Date:27/4/2020 \n *@param: \n *@return:\n *@desc: ",
"commentEndToken": "\n */", "commentEndToken": "\n */",
"leftEdgeToken": " * ", "leftEdgeToken": " * ",
"rightEdgeToken": "", "rightEdgeToken": "",

@ -0,0 +1,67 @@
import 'dart:convert';
import 'package:doctor_app_flutter/config/config.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/util/helpers.dart';
import 'package:http/http.dart';
/*
*@author: Mohammad Aljammal
*@Date:28/5/2020
*@param: url, onSuccess callBack, onFailure callBack
*@return:
*@desc: convert DateTime to data formatted
*/
class BaseAppClient {
static Client client = HttpInterceptor().getClient();
static post(
String endPoint, {
Map<String, dynamic> body,
Function(dynamic response, int statusCode) onSuccess,
Function(String error, int statusCode) onFailure,
}) async {
String url = BASE_URL + endPoint;
try {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
String token = await sharedPref.getString(TOKEN);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
body['DoctorID'] = doctorProfile.doctorID;
body['EditedBy'] = doctorProfile.doctorID;
body['ProjectID'] = doctorProfile.projectID;
body['ClinicID'] = doctorProfile.clinicID;
body['TokenID'] = token;
body['LanguageID'] = LANGUAGE_ID;
body['stamp'] = STAMP;
body['IPAdress'] = IP_ADDRESS;
body['VersionID'] = VERSION_ID;
body['Channel'] = CHANNEL;
body['SessionID'] = SESSION_ID;
body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP;
body['PatientOutSA'] = PATIENT_OUT_SA;
if (await Helpers.checkConnection()) {
final response = await client.post(url, body: json.encode(body));
final int statusCode = response.statusCode;
if (statusCode < 200 || statusCode >= 400 || json == null) {
onFailure('Error While Fetching data', statusCode);
} else {
var parsed = json.decode(response.body.toString());
if (parsed['MessageStatus'] == 1) {
onSuccess(parsed, statusCode);
} else {
onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
}
}
} else {
onFailure('Please Check The Internet Connection', -1);
}
} catch (e) {
print(e);
onFailure(e.toString(), -1);
}
}
}

@ -58,6 +58,6 @@ const STAMP = '2020-04-27T12:17:17.721Z';
const IP_ADDRESS = '11.11.11.11'; const IP_ADDRESS = '11.11.11.11';
const VERSION_ID = 1.2; const VERSION_ID = 1.2;
const CHANNEL = 9; const CHANNEL = 9;
const SESSION_ID = '2Z7FX4Lokp'; const SESSION_ID = 'BlUSkYymTt';
const IS_LOGIN_FOR_DOCTOR_APP = true; const IS_LOGIN_FOR_DOCTOR_APP = true;
const PATIENT_OUT_SA = false; const PATIENT_OUT_SA = false;

@ -43,10 +43,12 @@ class MyApp extends StatelessWidget {
const Locale('en', ''), // English const Locale('en', ''), // English
], ],
theme: ThemeData( theme: ThemeData(
primarySwatch: Colors.blue, primarySwatch: Colors.grey,
primaryColor: Hexcolor('#B8382C'), primaryColor: Hexcolor('#B8382C'),
buttonColor: Hexcolor('#B8382C'), buttonColor: Hexcolor('#B8382C'),
fontFamily: 'WorkSans', fontFamily: 'WorkSans',
dividerColor: Colors.grey[200],
backgroundColor: Color.fromRGBO(255,255,255, 1)
), ),
initialRoute: INIT_ROUTE, initialRoute: INIT_ROUTE,
routes: routes, routes: routes,

@ -1,12 +1,14 @@
import 'package:doctor_app_flutter/util/helpers.dart';
class ListDoctorWorkingHoursTable { class ListDoctorWorkingHoursTable {
String date; DateTime date;
String dayName; String dayName;
String workingHours; String workingHours;
ListDoctorWorkingHoursTable({this.date, this.dayName, this.workingHours}); ListDoctorWorkingHoursTable({this.date, this.dayName, this.workingHours});
ListDoctorWorkingHoursTable.fromJson(Map<String, dynamic> json) { ListDoctorWorkingHoursTable.fromJson(Map<String, dynamic> json) {
date = json['Date'] ; date = Helpers.convertStringToDate(json['Date']) ;
dayName = json['DayName']; dayName = json['DayName'];
workingHours = json['WorkingHours']; workingHours = json['WorkingHours'];
} }
@ -19,3 +21,10 @@ class ListDoctorWorkingHoursTable {
return data; return data;
} }
} }
class WorkingHours {
String from;
String to;
WorkingHours({this.from,this.to});
}

@ -1,3 +1,5 @@
import 'package:doctor_app_flutter/util/helpers.dart';
class ListGtMyPatientsQuestions { class ListGtMyPatientsQuestions {
String setupID; String setupID;
int projectID; int projectID;
@ -6,7 +8,7 @@ class ListGtMyPatientsQuestions {
int patientID; int patientID;
int doctorID; int doctorID;
int requestType; int requestType;
String requestDate; DateTime requestDate;
String requestTime; String requestTime;
String remarks; String remarks;
int status; int status;
@ -58,7 +60,7 @@ class ListGtMyPatientsQuestions {
patientID = json['PatientID']; patientID = json['PatientID'];
doctorID = json['DoctorID']; doctorID = json['DoctorID'];
requestType = json['RequestType']; requestType = json['RequestType'];
requestDate = json['RequestDate']; requestDate = Helpers.convertStringToDate(json['RequestDate']) ;
requestTime = json['RequestTime']; requestTime = json['RequestTime'];
remarks = json['Remarks']; remarks = json['Remarks'];
status = json['Status']; status = json['Status'];

@ -0,0 +1,210 @@
import 'package:doctor_app_flutter/util/helpers.dart';
class MyReferralPatientModel {
int projectID;
int lineItemNo;
int doctorID;
int patientID;
String doctorName;
String doctorNameN;
String firstName;
String middleName;
String lastName;
String firstNameN;
String middleNameN;
String lastNameN;
int gender;
String dateofBirth;
String mobileNumber;
String emailAddress;
String patientIdentificationNo;
int patientType;
String admissionNo;
String admissionDate;
String roomID;
String bedID;
String nursingStationID;
String description;
String nationalityName;
String nationalityNameN;
String clinicDescription;
String clinicDescriptionN;
int referralDoctor;
int referringDoctor;
int referralClinic;
int referringClinic;
int referralStatus;
String referralDate;
String referringDoctorRemarks;
String referredDoctorRemarks;
String referralResponseOn;
int priority;
int frequency;
DateTime mAXResponseTime;
String age;
String frequencyDescription;
String genderDescription;
bool isDoctorLate;
bool isDoctorResponse;
String nursingStationName;
String priorityDescription;
String referringClinicDescription;
String referringDoctorName;
MyReferralPatientModel(
{this.projectID,
this.lineItemNo,
this.doctorID,
this.patientID,
this.doctorName,
this.doctorNameN,
this.firstName,
this.middleName,
this.lastName,
this.firstNameN,
this.middleNameN,
this.lastNameN,
this.gender,
this.dateofBirth,
this.mobileNumber,
this.emailAddress,
this.patientIdentificationNo,
this.patientType,
this.admissionNo,
this.admissionDate,
this.roomID,
this.bedID,
this.nursingStationID,
this.description,
this.nationalityName,
this.nationalityNameN,
this.clinicDescription,
this.clinicDescriptionN,
this.referralDoctor,
this.referringDoctor,
this.referralClinic,
this.referringClinic,
this.referralStatus,
this.referralDate,
this.referringDoctorRemarks,
this.referredDoctorRemarks,
this.referralResponseOn,
this.priority,
this.frequency,
this.mAXResponseTime,
this.age,
this.frequencyDescription,
this.genderDescription,
this.isDoctorLate,
this.isDoctorResponse,
this.nursingStationName,
this.priorityDescription,
this.referringClinicDescription,
this.referringDoctorName});
MyReferralPatientModel.fromJson(Map<String, dynamic> json) {
projectID = json['ProjectID'];
lineItemNo = json['LineItemNo'];
doctorID = json['DoctorID'];
patientID = json['PatientID'];
doctorName = json['DoctorName'];
doctorNameN = json['DoctorNameN'];
firstName = json['FirstName'];
middleName = json['MiddleName'];
lastName = json['LastName'];
firstNameN = json['FirstNameN'];
middleNameN = json['MiddleNameN'];
lastNameN = json['LastNameN'];
gender = json['Gender'];
dateofBirth = json['DateofBirth'];
mobileNumber = json['MobileNumber'];
emailAddress = json['EmailAddress'];
patientIdentificationNo = json['PatientIdentificationNo'];
patientType = json['PatientType'];
admissionNo = json['AdmissionNo'];
admissionDate = json['AdmissionDate'];
roomID = json['RoomID'];
bedID = json['BedID'];
nursingStationID = json['NursingStationID'];
description = json['Description'];
nationalityName = json['NationalityName'];
nationalityNameN = json['NationalityNameN'];
clinicDescription = json['ClinicDescription'];
clinicDescriptionN = json['ClinicDescriptionN'];
referralDoctor = json['ReferralDoctor'];
referringDoctor = json['ReferringDoctor'];
referralClinic = json['ReferralClinic'];
referringClinic = json['ReferringClinic'];
referralStatus = json['ReferralStatus'];
referralDate = json['ReferralDate'];
referringDoctorRemarks = json['ReferringDoctorRemarks'];
referredDoctorRemarks = json['ReferredDoctorRemarks'];
referralResponseOn = json['ReferralResponseOn'];
priority = json['Priority'];
frequency = json['Frequency'];
mAXResponseTime = Helpers.convertStringToDate(json['MAXResponseTime']);
age = json['Age'];
frequencyDescription = json['FrequencyDescription'];
genderDescription = json['GenderDescription'];
isDoctorLate = json['IsDoctorLate'];
isDoctorResponse = json['IsDoctorResponse'];
nursingStationName = json['NursingStationName'];
priorityDescription = json['PriorityDescription'];
referringClinicDescription = json['ReferringClinicDescription'];
referringDoctorName = json['ReferringDoctorName'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ProjectID'] = this.projectID;
data['LineItemNo'] = this.lineItemNo;
data['DoctorID'] = this.doctorID;
data['PatientID'] = this.patientID;
data['DoctorName'] = this.doctorName;
data['DoctorNameN'] = this.doctorNameN;
data['FirstName'] = this.firstName;
data['MiddleName'] = this.middleName;
data['LastName'] = this.lastName;
data['FirstNameN'] = this.firstNameN;
data['MiddleNameN'] = this.middleNameN;
data['LastNameN'] = this.lastNameN;
data['Gender'] = this.gender;
data['DateofBirth'] = this.dateofBirth;
data['MobileNumber'] = this.mobileNumber;
data['EmailAddress'] = this.emailAddress;
data['PatientIdentificationNo'] = this.patientIdentificationNo;
data['PatientType'] = this.patientType;
data['AdmissionNo'] = this.admissionNo;
data['AdmissionDate'] = this.admissionDate;
data['RoomID'] = this.roomID;
data['BedID'] = this.bedID;
data['NursingStationID'] = this.nursingStationID;
data['Description'] = this.description;
data['NationalityName'] = this.nationalityName;
data['NationalityNameN'] = this.nationalityNameN;
data['ClinicDescription'] = this.clinicDescription;
data['ClinicDescriptionN'] = this.clinicDescriptionN;
data['ReferralDoctor'] = this.referralDoctor;
data['ReferringDoctor'] = this.referringDoctor;
data['ReferralClinic'] = this.referralClinic;
data['ReferringClinic'] = this.referringClinic;
data['ReferralStatus'] = this.referralStatus;
data['ReferralDate'] = this.referralDate;
data['ReferringDoctorRemarks'] = this.referringDoctorRemarks;
data['ReferredDoctorRemarks'] = this.referredDoctorRemarks;
data['ReferralResponseOn'] = this.referralResponseOn;
data['Priority'] = this.priority;
data['Frequency'] = this.frequency;
data['MAXResponseTime'] = this.mAXResponseTime;
data['Age'] = this.age;
data['FrequencyDescription'] = this.frequencyDescription;
data['GenderDescription'] = this.genderDescription;
data['IsDoctorLate'] = this.isDoctorLate;
data['IsDoctorResponse'] = this.isDoctorResponse;
data['NursingStationName'] = this.nursingStationName;
data['PriorityDescription'] = this.priorityDescription;
data['ReferringClinicDescription'] = this.referringClinicDescription;
data['ReferringDoctorName'] = this.referringDoctorName;
return data;
}
}

@ -0,0 +1,78 @@
import 'package:doctor_app_flutter/config/config.dart';
class RequestAddReferredDoctorRemarks {
int projectID;
String admissionNo;
int lineItemNo;
String referredDoctorRemarks;
int editedBy;
int patientID;
int referringDoctor;
int languageID;
String stamp;
String iPAdress;
double versionID;
int channel;
String tokenID;
String sessionID;
bool isLoginForDoctorApp;
bool patientOutSA;
RequestAddReferredDoctorRemarks(
{this.projectID,
this.admissionNo,
this.lineItemNo,
this.referredDoctorRemarks,
this.editedBy,
this.patientID,
this.referringDoctor,
this.languageID = LANGUAGE_ID,
this.stamp = STAMP,
this.iPAdress = IP_ADDRESS,
this.versionID = VERSION_ID,
this.channel= CHANNEL,
this.tokenID,
this.sessionID = SESSION_ID,
this.isLoginForDoctorApp = IS_LOGIN_FOR_DOCTOR_APP,
this.patientOutSA = PATIENT_OUT_SA});
RequestAddReferredDoctorRemarks.fromJson(Map<String, dynamic> json) {
projectID = json['ProjectID'];
admissionNo = json['AdmissionNo'];
lineItemNo = json['LineItemNo'];
referredDoctorRemarks = json['ReferredDoctorRemarks'];
editedBy = json['EditedBy'];
patientID = json['PatientID'];
referringDoctor = json['ReferringDoctor'];
languageID = json['LanguageID'];
stamp = json['stamp'];
iPAdress = json['IPAdress'];
versionID = json['VersionID'];
channel = json['Channel'];
tokenID = json['TokenID'];
sessionID = json['SessionID'];
isLoginForDoctorApp = json['IsLoginForDoctorApp'];
patientOutSA = json['PatientOutSA'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ProjectID'] = this.projectID;
data['AdmissionNo'] = this.admissionNo;
data['LineItemNo'] = this.lineItemNo;
data['ReferredDoctorRemarks'] = this.referredDoctorRemarks;
data['EditedBy'] = this.editedBy;
data['PatientID'] = this.patientID;
data['ReferringDoctor'] = this.referringDoctor;
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;
data['PatientOutSA'] = this.patientOutSA;
return data;
}
}

@ -15,18 +15,18 @@ class RequestDoctorReply {
bool patientOutSA; bool patientOutSA;
RequestDoctorReply( RequestDoctorReply(
{this.projectID , {this.projectID ,
this.doctorID , this.doctorID ,
this.transactionNo = TRANSACTION_NO, this.transactionNo = TRANSACTION_NO ,
this.languageID = LANGUAGE_ID, this.languageID ,
this.stamp = STAMP, this.stamp ,
this.iPAdress = IP_ADDRESS, this.iPAdress,
this.versionID = VERSION_ID, this.versionID ,
this.channel = CHANNEL, this.channel,
this.tokenID , this.tokenID ,
this.sessionID = SESSION_ID, this.sessionID,
this.isLoginForDoctorApp = IS_LOGIN_FOR_DOCTOR_APP, this.isLoginForDoctorApp ,
this.patientOutSA = PATIENT_OUT_SA}); this.patientOutSA });
RequestDoctorReply.fromJson(Map<String, dynamic> json) { RequestDoctorReply.fromJson(Map<String, dynamic> json) {
projectID = json['ProjectID']; projectID = json['ProjectID'];

@ -0,0 +1,94 @@
import 'package:doctor_app_flutter/config/config.dart';
class RequestMyReferralPatientModel {
int projectID;
int clinicID;
int doctorID;
String firstName;
String middleName;
String lastName;
String patientMobileNumber;
String patientIdentificationID;
int patientID;
String from;
String to;
int languageID;
String stamp;
String iPAdress;
double versionID;
int channel;
String tokenID;
String sessionID;
bool isLoginForDoctorApp;
bool patientOutSA;
RequestMyReferralPatientModel(
{this.projectID,
this.clinicID,
this.doctorID,
this.firstName = "0",
this.middleName = "0",
this.lastName = "0",
this.patientMobileNumber = "0",
this.patientIdentificationID = "0",
this.patientID = 0,
this.from = "0",
this.to = "0",
this.languageID ,
this.stamp ,
this.iPAdress ,
this.versionID ,
this.channel ,
this.tokenID,
this.sessionID ,
this.isLoginForDoctorApp ,
this.patientOutSA });
RequestMyReferralPatientModel.fromJson(Map<String, dynamic> json) {
projectID = json['ProjectID'];
clinicID = json['ClinicID'];
doctorID = json['DoctorID'];
firstName = json['FirstName'];
middleName = json['MiddleName'];
lastName = json['LastName'];
patientMobileNumber = json['PatientMobileNumber'];
patientIdentificationID = json['PatientIdentificationID'];
patientID = json['PatientID'];
from = json['From'];
to = json['To'];
languageID = json['LanguageID'];
stamp = json['stamp'];
iPAdress = json['IPAdress'];
versionID = json['VersionID'];
channel = json['Channel'];
tokenID = json['TokenID'];
sessionID = json['SessionID'];
isLoginForDoctorApp = json['IsLoginForDoctorApp'];
patientOutSA = json['PatientOutSA'];
}
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['FirstName'] = this.firstName;
data['MiddleName'] = this.middleName;
data['LastName'] = this.lastName;
data['PatientMobileNumber'] = this.patientMobileNumber;
data['PatientIdentificationID'] = this.patientIdentificationID;
data['PatientID'] = this.patientID;
data['From'] = this.from;
data['To'] = this.to;
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;
data['PatientOutSA'] = this.patientOutSA;
return data;
}
}

@ -16,21 +16,21 @@ class RequestSchedule {
bool patientOutSA; bool patientOutSA;
int patientTypeID; int patientTypeID;
RequestSchedule({ RequestSchedule(
this.projectID, {this.projectID,
this.clinicID, this.clinicID,
this.doctorID, this.doctorID,
this.doctorWorkingHoursDays = 7, this.doctorWorkingHoursDays = 7,
this.languageID = LANGUAGE_ID, this.languageID,
this.stamp = STAMP, this.stamp,
this.iPAdress = IP_ADDRESS, this.iPAdress,
this.versionID = VERSION_ID, this.versionID,
this.channel = CHANNEL, this.channel,
this.tokenID, this.tokenID,
this.sessionID = SESSION_ID, this.sessionID,
this.isLoginForDoctorApp = IS_LOGIN_FOR_DOCTOR_APP, this.isLoginForDoctorApp,
this.patientOutSA = PATIENT_OUT_SA, this.patientOutSA,
this.patientTypeID = 1}); this.patientTypeID = 1});
RequestSchedule.fromJson(Map<String, dynamic> json) { RequestSchedule.fromJson(Map<String, dynamic> json) {
projectID = json['ProjectID']; projectID = json['ProjectID'];

@ -1,22 +1,12 @@
import 'dart:convert'; import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/models/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/request_doctor_reply.dart'; import 'package:doctor_app_flutter/models/request_doctor_reply.dart';
import 'package:doctor_app_flutter/models/list_gt_my_pationents_question_model.dart'; import 'package:doctor_app_flutter/models/list_gt_my_pationents_question_model.dart';
import 'package:doctor_app_flutter/util/helpers.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 '../interceptor/http_interceptor.dart';
class DoctorReplyProvider with ChangeNotifier { class DoctorReplyProvider with ChangeNotifier {
Client client =
HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]);
List<ListGtMyPatientsQuestions> listDoctorWorkingHoursTable = []; List<ListGtMyPatientsQuestions> listDoctorWorkingHoursTable = [];
bool isLoading = true; bool isLoading = true;
bool isError = false; bool isError = false;
String error = ''; String error = '';
@ -27,41 +17,22 @@ class DoctorReplyProvider with ChangeNotifier {
} }
getDoctorReply() async { getDoctorReply() async {
const url = BASE_URL + 'DoctorApplication.svc/REST/GtMyPatientsQuestions';
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
String token = await sharedPref.getString(TOKEN);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
_requestDoctorReply.doctorID = doctorProfile.doctorID;
_requestDoctorReply.projectID = doctorProfile.projectID;
_requestDoctorReply.tokenID = token;
try { try {
if (await Helpers.checkConnection()) { await BaseAppClient.post('DoctorApplication.svc/REST/GtMyPatientsQuestions',
final response = await client.post(url, body: _requestDoctorReply.toJson(),
body: json.encode(_requestDoctorReply.toJson())); onSuccess: (dynamic response, int statusCode) {
final int statusCode = response.statusCode; response['List_GtMyPatientsQuestions'].forEach((v) {
if (statusCode < 200 || statusCode >= 400 || json == null) { listDoctorWorkingHoursTable.add(ListGtMyPatientsQuestions.fromJson(v));
isLoading = false;
isError = true;
error = 'Error While Fetching data';
} else {
var parsed = json.decode(response.body.toString());
if (parsed['MessageStatus'] == 1) {
parsed['List_GtMyPatientsQuestions'].forEach((v) {
listDoctorWorkingHoursTable.add( ListGtMyPatientsQuestions.fromJson(v));
});
isError = false; isError = false;
isLoading = false; isLoading = false;
} else { });
isError = true; },
isLoading = false; onFailure: (String error, int statusCode) {
error = parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'] ; isError = true;
} isLoading = false;
} this.error= error;
} else { });
isLoading = false;
isError = true;
error = 'Please Check The Internet Connection';
}
notifyListeners(); notifyListeners();
} catch (error) { } catch (error) {
throw error; throw error;

@ -0,0 +1,74 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/models/my_referral_patient_model.dart';
import 'package:doctor_app_flutter/models/request_add_referred_doctor_remarks.dart';
import 'package:doctor_app_flutter/models/request_my_referral_patient_model.dart';
import 'package:flutter/cupertino.dart';
class MyReferralPatientProvider with ChangeNotifier {
List<MyReferralPatientModel> listMyReferralPatientModel = [];
bool isLoading = true;
bool isError = false;
String error = '';
RequestMyReferralPatientModel _requestMyReferralPatient = RequestMyReferralPatientModel();
RequestAddReferredDoctorRemarks _requestAddReferredDoctorRemarks = RequestAddReferredDoctorRemarks();
MyReferralPatientProvider() {
getMyReferralPatient();
}
getMyReferralPatient() async {
try {
await BaseAppClient.post(
'DoctorApplication.svc/REST/GtMyReferralPatient',
body: _requestMyReferralPatient.toJson(),
onSuccess: (dynamic response, int statusCode) {
response['List_MyReferralPatient'].forEach((v) {
listMyReferralPatientModel.add(MyReferralPatientModel.fromJson(v));
});
isError = false;
isLoading = false;
},
onFailure: (String error, int statusCode) {
isError = true;
isLoading = false;
this.error = error;
},
);
notifyListeners();
} catch (error) {
isLoading = false;
isError = true;
this.error = 'Something wrong happened, please contact the admin';
notifyListeners();
}
}
Future replay(
String referredDoctorRemarks, MyReferralPatientModel model) async {
try {
_requestAddReferredDoctorRemarks.admissionNo = model.admissionNo;
_requestAddReferredDoctorRemarks.patientID = model.patientID;
_requestAddReferredDoctorRemarks.referredDoctorRemarks = referredDoctorRemarks;
_requestAddReferredDoctorRemarks.lineItemNo = model.lineItemNo;
_requestAddReferredDoctorRemarks.referringDoctor = model.referringDoctor;
await BaseAppClient.post(
'DoctorApplication.svc/REST/AddReferredDoctorRemarks',
body: _requestAddReferredDoctorRemarks.toJson(),
onSuccess: (dynamic body, int statusCode) {
model.referredDoctorRemarks = referredDoctorRemarks;
listMyReferralPatientModel[
listMyReferralPatientModel.indexOf(model)] = model;
notifyListeners();
},
onFailure: (String error, int statusCode) {
throw (error);
},
);
} catch (error) {
throw error;
}
}
}

@ -1,21 +1,9 @@
import 'dart:convert'; import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/models/doctor_profile_model.dart';
import 'package:doctor_app_flutter/util/helpers.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 '../interceptor/http_interceptor.dart';
import '../models/list_doctor_working_hours_table_model.dart'; import '../models/list_doctor_working_hours_table_model.dart';
import '../models/request_schedule.dart'; import '../models/request_schedule.dart';
class ScheduleProvider with ChangeNotifier { class ScheduleProvider with ChangeNotifier {
Client client = HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]);
List<ListDoctorWorkingHoursTable> listDoctorWorkingHoursTable = []; List<ListDoctorWorkingHoursTable> listDoctorWorkingHoursTable = [];
bool isLoading = true; bool isLoading = true;
bool isError = false; bool isError = false;
@ -27,41 +15,26 @@ class ScheduleProvider with ChangeNotifier {
} }
getDoctorSchedule() async { getDoctorSchedule() async {
const url = BASE_URL + 'Doctors.svc/REST/GetDoctorWorkingHoursTable';
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
String token = await sharedPref.getString(TOKEN);
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
requestSchedule.doctorID = doctorProfile.doctorID;
requestSchedule.projectID = doctorProfile.projectID;
requestSchedule.clinicID = doctorProfile.clinicID;
requestSchedule.tokenID = token;
try { try {
await BaseAppClient.post('Doctors.svc/REST/GetDoctorWorkingHoursTable',
if (await Helpers.checkConnection()) { body: requestSchedule.toJson(),
final response = await client.post(url, body: json.encode(requestSchedule.toJson())); onSuccess: (dynamic response, int statusCode) {
final int statusCode = response.statusCode; response['List_DoctorWorkingHoursTable'].forEach((v) {
if (statusCode < 200 || statusCode >= 400 || json == null) { listDoctorWorkingHoursTable.add(new ListDoctorWorkingHoursTable.fromJson(v));
isLoading = false; });
isError = true; isError = false;
error = 'Error While Fetching data'; isLoading = false;
} else { }, onFailure: (String error, int statusCode) {
var parsed = json.decode(response.body.toString());
parsed['List_DoctorWorkingHoursTable'].forEach((v) {
listDoctorWorkingHoursTable
.add(new ListDoctorWorkingHoursTable.fromJson(v));
});
isError = false;
isLoading = false;
}
} else {
isLoading = false; isLoading = false;
isError = true; isError = true;
error = 'Please Check The Internet Connection'; this.error = error;
} });
notifyListeners();
} catch (e) {
isLoading = false;
isError = true;
error = 'Something wrong happened, please contact the admin';
notifyListeners(); notifyListeners();
} catch (error) {
throw error;
} }
} }
} }

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/screens/patients/profile/insurance_approvals_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/insurance_approvals_screen.dart';
import 'package:doctor_app_flutter/screens/patients/profile/patient_orders_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/patient_orders_screen.dart';
@ -18,6 +19,7 @@ import './screens/doctor/services_screen.dart';
import './screens/medicine/medicine_search_screen.dart'; import './screens/medicine/medicine_search_screen.dart';
import './screens/medicine/pharmacies_list_screen.dart'; import './screens/medicine/pharmacies_list_screen.dart';
import './screens/patients/patient_search_screen.dart'; import './screens/patients/patient_search_screen.dart';
import './screens/patients/patients_referred_screen.dart';
import './screens/patients/patients_screen.dart'; import './screens/patients/patients_screen.dart';
import './screens/patients/profile/lab_result/lab_orders_screen.dart'; import './screens/patients/profile/lab_result/lab_orders_screen.dart';
import './screens/patients/profile/patient_profile_screen.dart'; import './screens/patients/profile/patient_profile_screen.dart';
@ -41,6 +43,7 @@ const String QR_READER = 'qr-reader';
const String PATIENT_SEARCH = 'patients/patient-search'; const String PATIENT_SEARCH = 'patients/patient-search';
const String PATIENTS = 'patients/patients'; const String PATIENTS = 'patients/patients';
const String PATIENTS_PROFILE = 'patients/patients-profile'; const String PATIENTS_PROFILE = 'patients/patients-profile';
const String PATIENTS_REFERRED = 'patients/patients-referred';
const String BLOOD_BANK = 'blood-bank'; const String BLOOD_BANK = 'blood-bank';
const String DOCTOR_REPLY = 'doctor-reply'; const String DOCTOR_REPLY = 'doctor-reply';
const String MEDICINE_SEARCH = 'medicine/medicine-search'; const String MEDICINE_SEARCH = 'medicine/medicine-search';
@ -64,6 +67,7 @@ var routes = {
PROFILE: (_) => ProfileScreen(), PROFILE: (_) => ProfileScreen(),
MY_SCHEDULE: (_) => MyScheduleScreen(), MY_SCHEDULE: (_) => MyScheduleScreen(),
PATIENT_SEARCH: (_) => PatientSearchScreen(), PATIENT_SEARCH: (_) => PatientSearchScreen(),
PATIENTS_REFERRED:(_)=>PatientReferredScreen(),
PATIENTS: (_) => PatientsScreen(), PATIENTS: (_) => PatientsScreen(),
QR_READER: (_) => QrReaderScreen(), QR_READER: (_) => QrReaderScreen(),
BLOOD_BANK: (_) => BloodBankScreen(), BLOOD_BANK: (_) => BloodBankScreen(),

@ -108,28 +108,6 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
], ],
), ),
):Container(), ):Container(),
Column(
children: patientList.map((item) {
return InkWell(
onTap: (){
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
"patient": item,
});
},
child: AnimatedContainer(
duration: Duration(milliseconds: 200),
child: CardWithBgWidget(
widget: Container(
child: AppText(
'${item.firstName} ${item.lastName}',
fontSize: 2.5 * SizeConfig.textMultiplier,
),
),
),
),
);
}).toList()
),
], ],
), ),
@ -172,11 +150,12 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
case "0": case "0":
if (response['List_MyOutPatient'] != null) { if (response['List_MyOutPatient'] != null) {
setState(() { setState(() {
patientList = ModelResponse patientList = ModelResponse.fromJson(response['List_MyOutPatient']).list;
.fromJson(response['List_MyOutPatient'])
.list;
isLoading = false; isLoading = false;
}); });
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
"patient": patientList[0],
});
} else { } else {
setState(() { setState(() {
isError = true; isError = true;
@ -192,6 +171,9 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
isLoading = false; isLoading = false;
error = ""; error = "";
}); });
Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: {
"patient": patientList[0],
});
} else { } else {
setState(() { setState(() {
error = 'No patient'; error = 'No patient';

@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/providers/doctor_reply_provider.dart'; import 'package:doctor_app_flutter/providers/doctor_reply_provider.dart';
import 'package:doctor_app_flutter/providers/medicine_provider.dart'; import 'package:doctor_app_flutter/providers/medicine_provider.dart';
import 'package:doctor_app_flutter/providers/hospital_provider.dart'; import 'package:doctor_app_flutter/providers/hospital_provider.dart';
import 'package:doctor_app_flutter/providers/referral_patient_provider.dart';
import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart'; import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -16,6 +17,7 @@ import '../widgets/dashboard/dashboard_item_icons_texts.dart';
import '../widgets/dashboard/dashboard_item_texts_widget.dart'; import '../widgets/dashboard/dashboard_item_texts_widget.dart';
import '../widgets/shared/rounded_container_widget.dart'; import '../widgets/shared/rounded_container_widget.dart';
import 'doctor/doctor_reply_screen.dart'; import 'doctor/doctor_reply_screen.dart';
import 'doctor/my_referral_patient_screen.dart';
class DashboardScreen extends StatefulWidget { class DashboardScreen extends StatefulWidget {
DashboardScreen({Key key, this.title}) : super(key: key); DashboardScreen({Key key, this.title}) : super(key: key);
@ -271,12 +273,25 @@ class _DashboardScreenState extends State<DashboardScreen> {
), ),
Expanded( Expanded(
flex: 2, flex: 2,
child: new DashboardItemIconText( child: InkWell(
DoctorApp.home_icon, onTap: (){
"", Navigator.push(
"Discharge Patient", context,
showBorder: false, MaterialPageRoute(
backgroundColor: Colors.brown[400], builder: (context) => ChangeNotifierProvider(
create: (_) => MyReferralPatientProvider(),
child: MyReferralPatient(),
),
),
);
},
child: DashboardItemIconText(
DoctorApp.home_icon,
"",
"My Referral Patient",
showBorder: false,
backgroundColor: Colors.brown[400],
),
), ),
), ),
], ],

@ -1,11 +1,16 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/providers/doctor_reply_provider.dart'; import 'package:doctor_app_flutter/providers/doctor_reply_provider.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/doctor/doctor_reply_widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.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';
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_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/rounded_container_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:flutter/cupertino.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';
@ -40,81 +45,9 @@ class DoctorReplyScreen extends StatelessWidget {
children: [ children: [
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: _doctorReplyProvider.listDoctorWorkingHoursTable.map((reply) { children: _doctorReplyProvider.listDoctorWorkingHoursTable.map((reply) {
return CardWithBgWidget( return DoctorReplyWidget( reply: reply);
widget: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
reply.patientName,
fontSize: 2.5 * SizeConfig.textMultiplier,
),
SizedBox(
height: 8,
),
AppText(
reply.remarks,
fontSize: 2.5 * SizeConfig.textMultiplier,
),
SizedBox(
height: 5,
),
Row(
children: [
AppText(
TranslationBase.of(context).time,
fontSize: 2.5 * SizeConfig.textMultiplier,
),
Container(
margin: EdgeInsets.only(left: 10),
child: AppText(
reply.requestTime,
fontSize: 2.5 * SizeConfig.textMultiplier,
),
),
],
),
SizedBox(
height: 5,
),
Row(
children: [
AppText(
TranslationBase.of(context).fileNo,
fontSize: 2.5 * SizeConfig.textMultiplier,
),
Container(
margin: EdgeInsets.only(left: 10),
child: AppText(
'${reply.patientID}',
fontSize: 2.5 * SizeConfig.textMultiplier,
),
),
],
),
SizedBox(
height: 5,
),
Row(
children: [
AppText(
TranslationBase.of(context).mobileNo,
fontSize: 2.5 * SizeConfig.textMultiplier,
),
Container(
margin: EdgeInsets.only(left: 10),
child: AppText(
reply.mobileNumber,
fontSize: 2.5 * SizeConfig.textMultiplier,
),
),
],
),
],
),
),
);
}).toList(), }).toList(),
) )
], ],

@ -0,0 +1,65 @@
import 'package:doctor_app_flutter/providers/referral_patient_provider.dart';
import 'package:doctor_app_flutter/providers/schedule_provider.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/doctor/my_referral_patient_widget.dart';
import 'package:doctor_app_flutter/widgets/doctor/my_schedule_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:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../widgets/shared/app_scaffold_widget.dart';
class MyReferralPatient extends StatelessWidget {
MyReferralPatientProvider referralPatientProvider;
@override
Widget build(BuildContext context) {
referralPatientProvider = Provider.of(context);
return AppScaffold(
showBottomBar: false,
showAppDrawer: false,
appBarTitle: TranslationBase.of(context).mySchedule,
body: referralPatientProvider.isLoading
? DrAppCircularProgressIndeicator()
: referralPatientProvider.isError
? Center(
child: AppText(
referralPatientProvider.error,
color: Theme.of(context).errorColor,
),
)
: referralPatientProvider.listMyReferralPatientModel.length == 0
? Center(
child: AppText(
TranslationBase.of(context).errorNoSchedule,
color: Theme.of(context).errorColor,
),
)
: Container(
padding: EdgeInsetsDirectional.fromSTEB(20, 0, 20, 0),
child: ListView(
children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
SizedBox(
height: 10,
),
Container(
child: Column(
children: referralPatientProvider.listMyReferralPatientModel.map((item) {
return MyReferralPatientWidget(
myReferralPatientModel: item,
);
}).toList(),
),
),
],
),
],
),
),
);
}
}

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/providers/schedule_provider.dart'; import 'package:doctor_app_flutter/providers/schedule_provider.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/doctor/my_schedule_widget.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:flutter/material.dart'; import 'package:flutter/material.dart';
@ -7,7 +8,6 @@ import 'package:provider/provider.dart';
import '../../config/size_config.dart'; import '../../config/size_config.dart';
import '../../widgets/shared/app_scaffold_widget.dart'; import '../../widgets/shared/app_scaffold_widget.dart';
import '../../widgets/shared/card_with_bg_widget.dart';
class MyScheduleScreen extends StatelessWidget { class MyScheduleScreen extends StatelessWidget {
ScheduleProvider scheduleProvider; ScheduleProvider scheduleProvider;
@ -49,9 +49,7 @@ class MyScheduleScreen extends StatelessWidget {
SizedBox( SizedBox(
height: 20, height: 20,
), ),
AppText(TranslationBase.of(context).mySchedule,
fontSize:
2.5 * SizeConfig.textMultiplier),
scheduleListByDate(), scheduleListByDate(),
// scheduleListByDate('Wednesday, 8 April '), // scheduleListByDate('Wednesday, 8 April '),
], ],
@ -74,40 +72,7 @@ class MyScheduleScreen extends StatelessWidget {
Container( Container(
child: Column( child: Column(
children: scheduleProvider.listDoctorWorkingHoursTable.map((item) { children: scheduleProvider.listDoctorWorkingHoursTable.map((item) {
return CardWithBgWidget( return MyScheduleWidget(workingHoursTable: item,);
widget: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(item.dayName,
fontSize: 2.5 * SizeConfig.textMultiplier),
SizedBox(
height: 8,
),
!item.workingHours.contains('and')
? AppText(item.workingHours,
fontSize: 2.5 * SizeConfig.textMultiplier)
: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
item.workingHours.substring(
0, item.workingHours.indexOf('a')),
fontSize: 2.5 * SizeConfig.textMultiplier),
AppText(
item.workingHours.substring(
item.workingHours.indexOf('d') + 2,
),
fontSize: 2.5 * SizeConfig.textMultiplier),
],
),
SizedBox(
width: 8,
)
],
),
),
);
}).toList(), }).toList(),
), ),
), ),
@ -115,8 +80,4 @@ class MyScheduleScreen extends StatelessWidget {
); );
} }
TextStyle textStyle(size, [FontWeight weight]) {
return TextStyle(
fontSize: size * SizeConfig.textMultiplier, fontWeight: weight);
}
} }

@ -58,7 +58,16 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
PatientOutSA: false); PatientOutSA: false);
void _validateInputs() async { void _validateInputs() async {
print("============== _selectedType============"+ _selectedType);
if(_selectedType!='3')
{
try { try {
//====================
//_selectedType=='3'?
//=====================
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = DoctorProfileModel doctorProfile =
new DoctorProfileModel.fromJson(profile); new DoctorProfileModel.fromJson(profile);
@ -93,6 +102,15 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
} catch (err) { } catch (err) {
handelCatchErrorCase(err); handelCatchErrorCase(err);
} }
}
else
{
Navigator.of(context).pushNamed(PATIENTS_REFERRED, arguments: {
"patientSearchForm": _patientSearchFormValues,
"selectedType": _selectedType
});
}
} }
handelCatchErrorCase(err) { handelCatchErrorCase(err) {

@ -0,0 +1,102 @@
/*
*@author: Amjad Amireh Modified Referred Patients
*@Date:27/5/2020
*@desc:
*/
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/expandable_item_widget.dart';
import 'package:flutter/material.dart';
class PatientReferredScreen extends StatefulWidget {
PatientReferredScreen({Key key}) : super(key: key);
@override
_PatientReferredScreenState createState() => _PatientReferredScreenState();
}
class _PatientReferredScreenState extends State<PatientReferredScreen> {
String patientType;
String patientTypetitle;
List<Map<dynamic,dynamic>>list_product;
@override
void initState() {
super.initState();
list_product=new List();
for(var k=1;k<=5;k++)
{
Map map=Map();
map.putIfAbsent(getName(k), ()=>getContent());
list_product.add(map);
}
list_product.map((s){
}).map((list)=>list).toList();}
@override
Widget build(BuildContext context) {
List<String>list=List();
return AppScaffold(
appBarTitle: "My Referred Patients",//patientTypetitle,
body: Center(
child: ListView(
children: <Widget>[
for(final map in list_product)
for(final keys in map.keys)
ExpandableItem(keys,map[keys].toList())
,
],
)
),
);
}
String getName(int month)
{
switch(month)
{
case 1:
return "Mahmoud Shrouf";
case 2:
return "Mahmoud Shrouf";
case 3:
return "Mahmoud Shrouf";
case 4:
return "Mahmoud Shrouf";
case 5:
return "Mahmoud Shrouf";
case 6:
return "Mahmoud Shrouf";
case 7:
return "Mahmoud Shrouf";
case 8:
return "Mahmoud Shrouf";
case 9:
return "Mahmoud Shrouf";
case 10:
return "Mahmoud Shrouf";
case 11:
return "Mahmoud Shrouf";
case 12:
return "Mahmoud Shrouf";
}
}
List<dynamic> getContent()
{
return ["1","2","3","4","5","6"].toList();
}
}

@ -374,8 +374,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
.start, .start,
children: [ children: [
Image.network( Image.network(
"https://p.kindpng.com/picc/s/404-4042774_profile-photo-circle-circle-profile-picture-png-transparent.png", "https://p.kindpng.com/picc/s/404-4042774_profile-photo-circle-circle-profile-picture-png-transparent.png",
height: 100, height: 100,
width: 100), width: 100),
], ],
@ -472,8 +471,9 @@ class _PatientsScreenState extends State<PatientsScreen> {
), ),
), ),
SizedBox( SizedBox(
width:60, width:
), 60,
),
Container( Container(
child: child:
AppText( AppText(

@ -1,16 +1,70 @@
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign_req_model.dart';
import 'package:doctor_app_flutter/providers/patients_provider.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:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../../../config/size_config.dart'; import '../../../../config/size_config.dart';
import '../../../../models/patient/vital_sign_res_model.dart'; import '../../../../models/patient/vital_sign_res_model.dart';
import '../../../../widgets/patients/profile/profile_medical_info_widget.dart'; import '../../../../widgets/patients/profile/profile_medical_info_widget.dart';
import '../../../../widgets/shared/app_scaffold_widget.dart'; import '../../../../widgets/shared/app_scaffold_widget.dart';
import '../../../../widgets/shared/rounded_container_widget.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
class VitalSignDetailsScreen extends StatelessWidget { class VitalSignDetailsScreen extends StatefulWidget {
// VitalSignDetailsScreen({Key key, this.vitalSing}) : super(key: key); // VitalSignDetailsScreen({Key key, this.vitalSing}) : super(key: key);
@override
_VitalSignDetailsScreenState createState() => _VitalSignDetailsScreenState();
}
class _VitalSignDetailsScreenState extends State<VitalSignDetailsScreen> {
VitalSignResModel vitalSing; VitalSignResModel vitalSing;
String url = "assets/images/"; String url = "assets/images/";
PatientsProvider patientsProv;
var _isInit = true;
/*
*@author: Elham Rababah
*@Date:28/4/2020
*@param: context
*@return:
*@desc: getVitalSignList Function
*/
getVitalSignList(context) async {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String token = await sharedPref.getString(TOKEN);
String type = await sharedPref.getString(SLECTED_PATIENT_TYPE);
int inOutpatientType = 1;
if (type == '0') {
inOutpatientType = 2;
}
print(type);
VitalSignReqModel vitalSignReqModel = VitalSignReqModel(
patientID: patient.patientId,
projectID: patient.projectId,
tokenID: token,
patientTypeID: patient.patientType,
inOutpatientType: inOutpatientType,
languageID: 2,
transNo:
patient.admissionNo != null ? int.parse(patient.admissionNo) : 0);
patientsProv.getPatientVitalSign(vitalSignReqModel.toJson());
}
@override
void didChangeDependencies() {
super.didChangeDependencies();
if (_isInit) {
patientsProv = Provider.of<PatientsProvider>(context);
getVitalSignList(context);
}
_isInit = false;
}
final double contWidth = SizeConfig.realScreenWidth * 0.70; final double contWidth = SizeConfig.realScreenWidth * 0.70;
@override @override
@ -19,58 +73,54 @@ class VitalSignDetailsScreen extends StatelessWidget {
vitalSing = routeArgs['vitalSing']; vitalSing = routeArgs['vitalSing'];
return AppScaffold( return AppScaffold(
appBarTitle: "vital Sing ", appBarTitle: "vital Sing ",
body: RoundedContainer( body: CustomScrollView(
height: SizeConfig.realScreenHeight * 0.7, primary: false,
child: CustomScrollView( slivers: <Widget>[
primary: false, SliverPadding(
slivers: <Widget>[ padding: const EdgeInsets.all(10),
SliverPadding( sliver: SliverGrid.count(
padding: const EdgeInsets.all(10), childAspectRatio: 0.7,
sliver: SliverGrid.count( crossAxisSpacing: 10,
childAspectRatio: 0.7, mainAxisSpacing: 0,
crossAxisSpacing: 10, crossAxisCount: 3,
mainAxisSpacing: 0, children: <Widget>[
crossAxisCount: 3, InkWell(
children: <Widget>[ onTap: (){
InkWell( Navigator.of(context).pushNamed(BODY_MEASUREMENTS);
onTap: (){ },
Navigator.of(context).pushNamed(BODY_MEASUREMENTS); child: CircleAvatarWidget(
}, des: 'Body Measurements',
child: CircleAvatarWidget(
des: 'Body Measurements',
url: url + 'heartbeat.png',
),
),
CircleAvatarWidget(
des: 'Temperature',
url: url + 'heartbeat.png',
),
CircleAvatarWidget(
des: 'Pulse',
url: url + 'heartbeat.png',
),
CircleAvatarWidget(
des: 'Respiration',
url: url + 'heartbeat.png',
),
CircleAvatarWidget(
des: 'Blood Pressure',
url: url + 'heartbeat.png',
),
CircleAvatarWidget(
des: 'Oxygenation',
url: url + 'heartbeat.png',
),
CircleAvatarWidget(
des: 'Pain Scale',
url: url + 'heartbeat.png', url: url + 'heartbeat.png',
), ),
], ),
), CircleAvatarWidget(
des: 'Temperature',
url: url + 'heartbeat.png',
),
CircleAvatarWidget(
des: 'Pulse',
url: url + 'heartbeat.png',
),
CircleAvatarWidget(
des: 'Respiration',
url: url + 'heartbeat.png',
),
CircleAvatarWidget(
des: 'Blood Pressure',
url: url + 'heartbeat.png',
),
CircleAvatarWidget(
des: 'Oxygenation',
url: url + 'heartbeat.png',
),
CircleAvatarWidget(
des: 'Pain Scale',
url: url + 'heartbeat.png',
),
],
), ),
], ),
), ],
// height: 500,
)); ));
} }
} }

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/models/list_doctor_working_hours_table_model.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -17,7 +18,8 @@ DrAppToastMsg toastMsg = DrAppToastMsg();
*/ */
class Helpers { class Helpers {
int cupertinoPickerIndex = 0; int cupertinoPickerIndex = 0;
/*
/*
*@author: Elham Rababah *@author: Elham Rababah
*@Date:12/4/2020 *@Date:12/4/2020
*@param: context, items, decKey, onSelectFun *@param: context, items, decKey, onSelectFun
@ -42,7 +44,8 @@ class Helpers {
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[ children: <Widget>[
CupertinoButton( CupertinoButton(
child: Text('Cancel'.toUpperCase(), style: textStyle(context)), child: Text('Cancel'.toUpperCase(),
style: textStyle(context)),
onPressed: () { onPressed: () {
Navigator.pop(context); Navigator.pop(context);
}, },
@ -78,9 +81,9 @@ class Helpers {
TextStyle textStyle(context) => TextStyle textStyle(context) =>
TextStyle(color: Theme.of(context).primaryColor); TextStyle(color: Theme.of(context).primaryColor);
/* /*
*@author: Elham Rababah *@author: Elham Rababah
*@Date:12/4/2020 *@Date:12/4/2020
*@param: context, List items, decKey, onSelectFun *@param: context, List items, decKey, onSelectFun
*@return: Container widget *@return: Container widget
*@desc: buildPickerIterm this function will build the items of the cupertino *@desc: buildPickerIterm this function will build the items of the cupertino
@ -88,7 +91,8 @@ class Helpers {
buildPickerItems(context, List items, decKey, onSelectFun) { buildPickerItems(context, List items, decKey, onSelectFun) {
return CupertinoPicker( return CupertinoPicker(
magnification: 1.5, magnification: 1.5,
scrollController: FixedExtentScrollController(initialItem: cupertinoPickerIndex), scrollController:
FixedExtentScrollController(initialItem: cupertinoPickerIndex),
// backgroundColor: Colors.black87, // backgroundColor: Colors.black87,
children: items.map((item) { children: items.map((item) {
@ -98,7 +102,8 @@ class Helpers {
); );
}).toList(), }).toList(),
itemExtent: 25, //height of each item itemExtent: 25,
//height of each item
looping: true, looping: true,
onSelectedItemChanged: (int index) { onSelectedItemChanged: (int index) {
// selectitem =index; // selectitem =index;
@ -107,11 +112,11 @@ class Helpers {
); );
} }
/* /*
*@author: Elham Rababah *@author: Elham Rababah
*@Date:12/4/2020 *@Date:12/4/2020
*@param: msg *@param: msg
*@return: *@return:
*@desc: showErrorToast *@desc: showErrorToast
*/ */
showErrorToast([msg = null]) { showErrorToast([msg = null]) {
@ -142,6 +147,179 @@ class Helpers {
} }
} }
/*
*@author: Mohammad Aljammal
*@Date:26/5/2020
*@param: date in String formatted
*@return: DateTime
*@desc: convert String to DateTime
*/
static DateTime convertStringToDate(String date) {
const start = "/Date(";
const end = "+0300)";
final startIndex = date.indexOf(start);
final endIndex = date.indexOf(end, startIndex + start.length);
return DateTime.fromMillisecondsSinceEpoch(
int.parse(
date.substring(startIndex + start.length, endIndex),
),
);
}
/*
*@author: Amjad Amireh
*@Date:5/5/2020
*@param: checkDate
*@return: DateTime
*@desc: convert String to DateTime
*/
static String checkDate(String dateString) {
DateTime checkedTime = DateTime.parse(dateString);
DateTime currentTime = DateTime.now();
if ((currentTime.year == checkedTime.year) &&
(currentTime.month == checkedTime.month) &&
(currentTime.day == checkedTime.day)) {
return "Today";
} else if ((currentTime.year == checkedTime.year) &&
(currentTime.month == checkedTime.month)) {
if ((currentTime.day - checkedTime.day) == 1) {
return "YESTERDAY";
} else if ((currentTime.day - checkedTime.day) == -1) {
return "Tomorrow";
}
if ((currentTime.day - checkedTime.day) <= -2) {
return "Next Week";
} else {
return "Old Date";
}
}
return "Old Date";
}
/*
*@author: Mohammad Aljammal
*@Date:26/5/2020
*@param: month in int formatted
*@return: DateTime
*@desc: convert month in int to month name
*/
static getMonth(int month) {
switch (month) {
case 1:
return "Jan";
case 2:
return "Feb";
case 3:
return "Mar";
case 4:
return "Apr";
case 5:
return "May";
case 6:
return "Jun";
case 7:
return "Jul";
case 8:
return "Aug";
case 9:
return "Sep";
case 10:
return "Oct";
case 11:
return "Nov";
case 12:
return "Dec";
}
}
/*
*@author: Mohammad Aljammal
*@Date:26/5/2020
*@param: week day in int formatted
*@return: DateTime
*@desc: convert week day in int to week day name
*/
static getWeekDay(int weekDay) {
switch (weekDay) {
case 1:
return "Monday";
case 2:
return "Tuesday";
case 3:
return "Wednesday";
case 4:
return "Thursday";
case 5:
return "Friday";
case 6:
return "Saturday ";
case 7:
return "Sunday";
}
}
/*
*@author: Mohammad Aljammal
*@Date:26/5/2020
*@param: DateTime
*@return: data formatted like Apr 26,2020
*@desc: convert DateTime to data formatted
*/
static String getDate(DateTime dateTime) {
print(dateTime);
if (dateTime != null)
return getMonth(dateTime.month) +
" " +
dateTime.day.toString() +
"," +
dateTime.year.toString();
else
return "";
}
/*
*@author: Mohammad Aljammal
*@Date:26/5/2020
*@param: DateTime
*@return: data formatted like 26/4/2020
*@desc: convert DateTime to data formatted
*/
static String getDateFormatted(DateTime dateTime) {
print(dateTime);
if (dateTime != null)
return dateTime.day.toString() +
"/" +
dateTime.month.toString() +
"/" +
dateTime.year.toString();
else
return "";
}
/*
*@author: Mohammad Aljammal
*@Date:26/5/2020
*@param: String workingHours
*@return: List<WorkingHours>
*@desc: convert workingHours string to List<WorkingHours>
*/
static List<WorkingHours> getWorkingHours(String workingHours ){
List<WorkingHours> myWorkingHours =[];
List<String> listOfHours = workingHours.split('a');
listOfHours.forEach((element) {
WorkingHours workingHours = WorkingHours();
var from = element.substring(element.indexOf('m ') + 2 , element.indexOf('To')-2);
workingHours.from = from.trim();
var to = element.substring(element.indexOf('To') + 2);
workingHours.to = to.trim();
myWorkingHours.add(workingHours);
});
return myWorkingHours;
}
/* /*
*@author: Elham Rababah *@author: Elham Rababah
*@Date:12/5/2020 *@Date:12/5/2020

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'dart:io' show Platform;
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';
@ -31,6 +32,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
MainAxisAlignment spaceBetweenMethods = MainAxisAlignment.spaceBetween; MainAxisAlignment spaceBetweenMethods = MainAxisAlignment.spaceBetween;
Future _loggedUserFuture; Future _loggedUserFuture;
var _loggedUser; var _loggedUser;
var verificationMethod;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -43,6 +45,14 @@ class _VerificationMethodsState extends State<VerificationMethods> {
}); });
} }
@override
void didChangeDependencies() {
super.didChangeDependencies();
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
verificationMethod =
routeArgs != null ? routeArgs['verificationMethod'] : null;
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AuthProvider authProv = Provider.of<AuthProvider>(context); AuthProvider authProv = Provider.of<AuthProvider>(context);
@ -63,7 +73,9 @@ class _VerificationMethodsState extends State<VerificationMethods> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Text( Text(
"Please choose one of the Following option to verify", hideSilentMethods()
? 'As a first step, you need to verify by one of those methods'
: 'Please choose one of the Following option to verify',
style: TextStyle( style: TextStyle(
fontSize: 3.5 * SizeConfig.textMultiplier, fontSize: 3.5 * SizeConfig.textMultiplier,
), ),
@ -84,30 +96,28 @@ class _VerificationMethodsState extends State<VerificationMethods> {
mainAxisSpacing: 5, mainAxisSpacing: 5,
crossAxisCount: 2, crossAxisCount: 2,
children: <Widget>[ children: <Widget>[
buildVerificationMethod( Visibility(
context, visible: hideSilentMethods() ? false : true,
'assets/images/verification_fingerprint_icon.png', child: buildFingerprintMethod(
'Fingerprint', context, authProv),
() {}), replacement:
buildVerificationMethod( buildWhatsAppMethod(context, authProv),
context, ),
'assets/images/verification_faceid_icon.png', Visibility(
'Face ID', visible: hideSilentMethods() ? false : true,
() {}), child: buildFaceIDMethod(context, authProv),
buildVerificationMethod( replacement:
context, buildSMSMethod(context, authProv),
'assets/images/verification_whatsapp_icon.png', ),
'WhatsApp', () { Visibility(
sendActivationCodeByOtpNotificationType( visible:
2, authProv); hideSilentMethods() ? false : true,
}), child: buildWhatsAppMethod(
buildVerificationMethod( context, authProv)),
context, Visibility(
'assets/images/verification_sms_icon.png', visible: hideSilentMethods() ? false : true,
'SMS', () { child: buildSMSMethod(context, authProv),
sendActivationCodeByOtpNotificationType( ),
1, authProv);
}),
], ],
), ),
), ),
@ -115,9 +125,9 @@ class _VerificationMethodsState extends State<VerificationMethods> {
), ),
// height: 500, // height: 500,
), ),
SizedBox( SizedBox(
// height: 20, // height: 20,
) )
], ],
), ),
); );
@ -126,6 +136,67 @@ class _VerificationMethodsState extends State<VerificationMethods> {
}); });
} }
/*
*@author: Elham Rababah
*@Date:28/5/2020
*@param: BuildContext context, AuthProvider authProv
*@return: Center widget
*@desc: buildSMSMethod Methods widget
*/
Center buildSMSMethod(BuildContext context, AuthProvider authProv) {
return buildVerificationMethod(
context, 'assets/images/verification_sms_icon.png', 'SMS', () {
sendActivationCodeByOtpNotificationType(1, authProv);
});
}
/*
*@author: Elham Rababah
*@Date:28/5/2020
*@param: BuildContext context, AuthProvider authProv
*@return: Center widget
*@desc: build WhatsApp Methods widget
*/
Center buildWhatsAppMethod(BuildContext context, AuthProvider authProv) {
return buildVerificationMethod(
context, 'assets/images/verification_whatsapp_icon.png', 'WhatsApp',
() {
sendActivationCodeByOtpNotificationType(2, authProv);
});
}
/*
*@author: Elham Rababah
*@Date:28/5/2020
*@param: BuildContext context, AuthProvider authProv
*@return: Center widget
*@desc: build FaceID Methods widget
*/
Center buildFaceIDMethod(BuildContext context, AuthProvider authProv) {
return buildVerificationMethod(
context, 'assets/images/verification_faceid_icon.png', 'Face ID', () {
sendActivationCodeByOtpNotificationType(3, authProv);
});
}
/*
*@author: Elham Rababah
*@Date:28/5/2020
*@param: BuildContext context, AuthProvider authProv
*@return: Center widget
*@desc: build Fingerprint Methods widget
*/
Center buildFingerprintMethod(BuildContext context, AuthProvider authProv) {
return buildVerificationMethod(context,
'assets/images/verification_fingerprint_icon.png', 'Fingerprint', () {
sendActivationCodeByOtpNotificationType(4, authProv);
});
}
/*
*@author: Elham Rababah
*@Date:28/5/2020
*@param: BuildContext context, AuthProvider authProv
*@return: Center widget
*@desc: build Verification Methods widget
*/
Center buildVerificationMethod(context, url, dec, Function fun) { Center buildVerificationMethod(context, url, dec, Function fun) {
return Center( return Center(
child: InkWell( child: InkWell(
@ -168,6 +239,10 @@ class _VerificationMethodsState extends State<VerificationMethods> {
); );
} }
bool hideSilentMethods() {
return verificationMethod == 4 || verificationMethod == 3 ? true : false;
}
/* /*
*@author: Elham Rababah *@author: Elham Rababah
*@Date:15/4/2020 *@Date:15/4/2020
@ -176,9 +251,10 @@ 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) {
widget.changeLoadingStata(true);
// 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);
Map model = { Map model = {
"LogInTokenID": _loggedUser['LogInTokenID'], "LogInTokenID": _loggedUser['LogInTokenID'],
"Channel": 9, "Channel": 9,
@ -190,10 +266,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
"UserName": _loggedUser['List_MemberInformation'][0]['MemberID'], "UserName": _loggedUser['List_MemberInformation'][0]['MemberID'],
"OTP_SendType": oTPSendType "OTP_SendType": oTPSendType
}; };
// print('$_loggedUser');
// print(oTPSendType);
authProv.sendActivationCodeByOtpNotificationType(model).then((res) { authProv.sendActivationCodeByOtpNotificationType(model).then((res) {
// Navigator.of(context).pushNamed(VERIFY_ACCOUNT);
widget.changeLoadingStata(false); widget.changeLoadingStata(false);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
@ -202,7 +275,6 @@ class _VerificationMethodsState extends State<VerificationMethods> {
print(res['ErrorEndUserMessage']); print(res['ErrorEndUserMessage']);
helpers.showErrorToast(res['ErrorEndUserMessage']); helpers.showErrorToast(res['ErrorEndUserMessage']);
} }
// Navigator.of(context).pushNamed(HOME);
}).catchError((err) { }).catchError((err) {
print('$err'); print('$err');
widget.changeLoadingStata(false); widget.changeLoadingStata(false);
@ -211,6 +283,12 @@ class _VerificationMethodsState extends State<VerificationMethods> {
}); });
} else { } else {
// TODO route to this page with parameters to inicate we should present 2 option // TODO route to this page with parameters to inicate we should present 2 option
if (Platform.isAndroid && oTPSendType == 3) {
helpers.showErrorToast('Your device not support this feature');
} else {
Navigator.of(context).pushNamed(VERIFICATION_METHODS,
arguments: {'verificationMethod': oTPSendType});
}
} }
} }
} }

@ -0,0 +1,177 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/list_gt_my_pationents_question_model.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class DoctorReplyWidget extends StatefulWidget {
final ListGtMyPatientsQuestions reply;
bool isShowMore = false;
DoctorReplyWidget({Key key, this.reply});
@override
_DoctorReplyWidgetState createState() => _DoctorReplyWidgetState();
}
class _DoctorReplyWidgetState extends State<DoctorReplyWidget> {
@override
Widget build(BuildContext context) {
return Stack(
children: <Widget>[
Container(
margin: EdgeInsets.symmetric(vertical: 10.0),
width: double.infinity,
decoration: BoxDecoration(
color: Hexcolor('#FFFFFF'),
borderRadius: BorderRadius.all(
Radius.circular(20.0),
),
),
child: Container(
margin: EdgeInsets.all(5),
child: Column(
children: <Widget>[
SizedBox(height: 18,),
Container(
margin: EdgeInsets.only(right: 15),
child: Row(
children: <Widget>[
SizedBox(width: 5,),
LargeAvatar(name: widget.reply.patientName,url: '',),
SizedBox(width: 15,),
Expanded(
child: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
widget.reply.patientName,
fontSize: 1.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
SizedBox(
height: 5,
),
Row(
children: [
AppText(
TranslationBase.of(context).fileNo,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
Container(
margin: EdgeInsets.only(left: 5),
child: AppText(
'${widget.reply.patientID}',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
),
],
),
SizedBox(
height: 5,
),
Row(
children: [
AppText(
TranslationBase.of(context).mobileNo,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
Container(
margin: EdgeInsets.only(left: 5),
child: AppText(
widget.reply.mobileNumber,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
),
],
),
SizedBox(
height: 5,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
width: 70,
height: 20,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(60.0)),
color: Colors.green[600]
),
child: Center(
child: AppText(
widget.reply.requestTime,
fontSize: 1.5 * SizeConfig.textMultiplier,
color: Colors.white,
),
),
),
Container(
child: AppText(
'${Helpers.getDate(widget.reply.requestDate)}',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
color: Colors.black,
),
),
],
),
],
),
),
)
],
),
),
!widget.isShowMore ? SizedBox(height: 18,) :
AnimatedContainer(
duration: Duration(milliseconds: 200),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Divider(color: Colors.grey),
SizedBox(height: 5,),
AppText(
widget.reply.remarks,
fontSize: 2.5 * SizeConfig.textMultiplier,
//fontWeight: FontWeight.bold,
),
SizedBox(height: 10,)
],
),
),
],
),
),
),
Positioned(
right: 5,
top: 20,
child: InkWell(
onTap: (){
setState(() {
widget.isShowMore = !widget.isShowMore;
});
},
child: Icon(widget.isShowMore? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down)),
)
],
);
}
}

@ -0,0 +1,338 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/my_referral_patient_model.dart';
import 'package:doctor_app_flutter/providers/referral_patient_provider.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_button.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class MyReferralPatientWidget extends StatefulWidget {
final MyReferralPatientModel myReferralPatientModel;
MyReferralPatientWidget({Key key, this.myReferralPatientModel});
@override
_MyReferralPatientWidgetState createState() =>
_MyReferralPatientWidgetState();
}
class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
bool _showDetails = false;
bool _isLoading = false;
final _formKey = GlobalKey<FormState>();
String error;
TextEditingController answerController;
@override
void initState() {
answerController = new TextEditingController(text: widget.myReferralPatientModel.referredDoctorRemarks ?? '');
super.initState();
}
@override
Widget build(BuildContext context) {
return CardWithBgWidgetNew(
widget: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
AppText(
'${widget.myReferralPatientModel.firstName} ${widget.myReferralPatientModel.lastName}',
fontSize: 2.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
InkWell(
onTap: () {
setState(() {
_showDetails = !_showDetails;
});
},
child: Icon(_showDetails
? Icons.keyboard_arrow_up
: Icons.keyboard_arrow_down)),
],
),
!_showDetails
? Container()
: AnimatedContainer(
duration: Duration(milliseconds: 200),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Divider(color: Colors.grey),
Row(
children: <Widget>[
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
'File No',
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
'${widget.myReferralPatientModel.referringDoctor}',
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
),
Container(
height: SizeConfig.realScreenWidth * 0.1,
width: 0.8,
color: Colors.grey,
margin: EdgeInsets.only(left: 15, right: 15),
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
'Referring Doctor',
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
widget.myReferralPatientModel
.referringClinicDescription,
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
),
],
),
Divider(color: Colors.grey),
Row(
children: <Widget>[
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
'Referring Clinic',
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
'${widget.myReferralPatientModel.referringClinicDescription}',
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
),
Container(
height: SizeConfig.realScreenWidth * 0.1,
width: 0.8,
color: Colors.grey,
margin: EdgeInsets.only(left: 15, right: 15),
),
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
'Frequency',
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
widget.myReferralPatientModel
.frequencyDescription,
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
),
],
),
Divider(color: Colors.grey),
Row(
children: <Widget>[
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
'Priority',
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
'${widget.myReferralPatientModel.priorityDescription}',
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
),
Container(
height: SizeConfig.realScreenWidth * 0.1,
width: 0.8,
color: Colors.grey,
margin: EdgeInsets.only(left: 15, right: 15),
),
Expanded(
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
'Max Response Time',
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
AppText(
Helpers.getDateFormatted(widget
.myReferralPatientModel
.mAXResponseTime),
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
),
),
],
),
Divider(color: Colors.grey),
AppText(
'Clinic Details and Remarks',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
),
SizedBox(
height: 5,
),
Texts(
'73 years old female known case of HTN and dm on regular medication one day prior the patient had rt sided weakness suddenly and reduced level of conscoiusness no vomting no headache no bluriing of vision no other relevant symptoms.\r\nPMH:No history of similar condition no history of surgey or blood transfusions\r\nCT brain was done apparently effaced left insular cortex',
style: "bodyText1",
readMore: true,
textAlign: TextAlign.start,
maxLength: 100),
SizedBox(
height: 5,
),
AppText(
'Answer/Suggestions',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
),
SizedBox(
height: 5,
),
Form(
key: _formKey,
child: TextFields(
maxLines: 2,
minLines: 2,
hintText: 'Answer the patient',
initialValue: widget.myReferralPatientModel.referredDoctorRemarks ?? '',
readOnly: _isLoading,
validator: (value) {
if (value.isEmpty)
return "please enter answer";
else
return null;
},
),
),
SizedBox(height: 10.0),
if (error != null && error.isNotEmpty)
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.0),
color: Theme.of(context)
.errorColor
.withOpacity(0.06),
),
padding: EdgeInsets.symmetric(
vertical: 8.0, horizontal: 12.0),
child: Row(
children: <Widget>[
Expanded(
child: Texts(error ?? "",
style: "bodyText1",
color: Theme.of(context)
.errorColor)),
],
),
),
SizedBox(height: 10.0),
],
),
SizedBox(height: 10.0),
Container(
width: double.infinity,
child: Button(
onTap: () async {
final form = _formKey.currentState;
if (form.validate()) {
setState(() {
_isLoading = true;
});
try {
await Provider.of<MyReferralPatientProvider>(context, listen: false).replay(answerController.text.toString(), widget.myReferralPatientModel);
setState(() {
_isLoading = false;
});
} catch (e) {
setState(() {
error = e.toString();
_isLoading = false;
});
}
}
},
title: 'Reply',
loading: _isLoading,
),
)
],
)
],
),
)
],
),
),
);
}
}

@ -0,0 +1,79 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/list_doctor_working_hours_table_model.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class MyScheduleWidget extends StatelessWidget {
final ListDoctorWorkingHoursTable workingHoursTable;
MyScheduleWidget({Key key, this.workingHoursTable});
@override
Widget build(BuildContext context) {
List<WorkingHours> workingHours = Helpers.getWorkingHours(workingHoursTable.workingHours);
return CardWithBgWidgetNew(
widget: Container(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
AppText(workingHoursTable.dayName,
fontSize: 2.5 * SizeConfig.textMultiplier),
AppText(
' ${workingHoursTable.date.day}/${workingHoursTable.date.month}/${workingHoursTable.date.year}',
fontSize: 2.2 * SizeConfig.textMultiplier,fontWeight: FontWeight.w300,),
],
),
SizedBox(
height: 8,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: workingHours.map((work) {
return Container(
child: Column(
children: <Widget>[
Divider(color: Colors.grey),
Row(
children: <Widget>[
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText('From',fontSize: 2.2 * SizeConfig.textMultiplier,fontWeight: FontWeight.bold,),
AppText(work.from,fontSize: 2.2 * SizeConfig.textMultiplier,fontWeight: FontWeight.w300,)
],
),
),
Container(height: SizeConfig.realScreenWidth * 0.1 ,width: 0.8,color: Colors.grey,
margin: EdgeInsets.only(left: 15,right: 15),),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText('To',fontSize: 2.2 * SizeConfig.textMultiplier,fontWeight: FontWeight.bold,),
AppText(work.to,fontSize: 2.2 * SizeConfig.textMultiplier,fontWeight: FontWeight.w300,)
],
),
),
],
)
],
),
);
}).toList(),
),
SizedBox(
width: 8,
)
],
),
),
);
}
}

@ -0,0 +1,42 @@
import 'package:flutter/material.dart';
class AvatarGradients{
static List<Color> getGradients (String name) {
int code = (name?.length ?? 0) > 0 ? name.toUpperCase()[0].codeUnits[0] : 1;
code += (name?.length ?? 0) > 1 ? name.toUpperCase()[1].codeUnits[0] : 0;
List<List<Color>> colors = [
[
Color.fromRGBO(150, 222, 218, 1.0),
Color.fromRGBO(80, 201, 195, 1.0),
],
[
Color.fromRGBO(102, 126, 254, 1.0),
Color.fromRGBO(148, 75, 192, 1.0),
],
[
Color.fromRGBO(255, 177, 153, 1.0),
Color.fromRGBO(255, 8, 68, 1.0),
],
[
Color.fromRGBO(100, 210, 255, 1.0),
Color.fromRGBO(10, 60, 255, 1.0),
],
[
Color.fromRGBO(83, 120, 149, 1.0),
Color.fromRGBO(9, 32, 63, 1.0),
],
[
Color.fromRGBO(48, 210, 190, 1.0),
Color.fromRGBO(53, 132, 167, 1.0),
],
[
Color.fromRGBO(255, 179, 169, 1.0),
Color.fromRGBO(245, 103, 144, 1.0),
]
];
return colors[code % colors.length];
}
}

@ -0,0 +1,74 @@
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'avatar_gradients.dart';
class LargeAvatar extends StatelessWidget {
LargeAvatar({Key key, this.name, this.url, this.disableProfileView: false})
: super(key: key);
final String name;
final String url;
final bool disableProfileView;
Widget _getAvatar() {
if (url != null && url.isNotEmpty && Uri.parse(url).isAbsolute) {
return Center(
child: ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(60.0)),
child: Image.network(
url.trim(),
fit: BoxFit.cover,
width: 90.0,
height: 90.0,
),
),
);
} else if (name == null || name.isEmpty) {
return Center(
child: AppText(
'DR',
color: Colors.white,
));
} else {
return Center(
child: AppText(
name[0].toUpperCase(),
color: Colors.white,fontSize: 18,fontWeight: FontWeight.bold,
));
}
}
@override
Widget build(BuildContext context) {
return InkWell(
onTap: disableProfileView
? null
: () {
//TODO when we need that
},
child: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
begin: Alignment(-1, -1),
end: Alignment(1, 1),
colors: [
Colors.grey[100],
Colors.grey[800],
]
),
boxShadow: [
BoxShadow(
color: Color.fromRGBO(0, 0, 0, 0.08),
offset: Offset(0.0, 5.0),
blurRadius: 16.0)
],
borderRadius: BorderRadius.all(Radius.circular(50.0)),
),
width: 90.0,
height: 90.0,
child: _getAvatar()),
);
}
}

@ -47,7 +47,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget {
children: <Widget>[ children: <Widget>[
InkWell( InkWell(
onTap: () { onTap: () {
navigator(context, VITAL_SIGN); navigator(context, VITAL_SIGN_DETAILS);
}, },
child: CircleAvatarWidget( child: CircleAvatarWidget(
des: 'Vital Sign', des: 'Vital Sign',

@ -0,0 +1,239 @@
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
class Texts extends StatefulWidget {
final String text;
final String variant;
final Color color;
final bool bold;
final bool regular;
final bool medium;
final int maxLength;
final bool italic;
final TextAlign textAlign;
final int maxLines;
final bool readMore;
final String style;
final bool allowExpand;
Texts(this.text, {Key key, this.variant, this.color,
this.bold, this.regular, this.medium, this.allowExpand = true,
this.italic:false, this.textAlign, this.maxLength=60,
this.maxLines, this.readMore=false, this.style
}) : super(key: key);
@override
_TextsState createState() => _TextsState();
}
class _TextsState extends State<Texts> {
bool hidden = false;
String text = "";
@override
void didUpdateWidget(Texts oldWidget) {
setState(() {
if (widget.style=="overline")
text = widget.text.toUpperCase();
else {
text = widget.text;
}
});
super.didUpdateWidget(oldWidget);
}
@override
void initState() {
hidden = widget.readMore;
if (widget.style=="overline")
text = widget.text.toUpperCase();
else {
text = widget.text;
}
super.initState();
}
double _getFontSize () {
switch (widget.variant) {
case "heading0":
return 40.0;
case "heading":
return 32.0;
case "heading2":
return 28.0;
case "heading3":
return 18.0;
case "body1":
return 18.0;
case "body2":
return 20.0;
case "body2Link":
return 16.0;
case "caption":
return 16.0;
case "caption2":
return 14.0;
case "bodyText":
return 15.0;
case "bodyText2":
return 17.0;
case "caption3":
return 12.0;
case "caption4":
return 9.0;
case "overline":
return 11.0;
case "date":
return 24.0;
default:
return 16.0;
}
}
FontWeight _getFontWeight () {
if (widget.bold ?? false) {
return FontWeight.w900;
} else if (widget.regular ?? false) {
return FontWeight.w500;
} else if (widget.medium ?? false) {
return FontWeight.w800;
}
else {
if (widget.style==null) {
switch (widget.variant) {
case "heading":
return FontWeight.w900;
case "heading2":
return FontWeight.w900;
case "heading3":
return FontWeight.w900;
case "body1":
return FontWeight.w800;
case "body2":
return FontWeight.w900;
case "body2Link":
return FontWeight.w800;
case "caption":
return FontWeight.w700;
case "caption2":
return FontWeight.w700;
case "bodyText":
return FontWeight.w500;
case "bodyText2":
return FontWeight.w500;
case "caption3":
return FontWeight.w600;
case "caption4":
return FontWeight.w600;
case "overline":
return FontWeight.w800;
case "date":
return FontWeight.w900;
default:
return FontWeight.w500;
}
} else {
return null;
}
}
}
@override
Widget build(BuildContext context) {
TextStyle _getFontStyle () {
switch (widget.style) {
case "headline2":
return Theme.of(context).textTheme.headline2;
case "headline3":
return Theme.of(context).textTheme.headline3;
case "headline4":
return Theme.of(context).textTheme.headline4;
case "headline5":
return Theme.of(context).textTheme.headline5;
case "headline6":
return Theme.of(context).textTheme.headline6;
case "bodyText2":
return Theme.of(context).textTheme.bodyText2;
case "bodyText_15":
return Theme.of(context).textTheme.bodyText2.copyWith(fontSize: 15.0);
case "bodyText1":
return Theme.of(context).textTheme.bodyText1;
case "caption":
return Theme.of(context).textTheme.caption;
case "overline":
return Theme.of(context).textTheme.overline;
case "button":
return Theme.of(context).textTheme.button;
default :
return TextStyle();
}
}
return Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Stack(
children: <Widget>[
Text(!hidden ? text : (text.substring(0, text.length > widget.maxLength ? widget.maxLength : text.length)),
textAlign: widget.textAlign,
overflow: widget.maxLines!=null ? ((widget.maxLines > 1) ? TextOverflow.fade : TextOverflow.ellipsis) : null,
maxLines: widget.maxLines ?? null,
style: widget.style != null ? _getFontStyle().copyWith(
fontStyle: widget.italic ? FontStyle.italic : null,
color: widget.color!=null ? widget.color : null,
fontWeight: _getFontWeight(),
) : TextStyle(
fontStyle: widget.italic ? FontStyle.italic : null,
color: widget.color!=null ? widget.color : Colors.black,
fontSize: _getFontSize(),
letterSpacing: widget.variant=="overline" ? 1.5 : null,
fontWeight: _getFontWeight(),
)
),
if (widget.readMore && text.length > widget.maxLength && hidden)
Positioned(
bottom: 0,
left: 0,
right: 0,
child: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [
Theme.of(context).backgroundColor,
Theme.of(context).backgroundColor.withOpacity(0),
],
begin: Alignment.bottomCenter,
end: Alignment.topCenter
)
),
height: 30,
),
)
],
),
if (widget.allowExpand && widget.readMore && text.length > widget.maxLength)
Padding(
padding: EdgeInsets.only(top: 8.0, right: 8.0, bottom: 8.0),
child: InkWell(
onTap: () {
setState(() {
hidden=!hidden;
});
},
child: Text(hidden ? "Read More" : "Read less",
style: _getFontStyle().copyWith(
color: Hexcolor('#515b5d'),
fontWeight: FontWeight.w800,
fontFamily: "WorkSans"
)
),
),
),
],
);
}
}

@ -0,0 +1,185 @@
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class TextFields extends StatefulWidget {
TextFields({Key key, this.type, this.hintText, this.suffixIcon, this.autoFocus, this.onChanged, this.initialValue, this.minLines, this.maxLines, this.inputFormatters, this.padding, this.focus=false, this.maxLengthEnforced=true,
this.suffixIconColor, this.inputAction, this.onSubmit, this.keepPadding=true, this.textCapitalization = TextCapitalization.none, this.onTap, this.controller, this.keyboardType, this.validator, this.borderOnlyError=false,
this.onSaved, this.onSuffixTap, this.readOnly: false, this.maxLength, this.prefixIcon, this.bare=false, this.fontSize=16.0, this.fontWeight=FontWeight.w700, this.autoValidate=false}) : super(key: key);
final String hintText;
final String initialValue;
final String type;
final bool autoFocus;
final IconData suffixIcon;
final Color suffixIconColor;
final IconData prefixIcon;
final VoidCallback onTap;
final TextEditingController controller;
final TextInputType keyboardType;
final FormFieldValidator validator;
final Function onSaved;
final Function onSuffixTap;
final Function onChanged;
final Function onSubmit;
final bool readOnly;
final int maxLength;
final int minLines;
final int maxLines;
final bool maxLengthEnforced;
final bool bare;
final TextInputAction inputAction;
final double fontSize;
final FontWeight fontWeight;
final bool keepPadding;
final TextCapitalization textCapitalization;
final List<TextInputFormatter> inputFormatters;
final bool autoValidate;
final EdgeInsets padding;
final bool focus;
final bool borderOnlyError;
@override
_TextFieldsState createState() => _TextFieldsState();
}
class _TextFieldsState extends State<TextFields> {
final FocusNode _focusNode = FocusNode();
bool focus = false;
bool view = false;
@override
void initState() {
super.initState();
_focusNode.addListener(() {
setState(() {
focus = _focusNode.hasFocus;
});
});
}
@override
void didUpdateWidget(TextFields oldWidget) {
if (widget.focus)
_focusNode.requestFocus();
super.didUpdateWidget(oldWidget);
}
@override
void dispose() {
_focusNode.dispose();
super.dispose();
}
Widget _buildSuffixIcon() {
switch (widget.type) {
case "password":
{ return Padding(
padding: const EdgeInsets.only(right: 8.0),
child: view ?
InkWell(onTap: () {this.setState(() { view= false; });}, child: Icon(EvaIcons.eye, size: 24.0, color: Color.fromRGBO(78, 62, 253, 1.0)))
:
InkWell(onTap: () {this.setState(() { view= true; });}, child: Icon(EvaIcons.eyeOff, size: 24.0, color: Colors.grey[500]))
);}
break;
default:
if (widget.suffixIcon!=null)
return InkWell(onTap: widget.onSuffixTap, child: Icon(widget.suffixIcon, size: 22.0, color: widget.suffixIconColor!=null ? widget.suffixIconColor : Colors.grey[500]));
else
return null;
}
}
bool _determineReadOnly() {
if (widget.readOnly!=null && widget.readOnly) {
_focusNode.unfocus();
return true;
} else {
return false;
}
}
@override
Widget build(BuildContext context) {
return (
AnimatedContainer(
duration: Duration(milliseconds: 300),
decoration: widget.bare ? null :BoxDecoration(
boxShadow: [BoxShadow(color: Color.fromRGBO(70, 68, 167, focus ? 0.20 : 0), offset: Offset(0.0, 13.0), blurRadius: focus ? 34.0 : 12.0)]
),
child: TextFormField(
keyboardAppearance: Theme.of(context).brightness,
scrollPhysics: BouncingScrollPhysics(),
autovalidate: widget.autoValidate,
textCapitalization: widget.textCapitalization,
onFieldSubmitted: widget.inputAction==TextInputAction.next ? (widget.onSubmit!=null ? widget.onSubmit : (val) { _focusNode.nextFocus(); }) : widget.onSubmit,
textInputAction: widget.inputAction,
minLines: widget.minLines ?? 1,
maxLines: widget.maxLines ?? 1,
maxLengthEnforced: widget.maxLengthEnforced,
initialValue: widget.initialValue,
onChanged: widget.onChanged,
focusNode: _focusNode,
maxLength: widget.maxLength ?? null,
controller: widget.controller,
keyboardType: widget.keyboardType,
readOnly: _determineReadOnly(),
obscureText: widget.type=="password" && !view ? true : false,
autofocus: widget.autoFocus ?? false,
validator: widget.validator,
onSaved: widget.onSaved,
style: Theme.of(context).textTheme.body2.copyWith( fontSize: widget.fontSize, fontWeight: widget.fontWeight ),
inputFormatters: widget.inputFormatters,
decoration: InputDecoration(
counterText: "",
hintText: widget.hintText,
hintStyle: TextStyle(fontSize: widget.fontSize, fontWeight: widget.fontWeight, color: Theme.of(context).hintColor),
contentPadding: widget.padding!=null ? widget.padding : EdgeInsets.symmetric(vertical: (widget.bare && !widget.keepPadding) ? 0.0 : 10.0, horizontal: 16.0),
filled: true,
fillColor: widget.bare ? Colors.transparent : Theme.of(context).backgroundColor,
suffixIcon: _buildSuffixIcon(),
prefixIcon: widget.type!="search" ?
widget.prefixIcon!=null ?
Padding(
padding: EdgeInsets.only(left: 28.0, top: 14.0, bottom: 14.0, right: 0),
child: Text("\$", style: TextStyle( fontSize: 14, fontWeight: FontWeight.w800),),
)
:
null
:
Icon(EvaIcons.search, size: 20.0, color: Colors.grey[500]),
errorStyle: TextStyle(fontSize: 14.0, fontWeight: widget.fontWeight, height: widget.borderOnlyError ? 0.0 : null),
errorBorder: OutlineInputBorder(
borderSide: BorderSide(color: Theme.of(context).errorColor.withOpacity(widget.bare ? 0.0 : 0.5 ), width: 2.0),
borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)
),
focusedErrorBorder: OutlineInputBorder(
borderSide: BorderSide(color: Theme.of(context).errorColor.withOpacity(widget.bare ? 0.0 : 0.5 ), width: 2.0),
borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Theme.of(context).dividerColor.withOpacity(widget.bare ? 0.0 : 1.0 ), width: 2.0),
borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Theme.of(context).dividerColor.withOpacity(widget.bare ? 0.0 : 1.0 ), width: 2.0),
borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Theme.of(context).dividerColor.withOpacity(widget.bare ? 0.0 : 1.0 ), width: 2.0),
borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)
)
),
),
)
);
}
}

@ -86,8 +86,7 @@ class _ButtonState extends State<Button> with TickerProviderStateMixin {
scale: _buttonSize, scale: _buttonSize,
child: AnimatedContainer( child: AnimatedContainer(
duration: Duration(milliseconds: 150), duration: Duration(milliseconds: 150),
margin: margin: EdgeInsets.only(bottom: widget.title.isNotEmpty ? 14.0 : 0.0),
EdgeInsets.only(bottom: widget.title.isNotEmpty ? 14.0 : 0.0),
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(
vertical: widget.title != null && widget.title.isNotEmpty vertical: widget.title != null && widget.title.isNotEmpty
? 12.0 ? 12.0
@ -96,8 +95,8 @@ class _ButtonState extends State<Button> with TickerProviderStateMixin {
? 22.0 ? 22.0
: 19), : 19),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Hexcolor('#58434F'), color: Hexcolor('#515b5d'),
borderRadius: BorderRadius.all(Radius.circular(100.0)), borderRadius: BorderRadius.all(Radius.circular(10.0)),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
color: Color.fromRGBO(70, 70, 70, 0.28), color: Color.fromRGBO(70, 70, 70, 0.28),

@ -26,36 +26,14 @@ class CardWithBgWidgetNew extends StatelessWidget {
width: double.infinity, width: double.infinity,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(10.0), Radius.circular(20.0),
), ),
// border: Border.all(color: Hexcolor('#707070'), width: 2.0),
), ),
child: Material( child: Material(
borderRadius: BorderRadius.all(Radius.circular(10.0)), borderRadius: BorderRadius.all(Radius.circular(20.0)),
color: Hexcolor('#FFFFFF'), color: Hexcolor('#FFFFFF'),
child: Stack( child: Stack(
children: [ children: [
if (projectProvider.isArabic)
Positioned(
child: Container(
width: 10,
color: Hexcolor('#FFFFFF'),
),
bottom: 0,
top: 0,
right: 0,
)
else
Positioned(
child: Container(
width: 10,
color: Hexcolor('#FFFFFF'),
),
bottom: 0,
top: 0,
left: 0,
),
Container( Container(
padding: EdgeInsets.all(15.0), padding: EdgeInsets.all(15.0),
margin: EdgeInsets.only(left: 10), margin: EdgeInsets.only(left: 10),

@ -0,0 +1,91 @@
/*
*@author: Amjad Amireh
*@Date:27/5/2020
*@param:listItems , headerTitle
*@return:ListItem Expand
*@desc:
*/
import 'package:flutter/material.dart';
class ExpandableItem extends StatefulWidget{
final List<String>listItems;
final String headerTitle;
ExpandableItem(this.headerTitle,this.listItems);
@override
_ExpandableItemState createState() => _ExpandableItemState();
}
class _ExpandableItemState extends State<ExpandableItem>
{
bool isExpand=false;
@override
void initState() {
super.initState();
isExpand=false;
}
@override
Widget build(BuildContext context) {
List<String>listItem=this.widget.listItems;
return Container(
child: Padding(
padding: (isExpand==true)?const EdgeInsets.all(6.0):const EdgeInsets.all(8.0),
child: Container(
decoration:BoxDecoration(
color: Colors.white,
borderRadius: (isExpand!=true)?BorderRadius.all(Radius.circular(50)):BorderRadius.all(Radius.circular(25)),
),
child: ExpansionTile(
key: PageStorageKey<String>(this.widget.headerTitle),
title: Container(
width: double.infinity,
child: Text(this.widget.headerTitle,style: TextStyle(fontSize: (isExpand!=true)?18:22,color: Colors.black,fontWeight: FontWeight.bold),)),
trailing: (isExpand==true)?Icon(Icons.keyboard_arrow_up,color: Colors.black,):Icon(Icons.keyboard_arrow_down,color: Colors.black),
onExpansionChanged: (value){
setState(() {
isExpand=value;
});
},
children: [
for(final item in listItem)
Padding(
padding: const EdgeInsets.all(8.0),
child: InkWell(
onTap: (){
print(Text("Selected Item $item "+this.widget.headerTitle ));
//========Stop Snak bar=========== Scaffold.of(context).showSnackBar(SnackBar(backgroundColor: Colors.black,duration:Duration(microseconds: 500),content: Text("Selected Item $item "+this.widget.headerTitle )));
},
child: Container(
width: double.infinity,
decoration:BoxDecoration(
color: Colors.white,
border: Border(top: BorderSide(color: Theme.of(context).dividerColor))
),
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Text(item,style: TextStyle(color: Colors.black),),
)),
),
)
],
),
),
),
);
}
}

@ -225,6 +225,20 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.4" version: "1.3.4"
device_info:
dependency: "direct main"
description:
name: device_info
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.2+4"
eva_icons_flutter:
dependency: "direct main"
description:
name: eva_icons_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
fixnum: fixnum:
dependency: transitive dependency: transitive
description: description:

@ -36,12 +36,13 @@ dependencies:
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 charts_flutter: ^0.9.0
eva_icons_flutter: ^2.0.0
# Qr code Scanner # Qr code Scanner
barcode_scan: ^3.0.1 barcode_scan: ^3.0.1
# permissions # permissions
permission_handler: ^5.0.0+hotfix.3 permission_handler: ^5.0.0+hotfix.3
device_info: ^0.4.2+4
@ -71,29 +72,7 @@ flutter:
# To add assets to your application, add an assets section, like this: # To add assets to your application, add an assets section, like this:
assets: assets:
- assets/images/login_icon.png - assets/images/
- assets/images/hospital_icon.png
- assets/images/password_icon.png
- assets/images/user_id_icon.png
- assets/images/login_btn_arrow_icon.png
- assets/images/dr_avatar.png
- assets/images/verification_fingerprint_lg_icon.png
- assets/images/verification_faceid_lg_icon.png
- assets/images/verification_sms_lg_icon.png
- assets/images/verification_whatsapp_lg_icon.png
- assets/images/verification_fingerprint_icon.png
- assets/images/verification_faceid_icon.png
- assets/images/verification_sms_icon.png
- assets/images/verification_whatsapp_icon.png
- assets/images/close_icon.png
- assets/images/welcome_login_icon.png
- assets/images/verified_icon.png
- assets/images/heartbeat.png
- assets/images/lab.png
- assets/images/note.png
- assets/images/radiology-1.png
- assets/images/qr_code.png
- assets/images/qr_code_white.png
# - images/a_dot_ham.jpeg # - images/a_dot_ham.jpeg

Loading…
Cancel
Save