Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into code_reafactoring

 Conflicts:
	lib/screens/patients/profile/lab_result/lab_orders_screen.dart
	lib/screens/patients/profile/refer_patient_screen.dart
merge-requests/522/head
hussam al-habibeh 5 years ago
commit 17c878fa4c

@ -112,8 +112,8 @@ class BaseAppClient {
if (body['OTP_SendType'] != null) { if (body['OTP_SendType'] != null) {
onFailure(getError(parsed), statusCode); onFailure(getError(parsed), statusCode);
} else if (!isAllowAny) { } else if (!isAllowAny) {
await helpers.logout(); await Helpers.logout();
helpers.showErrorToast('Your session expired Please login agian'); Helpers.showErrorToast('Your session expired Please login agian');
} }
if (isAllowAny) { if (isAllowAny) {
onFailure(getError(parsed), statusCode); onFailure(getError(parsed), statusCode);
@ -308,7 +308,7 @@ class BaseAppClient {
} }
} }
if (error == null || error == "null" || error == "null\n") { if (error == null || error == "null" || error == "null\n") {
return helpers.generateContactAdminMsg(); return Helpers.generateContactAdminMsg();
} }
return error; return error;
} }

@ -2,11 +2,13 @@ import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/imei_details.dart'; import 'package:doctor_app_flutter/core/model/imei_details.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart';
import 'package:doctor_app_flutter/models/doctor/user_model.dart';
class AuthService extends BaseService { class AuthService extends BaseService {
List<GetIMEIDetailsModel> _imeiDetails = []; List<GetIMEIDetailsModel> _imeiDetails = [];
List<GetIMEIDetailsModel> get dashboardItemsList => _imeiDetails; List<GetIMEIDetailsModel> get dashboardItemsList => _imeiDetails;
Map<String, dynamic> _loginInfo = {};
Map<String, dynamic> get loginInfo => _loginInfo;
Future selectDeviceImei(imei) async { Future selectDeviceImei(imei) async {
try { try {
// dynamic localRes; // dynamic localRes;
@ -26,4 +28,36 @@ class AuthService extends BaseService {
super.error = error; super.error = error;
} }
} }
Future login(UserModel userInfo) async {
hasError = false;
_loginInfo = {};
try {
await baseAppClient.post(LOGIN_URL,
onSuccess: (dynamic response, int statusCode) {
_loginInfo = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: userInfo.toJson());
} catch (error) {
hasError = true;
super.error = error;
}
// await baseAppClient.post(SELECT_DEVICE_IMEI,
// onSuccess: (dynamic response, int statusCode) {
// _imeiDetails = [];
// response['List_DoctorDeviceDetails'].forEach((v) {
// _imeiDetails.add(GetIMEIDetailsModel.fromJson(v));
// });
// }, onFailure: (String error, int statusCode) {
// hasError = true;
// super.error = error;
// }, body: {});
// } catch (error) {
// hasError = true;
// super.error = error;
// }
}
} }

@ -48,8 +48,7 @@ class LabsService extends BaseService {
_requestPatientLabSpecialResult.orderNo = orderNo; _requestPatientLabSpecialResult.orderNo = orderNo;
await baseAppClient.postPatient(GET_Patient_LAB_SPECIAL_RESULT, await baseAppClient.postPatient(GET_Patient_LAB_SPECIAL_RESULT,
patient: patient, patient: patient, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
patientLabSpecialResult.clear(); patientLabSpecialResult.clear();
response['ListPLSR'].forEach((hospital) { response['ListPLSR'].forEach((hospital) {
patientLabSpecialResult.add(PatientLabSpecialResult.fromJson(hospital)); patientLabSpecialResult.add(PatientLabSpecialResult.fromJson(hospital));
@ -60,7 +59,8 @@ class LabsService extends BaseService {
}, body: _requestPatientLabSpecialResult.toJson()); }, body: _requestPatientLabSpecialResult.toJson());
} }
Future getPatientLabResult({PatientLabOrders patientLabOrder,PatiantInformtion patient}) async { Future getPatientLabResult(
{PatientLabOrders patientLabOrder, PatiantInformtion patient}) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['InvoiceNo'] = patientLabOrder.invoiceNo; body['InvoiceNo'] = patientLabOrder.invoiceNo;
@ -69,8 +69,7 @@ class LabsService extends BaseService {
body['SetupID'] = patientLabOrder.setupID; body['SetupID'] = patientLabOrder.setupID;
body['ProjectID'] = patientLabOrder.projectID; body['ProjectID'] = patientLabOrder.projectID;
body['ClinicID'] = patientLabOrder.clinicID; body['ClinicID'] = patientLabOrder.clinicID;
await baseAppClient.postPatient(GET_Patient_LAB_RESULT, await baseAppClient.postPatient(GET_Patient_LAB_RESULT, patient: patient,
patient: patient,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
patientLabSpecialResult.clear(); patientLabSpecialResult.clear();
labResultList.clear(); labResultList.clear();
@ -84,19 +83,22 @@ class LabsService extends BaseService {
} }
Future getPatientLabOrdersResults( Future getPatientLabOrdersResults(
{PatientLabOrders patientLabOrder, String procedure,PatiantInformtion patient}) async { {PatientLabOrders patientLabOrder,
String procedure,
PatiantInformtion patient}) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['InvoiceNo'] = patientLabOrder.invoiceNo; if (patientLabOrder != null) {
body['OrderNo'] = patientLabOrder.orderNo; body['InvoiceNo'] = patientLabOrder.invoiceNo;
body['OrderNo'] = patientLabOrder.orderNo;
body['SetupID'] = patientLabOrder.setupID;
body['ProjectID'] = patientLabOrder.projectID;
body['ClinicID'] = patientLabOrder.clinicID;
}
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
body['SetupID'] = patientLabOrder.setupID;
body['ProjectID'] = patientLabOrder.projectID;
body['ClinicID'] = patientLabOrder.clinicID;
body['Procedure'] = procedure; body['Procedure'] = procedure;
await baseAppClient.postPatient(GET_Patient_LAB_ORDERS_RESULT, await baseAppClient.postPatient(GET_Patient_LAB_ORDERS_RESULT,
patient: patient, patient: patient, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
labOrdersResultsList.clear(); labOrdersResultsList.clear();
response['ListPLR'].forEach((lab) { response['ListPLR'].forEach((lab) {
labOrdersResultsList.add(LabOrderResult.fromJson(lab)); labOrdersResultsList.add(LabOrderResult.fromJson(lab));

@ -112,7 +112,7 @@ class PrescriptionService extends LookupService {
}, body: _drugRequestModel.toJson()); }, body: _drugRequestModel.toJson());
} }
Future getMedicationList({String drug}) async { Future getMedicationList({String drug =''}) async {
hasError = false; hasError = false;
_drugRequestModel.search = ["$drug"]; _drugRequestModel.search = ["$drug"];
await baseAppClient.post(SEARCH_DRUG, await baseAppClient.post(SEARCH_DRUG,

@ -16,7 +16,6 @@ import 'package:flutter/cupertino.dart';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import '../../models/doctor/user_model.dart'; import '../../models/doctor/user_model.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED } enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED }
class AuthViewModel extends BaseViewModel { class AuthViewModel extends BaseViewModel {
@ -195,26 +194,19 @@ class AuthViewModel extends BaseViewModel {
} }
} }
/* Future<dynamic> getDocProfiles(docInfo,
*@author: Elham Rababah {bool allowChangeProfile = true}) async {
*@Date:17/5/2020
*@param: docInfo
*@return:Future<Map>
*@desc: getDocProfiles
*/
Future<dynamic> getDocProfiles(docInfo, {bool allowChangeProfile = true}) async {
try { try {
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_DOC_PROFILES, await baseAppClient.post(GET_DOC_PROFILES,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
localRes = response; localRes = response;
if(allowChangeProfile) { if (allowChangeProfile) {
doctorProfile = doctorProfile =
DoctorProfileModel.fromJson(response['DoctorProfileList'][0]); DoctorProfileModel.fromJson(response['DoctorProfileList'][0]);
selectedClinicName = selectedClinicName =
response['DoctorProfileList'][0]['ClinicDescription']; response['DoctorProfileList'][0]['ClinicDescription'];
} }
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
}, body: docInfo); }, body: docInfo);

@ -4,11 +4,13 @@ import 'package:doctor_app_flutter/core/model/imei_details.dart';
import 'package:doctor_app_flutter/core/service/auth_service.dart'; import 'package:doctor_app_flutter/core/service/auth_service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/models/doctor/user_model.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
class IMEIViewModel extends BaseViewModel { class IMEIViewModel extends BaseViewModel {
AuthService _authService = locator<AuthService>(); AuthService _authService = locator<AuthService>();
List<GetIMEIDetailsModel> get imeiDetails => _authService.dashboardItemsList; List<GetIMEIDetailsModel> get imeiDetails => _authService.dashboardItemsList;
get loginInfo => _authService.loginInfo;
Future selectDeviceImei(imei) async { Future selectDeviceImei(imei) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _authService.selectDeviceImei(imei); await _authService.selectDeviceImei(imei);
@ -18,4 +20,15 @@ class IMEIViewModel extends BaseViewModel {
} else } else
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future login(UserModel userInfo) async {
setState(ViewState.Busy);
await _authService.login(userInfo);
if (_authService.hasError) {
error = _authService.error;
Helpers.showErrorToast(error);
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
} }

@ -46,7 +46,8 @@ class _LandingPageState extends State<LandingPage> {
leading: Builder( leading: Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
return IconButton( return IconButton(
icon: Icon(DoctorApp.drawer_icon), icon: Image.asset('assets/images/menu.png',
height: 50, width: 50),
iconSize: 15, iconSize: 15,
color: Colors.black, color: Colors.black,
onPressed: () => Scaffold.of(context).openDrawer(), onPressed: () => Scaffold.of(context).openDrawer(),

@ -5,7 +5,6 @@ import 'package:doctor_app_flutter/core/service/patient_service.dart';
import 'package:doctor_app_flutter/core/service/prescription_service.dart'; import 'package:doctor_app_flutter/core/service/prescription_service.dart';
import 'package:doctor_app_flutter/core/service/procedure_service.dart'; import 'package:doctor_app_flutter/core/service/procedure_service.dart';
import 'package:doctor_app_flutter/core/service/sickleave_service.dart'; import 'package:doctor_app_flutter/core/service/sickleave_service.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/imei_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/imei_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart';

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
class ListDoctorWorkingHoursTable { class ListDoctorWorkingHoursTable {
@ -15,7 +16,7 @@ class ListDoctorWorkingHoursTable {
}); });
ListDoctorWorkingHoursTable.fromJson(Map<String, dynamic> json) { ListDoctorWorkingHoursTable.fromJson(Map<String, dynamic> json) {
date = Helpers.convertStringToDate(json['Date']); date = DateUtils.convertStringToDate(json['Date']);
dayName = json['DayName']; dayName = json['DayName'];
workingHours = json['WorkingHours']; workingHours = json['WorkingHours'];
projectName = json['ProjectName']; projectName = json['ProjectName'];

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
@ -70,7 +71,7 @@ class ListGtMyPatientsQuestions {
patientID = json['PatientID']; patientID = json['PatientID'];
doctorID = json['DoctorID']; doctorID = json['DoctorID'];
requestType = json['RequestType']; requestType = json['RequestType'];
requestDate = Helpers.convertStringToDate(json['RequestDate']) ; requestDate = DateUtils.convertStringToDate(json['RequestDate']) ;
requestTime = json['RequestTime']; requestTime = json['RequestTime'];
remarks = json['Remarks']; remarks = json['Remarks'];
status = json['Status']; status = json['Status'];

@ -1,11 +1,6 @@
/*
*@author: Elham Rababah
*@Date:6/5/2020 import 'package:doctor_app_flutter/util/date-utils.dart';
*@param:
*@return:LabOrdersResModel
*@desc: LabOrdersResModel class
*/
import 'package:doctor_app_flutter/util/helpers.dart';
class LabOrdersResModel { class LabOrdersResModel {
String setupID; String setupID;
@ -67,7 +62,7 @@ class LabOrdersResModel {
status = json['Status']; status = json['Status'];
createdBy = json['CreatedBy']; createdBy = json['CreatedBy'];
createdByN = json['CreatedByN']; createdByN = json['CreatedByN'];
createdOn = Helpers.convertStringToDate(json['CreatedOn']); createdOn = DateUtils.convertStringToDate(json['CreatedOn']);
editedBy = json['EditedBy']; editedBy = json['EditedBy'];
editedByN = json['EditedByN']; editedByN = json['EditedByN'];
editedOn = json['EditedOn']; editedOn = json['EditedOn'];

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
class MyReferralPatientModel { class MyReferralPatientModel {
@ -142,7 +143,7 @@ class MyReferralPatientModel {
referralResponseOn = json['ReferralResponseOn']; referralResponseOn = json['ReferralResponseOn'];
priority = json['Priority']; priority = json['Priority'];
frequency = json['Frequency']; frequency = json['Frequency'];
mAXResponseTime = Helpers.convertStringToDate(json['MAXResponseTime']); mAXResponseTime = DateUtils.convertStringToDate(json['MAXResponseTime']);
age = json['Age']; age = json['Age'];
frequencyDescription = json['FrequencyDescription']; frequencyDescription = json['FrequencyDescription'];
genderDescription = json['GenderDescription']; genderDescription = json['GenderDescription'];

@ -1,3 +1,4 @@
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
class PrescriptionReportForInPatient { class PrescriptionReportForInPatient {
@ -125,7 +126,7 @@ class PrescriptionReportForInPatient {
orderNo = json['OrderNo']; orderNo = json['OrderNo'];
patientID = json['PatientID']; patientID = json['PatientID'];
pharmacyRemarks = json['PharmacyRemarks']; pharmacyRemarks = json['PharmacyRemarks'];
prescriptionDatetime = Helpers.convertStringToDate(json['PrescriptionDatetime']); prescriptionDatetime = DateUtils.convertStringToDate(json['PrescriptionDatetime']);
prescriptionNo = json['PrescriptionNo']; prescriptionNo = json['PrescriptionNo'];
processedBy = json['ProcessedBy']; processedBy = json['ProcessedBy'];
projectID = json['ProjectID']; projectID = json['ProjectID'];
@ -138,11 +139,11 @@ class PrescriptionReportForInPatient {
routeId = json['RouteId']; routeId = json['RouteId'];
routeN = json['RouteN']; routeN = json['RouteN'];
setupID = json['SetupID']; setupID = json['SetupID'];
startDatetime = Helpers.convertStringToDate(json['StartDatetime']) ; startDatetime = DateUtils.convertStringToDate(json['StartDatetime']) ;
status = json['Status']; status = json['Status'];
statusDescription = json['StatusDescription']; statusDescription = json['StatusDescription'];
statusDescriptionN = json['StatusDescriptionN']; statusDescriptionN = json['StatusDescriptionN'];
stopDatetime = Helpers.convertStringToDate(json['StopDatetime']); stopDatetime = DateUtils.convertStringToDate(json['StopDatetime']);
unitofMeasurement = json['UnitofMeasurement']; unitofMeasurement = json['UnitofMeasurement'];
unitofMeasurementDescription = json['UnitofMeasurementDescription']; unitofMeasurementDescription = json['UnitofMeasurementDescription'];
unitofMeasurementDescriptionN = json['UnitofMeasurementDescriptionN']; unitofMeasurementDescriptionN = json['UnitofMeasurementDescriptionN'];

@ -5,6 +5,7 @@
*@return:VitalSignResModel *@return:VitalSignResModel
*@desc: VitalSignResModel class *@desc: VitalSignResModel class
*/ */
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
class VitalSignResModel { class VitalSignResModel {
@ -170,7 +171,7 @@ class VitalSignResModel {
triageCategory = json['TriageCategory']; triageCategory = json['TriageCategory'];
gCScore = json['GCScore']; gCScore = json['GCScore'];
lineItemNo = json['LineItemNo']; lineItemNo = json['LineItemNo'];
vitalSignDate = json['VitalSignDate'] !=null? Helpers.convertStringToDate(json['VitalSignDate']): new DateTime.now(); vitalSignDate = json['VitalSignDate'] !=null? DateUtils.convertStringToDate(json['VitalSignDate']): new DateTime.now();
actualTimeTaken = json['ActualTimeTaken']; actualTimeTaken = json['ActualTimeTaken'];
sugarLevel = json['SugarLevel']; sugarLevel = json['SugarLevel'];
fBS = json['FBS']; fBS = json['FBS'];

@ -210,7 +210,7 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
setState(() { setState(() {
isLoading = false; isLoading = false;
}); });
helpers.showErrorToast(error.message); Helpers.showErrorToast(error.message);
//DrAppToastMsg.showErrorToast(error); //DrAppToastMsg.showErrorToast(error);
}); });
} }

@ -122,7 +122,7 @@ class _LoginsreenState extends State<Loginsreen> {
height: 40, height: 40,
), ),
LoginForm( LoginForm(
changeLoadingStata: changeLoadingStata, model: model,
), ),
], ],
) )

@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/doctor/doctor_reply_screen.dart'; import 'package:doctor_app_flutter/screens/doctor/doctor_reply_screen.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.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/shared/Text.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/TextFields.dart';
@ -89,34 +90,6 @@ class DoctorReplayChat extends StatelessWidget {
color: Color(0xFF2B353E))) color: Color(0xFF2B353E)))
], ],
), ),
// Row(
// mainAxisAlignment:
// MainAxisAlignment.spaceBetween,
// children: [
// InkWell(
// onTap: () {
// // TODO: move to doctor profile
// },
// child: RichText(
// text: TextSpan(
// style: TextStyle(
// fontSize: 1.6 *
// SizeConfig.textMultiplier,
// color: Colors.black),
// children: <TextSpan>[
// new TextSpan(
// text:
// 'Tap here to view patient profile'
// .toString(),
// style: TextStyle(
// fontFamily: 'Poppins',
// fontSize: 12)),
// ],
// ),
// ),
// ),
// ],
// ),
], ],
), ),
), ),
@ -234,91 +207,6 @@ class DoctorReplayChat extends StatelessWidget {
), ),
), ),
SizedBox(height: 30,), SizedBox(height: 30,),
// Row(
// mainAxisAlignment: MainAxisAlignment.end,
// children: [
// Container(
// // color: Color(0xFF2B353E),
// width: MediaQuery.of(context).size.width * 0.8,
// padding: EdgeInsets.all(5),
// decoration: BoxDecoration(
// color: Colors.white,// Color(0xFF2B353E),
// borderRadius: BorderRadius.all(
// Radius.circular(10.0),
// ),
// border: Border.all(
// color: HexColor('#707070') ,
// width: 0.30),
// ),
// child: Column(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: <Widget>[
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Container(
// margin: EdgeInsets.only(top: 5),
// width: 60,
// height: 60,
// child: Image.asset(
// 1 == 1
// ? 'assets/images/male_avatar.png'
// : 'assets/images/female_avatar.png',
// fit: BoxFit.cover,
// ),
// ),
// Column(
// children: [
// AppText(
// "07 Jan 2021",
// fontSize: 2.5 * SizeConfig.textMultiplier,
// fontFamily: 'Poppins',
// color: Color(0xFF2B353E),
// // fontSize: 18
// ),
// AppText(
// "07:00 PM",
// fontSize: 2.5 * SizeConfig.textMultiplier,
// fontFamily: 'Poppins',
// color: Color(0xFF2B353E),
// // fontSize: 18
// ),
// ],
// ),
// ],
// ),
// SizedBox(
// height: 10,
// ),
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// crossAxisAlignment: CrossAxisAlignment.start,
// children: [
// Column(
// children: [
// Padding(
// padding: const EdgeInsets.all(8.0),
// child: Container(
// width: MediaQuery.of(context).size.width * 0.7,
// child: AppText(
// "This procedure should be taken only when the patient is below 99o",
// fontSize: 15,
// fontFamily: 'Poppins',
// color: Color(0xFF2B353E),
// // fontSize: 18
// ),
// ),
// ),
// ],
// ),
// ],
// ),
// ],
// ),
// ),
// ],
// ),
], ],
), ),
), ),
@ -341,11 +229,6 @@ class DoctorReplayChat extends StatelessWidget {
child: TextFields( child: TextFields(
borderRadius: 0, borderRadius: 0,
// hasLabelText: msgController.text != ''
// ? true
// : false,
// showLabelText: false,
// padding: EdgeInsets.all(0.3),
hintText: TranslationBase hintText: TranslationBase
.of(context) .of(context)
.typeHereToReply, .typeHereToReply,
@ -357,7 +240,7 @@ class DoctorReplayChat extends StatelessWidget {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await model.replay(msgController.text, reply); await model.replay(msgController.text, reply);
if(model.state == ViewState.ErrorLocal) { if(model.state == ViewState.ErrorLocal) {
helpers.showErrorToast("An error happened while you are replaying"); Helpers.showErrorToast("An error happened while you are replaying");
} else { } else {
DrAppToastMsg.showSuccesToast("Thank you for your replay "); DrAppToastMsg.showSuccesToast("Thank you for your replay ");
await previousModel.getDoctorReply(); await previousModel.getDoctorReply();

@ -679,7 +679,7 @@ class _HomeScreenState extends State<HomeScreen> {
// model.getDashboard(); // model.getDashboard();
}).catchError((err) { }).catchError((err) {
changeIsLoading(false); changeIsLoading(false);
helpers.showErrorToast(err); Helpers.showErrorToast(err);
}); });
} }

@ -96,7 +96,7 @@ class _VideoCallPageState extends State<VideoCallPage> {
connectOpenTok(result); connectOpenTok(result);
}).catchError((error) => }).catchError((error) =>
{helpers.showErrorToast(error), Navigator.of(context).pop()}); {Helpers.showErrorToast(error), Navigator.of(context).pop()});
} }
@override @override
@ -307,7 +307,7 @@ class _VideoCallPageState extends State<VideoCallPage> {
.then((result) { .then((result) {
connectOpenTok(result); connectOpenTok(result);
}).catchError((error) => }).catchError((error) =>
{helpers.showErrorToast(error), Navigator.of(context).pop()}); {Helpers.showErrorToast(error), Navigator.of(context).pop()});
} }
endCall() { endCall() {
@ -317,7 +317,7 @@ class _VideoCallPageState extends State<VideoCallPage> {
.then((result) { .then((result) {
print(result); print(result);
}).catchError((error) => }).catchError((error) =>
{helpers.showErrorToast(error), Navigator.of(context).pop()}); {Helpers.showErrorToast(error), Navigator.of(context).pop()});
} }
endCallWithCharge() { endCallWithCharge() {
@ -328,7 +328,7 @@ class _VideoCallPageState extends State<VideoCallPage> {
print('end callwith charge'); print('end callwith charge');
print(result); print(result);
}).catchError((error) => }).catchError((error) =>
{helpers.showErrorToast(error), Navigator.of(context).pop()}); {Helpers.showErrorToast(error), Navigator.of(context).pop()});
} }
closeRoute() { closeRoute() {

@ -622,7 +622,7 @@ class _MedicalFileDetailsState extends State<MedicalFileDetails> {
'Order Date: ', 'Order Date: ',
), ),
AppText( AppText(
Helpers.getDateFormatted( DateUtils.getDateFormatted(
DateTime DateTime
.parse( .parse(
model model

@ -14,7 +14,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/medicine/medicine_item_widget.dart'; import 'package:doctor_app_flutter/widgets/medicine/medicine_item_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.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_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/app_text_form_field.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/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -242,12 +242,12 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
searchMedicine(context, MedicineViewModel model) async { searchMedicine(context, MedicineViewModel model) async {
FocusScope.of(context).unfocus(); FocusScope.of(context).unfocus();
if (myController.text.isNullOrEmpty()) { if (myController.text.isNullOrEmpty()) {
helpers.showErrorToast(TranslationBase.of(context).typeMedicineName); Helpers.showErrorToast(TranslationBase.of(context).typeMedicineName);
//"Type Medicine Name") //"Type Medicine Name")
return; return;
} }
if (myController.text.length < 3) { if (myController.text.length < 3) {
helpers.showErrorToast(TranslationBase.of(context).moreThan3Letter); Helpers.showErrorToast(TranslationBase.of(context).moreThan3Letter);
return; return;
} }

@ -23,7 +23,6 @@ class PharmaciesListScreen extends StatefulWidget {
final String url; final String url;
// In the constructor, require a item id.
PharmaciesListScreen({Key key, @required this.itemID, this.url}) PharmaciesListScreen({Key key, @required this.itemID, this.url})
: super(key: key); : super(key: key);
@ -32,18 +31,9 @@ class PharmaciesListScreen extends StatefulWidget {
} }
class _PharmaciesListState extends State<PharmaciesListScreen> { class _PharmaciesListState extends State<PharmaciesListScreen> {
var _data;
Helpers helpers = new Helpers(); Helpers helpers = new Helpers();
ProjectViewModel projectsProvider; ProjectViewModel projectsProvider;
bool _isInit = true;
//bool _isOutOfStuck = false;
@override
void didChangeDependencies() {
super.didChangeDependencies();
_isInit = false;
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -145,90 +135,90 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
? Alignment.topRight ? Alignment.topRight
: Alignment.topLeft, : Alignment.topLeft,
), ),
Expanded( Container(
child: Container( width: SizeConfig.screenWidth * 0.99,
width: SizeConfig.screenWidth * 0.99, margin: EdgeInsets.only(left: 10,right: 10),
child: ListView.builder( child: ListView.builder(
shrinkWrap: true, shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
itemCount: model.pharmaciesList == null ? 0 : model itemCount: model.pharmaciesList == null ? 0 : model
.pharmaciesList.length, .pharmaciesList.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return RoundedContainer( return RoundedContainer(
child: Row( margin: EdgeInsets.only(top: 5),
children: <Widget>[ child: Row(
Expanded( children: <Widget>[
flex: 1, Expanded(
child: ClipRRect( flex: 1,
borderRadius: child: ClipRRect(
BorderRadius.all(Radius.circular(7)), borderRadius:
child: Image.network( BorderRadius.all(Radius.circular(7)),
model child: Image.network(
.pharmaciesList[index]["ProjectImageURL"],
height:
SizeConfig.imageSizeMultiplier * 15,
width:
SizeConfig.imageSizeMultiplier * 15,
fit: BoxFit.cover,
),
),
),
Expanded(
flex: 4,
child: AppText(
model model
.pharmaciesList[index]["LocationDescription"], .pharmaciesList[index]["ProjectImageURL"],
margin: 10, height:
SizeConfig.imageSizeMultiplier * 15,
width:
SizeConfig.imageSizeMultiplier * 15,
fit: BoxFit.cover,
), ),
), ),
Expanded( ),
flex: 2, Expanded(
child: Wrap( flex: 4,
direction: Axis.horizontal, child: AppText(
alignment: WrapAlignment.end, model
crossAxisAlignment: WrapCrossAlignment.end, .pharmaciesList[index]["LocationDescription"],
children: <Widget>[ margin: 10,
Padding( ),
padding: EdgeInsets.all(5), ),
child: InkWell( Expanded(
child: Icon( flex: 2,
Icons.call, child: Wrap(
color: Colors.red, direction: Axis.horizontal,
), alignment: WrapAlignment.end,
onTap: () => crossAxisAlignment: WrapCrossAlignment.end,
launch("tel://" + children: <Widget>[
model Padding(
.pharmaciesList[index]["PhoneNumber"]), padding: EdgeInsets.all(5),
child: InkWell(
child: Icon(
Icons.call,
color: Colors.red,
), ),
onTap: () =>
launch("tel://" +
model
.pharmaciesList[index]["PhoneNumber"]),
), ),
Padding( ),
padding: EdgeInsets.all(5), Padding(
child: InkWell( padding: EdgeInsets.all(5),
child: Icon( child: InkWell(
Icons.pin_drop, child: Icon(
color: Colors.red, Icons.pin_drop,
), color: Colors.red,
onTap: () {
MapsLauncher.launchCoordinates(
double.parse(
model
.pharmaciesList[index]["Latitude"]),
double.parse(
model
.pharmaciesList[index]["Longitude"]),
model.pharmaciesList[index]
["LocationDescription"]);
},
), ),
onTap: () {
MapsLauncher.launchCoordinates(
double.parse(
model
.pharmaciesList[index]["Latitude"]),
double.parse(
model
.pharmaciesList[index]["Longitude"]),
model.pharmaciesList[index]
["LocationDescription"]);
},
), ),
], ),
), ],
), ),
], ),
), ],
); ),
}), );
), }),
) )
]), ]),
),),); ),),);

@ -17,7 +17,7 @@ import '../../lookups/patient_lookup.dart';
import '../../widgets/patients/dynamic_elements.dart'; import '../../widgets/patients/dynamic_elements.dart';
import '../../widgets/shared/app_buttons_widget.dart'; import '../../widgets/shared/app_buttons_widget.dart';
import '../../widgets/shared/app_scaffold_widget.dart'; import '../../widgets/shared/app_scaffold_widget.dart';
import '../../widgets/shared/app_text_form_field.dart'; import '../../widgets/shared/user-guid/text_fields/app_text_form_field.dart';
import '../../widgets/shared/app_texts_widget.dart'; import '../../widgets/shared/app_texts_widget.dart';
import '../../widgets/shared/rounded_container_widget.dart'; import '../../widgets/shared/rounded_container_widget.dart';
@ -86,7 +86,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
((_patientSearchFormValues.From == "0" || ((_patientSearchFormValues.From == "0" ||
_patientSearchFormValues.To == "0") && _patientSearchFormValues.To == "0") &&
_selectedType == "6")) { _selectedType == "6")) {
// helpers.showErrorToast("Please Choose The Dates"); // Helpers.showErrorToast("Please Choose The Dates");
} else { } else {
setState(() { setState(() {
isFormSubmitted = false; isFormSubmitted = false;
@ -111,7 +111,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
handelCatchErrorCase(err) { handelCatchErrorCase(err) {
//isLoading = false; //isLoading = false;
//isError = true; //isError = true;
error = helpers.generateContactAdminMsg(err); error = Helpers.generateContactAdminMsg(err);
//notifyListeners(); //notifyListeners();
throw err; throw err;
} }

@ -13,13 +13,11 @@ import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart';
import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.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/patients/PatientCard.dart'; import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart';
import 'package:doctor_app_flutter/widgets/patients/clinic_list_dropdwon.dart'; import 'package:doctor_app_flutter/widgets/patients/clinic_list_dropdwon.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/app_button.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
@ -689,12 +687,12 @@ class _PatientsScreenState extends State<PatientsScreen> {
}); });
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
}).catchError((error) { }).catchError((error) {
helpers.showErrorToast(error.toString()); Helpers.showErrorToast(error.toString());
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
}); });
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
helpers.showErrorToast(err); Helpers.showErrorToast(err);
}); });
} }

@ -9,7 +9,7 @@ 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/patients/profile/PatientHeaderWidgetNoAvatar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/app-textfield-custom.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.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';
@ -282,7 +282,7 @@ class _UCAFInputScreenState extends State<UCAFInputScreen> {
AppTextFieldCustom( AppTextFieldCustom(
hintText: hintText:
TranslationBase.of(context).instruction, TranslationBase.of(context).instruction,
dropDownText: helpers.parseHtmlString(model dropDownText: Helpers.parseHtmlString(model
.patientChiefComplaintList[0] .patientChiefComplaintList[0]
.chiefComplaint), .chiefComplaint),
controller: _additionalComplaintsController, controller: _additionalComplaintsController,

@ -11,7 +11,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart';
import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/app-textfield-custom.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.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';
@ -122,7 +122,7 @@ class _AdmissionRequestThirdScreenState
AppTextFieldCustom( AppTextFieldCustom(
height: screenSize.height * 0.075, height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).clinic, hintText: TranslationBase.of(context).clinic,
isDropDown: true, isTextFieldHasSuffix: true,
validationError: clinicError, validationError: clinicError,
dropDownText: _selectedClinic != null dropDownText: _selectedClinic != null
? projectViewModel.isArabic? _selectedClinic['clinicNameArabic'] : _selectedClinic['clinicNameEnglish'] ? projectViewModel.isArabic? _selectedClinic['clinicNameArabic'] : _selectedClinic['clinicNameEnglish']
@ -172,7 +172,7 @@ class _AdmissionRequestThirdScreenState
AppTextFieldCustom( AppTextFieldCustom(
height: screenSize.height * 0.075, height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).doctor, hintText: TranslationBase.of(context).doctor,
isDropDown: true, isTextFieldHasSuffix: true,
dropDownText: _selectedDoctor != null dropDownText: _selectedDoctor != null
? _selectedDoctor['DoctorName'] ? _selectedDoctor['DoctorName']
: null, : null,
@ -280,7 +280,7 @@ class _AdmissionRequestThirdScreenState
AppTextFieldCustom( AppTextFieldCustom(
height: screenSize.height * 0.075, height: screenSize.height * 0.075,
hintText: TranslationBase.of(context).dietType, hintText: TranslationBase.of(context).dietType,
isDropDown: true, isTextFieldHasSuffix: true,
dropDownText: _selectedDietType != null dropDownText: _selectedDietType != null
? _selectedDietType['nameEn'] ? _selectedDietType['nameEn']
: null, : null,

@ -13,7 +13,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart';
import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/app-textfield-custom.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.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';
@ -115,7 +115,7 @@ class _AdmissionRequestThirdScreenState
? _selectedDiagnosis['nameEn'] ? _selectedDiagnosis['nameEn']
: null, : null,
enabled: false, enabled: false,
isDropDown: true, isTextFieldHasSuffix: true,
validationError: diagnosisError, validationError: diagnosisError,
onClick: model.diagnosisTypesList != null && onClick: model.diagnosisTypesList != null &&
model.diagnosisTypesList.length > 0 model.diagnosisTypesList.length > 0
@ -161,7 +161,7 @@ class _AdmissionRequestThirdScreenState
? _selectedIcd['description'] ? _selectedIcd['description']
: null, : null,
enabled: false, enabled: false,
isDropDown: true, isTextFieldHasSuffix: true,
validationError: icdError, validationError: icdError,
onClick: model.icdCodes != null && onClick: model.icdCodes != null &&
model.icdCodes.length > 0 model.icdCodes.length > 0
@ -209,7 +209,7 @@ class _AdmissionRequestThirdScreenState
? _selectedDiagnosisType['description'] ? _selectedDiagnosisType['description']
: null, : null,
enabled: false, enabled: false,
isDropDown: true, isTextFieldHasSuffix: true,
validationError: diagnosisTypeError, validationError: diagnosisTypeError,
onClick: model.listOfDiagnosisSelectionTypes != onClick: model.listOfDiagnosisSelectionTypes !=
null && null &&

@ -14,7 +14,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart';
import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/app-textfield-custom.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.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';
@ -203,7 +203,7 @@ class _AdmissionRequestSecondScreenState
? "${DateUtils.convertStringToDateFormat(_expectedAdmissionDate.toString(), "yyyy-MM-dd")}" ? "${DateUtils.convertStringToDateFormat(_expectedAdmissionDate.toString(), "yyyy-MM-dd")}"
: null, : null,
enabled: false, enabled: false,
isDropDown: true, isTextFieldHasSuffix: true,
validationError: expectedDatesError, validationError: expectedDatesError,
suffixIcon: Icon( suffixIcon: Icon(
Icons.calendar_today, Icons.calendar_today,
@ -231,7 +231,7 @@ class _AdmissionRequestSecondScreenState
? _selectedFloor['description'] ? _selectedFloor['description']
: null, : null,
enabled: false, enabled: false,
isDropDown: true, isTextFieldHasSuffix: true,
validationError: floorError, validationError: floorError,
onClick: model.floorList != null && onClick: model.floorList != null &&
model.floorList.length > 0 model.floorList.length > 0
@ -281,7 +281,7 @@ class _AdmissionRequestSecondScreenState
? _selectedWard['description'] ? _selectedWard['description']
: null, : null,
enabled: false, enabled: false,
isDropDown: true, isTextFieldHasSuffix: true,
onClick: model.wardList != null && onClick: model.wardList != null &&
model.wardList.length > 0 model.wardList.length > 0
? () { ? () {
@ -331,7 +331,7 @@ class _AdmissionRequestSecondScreenState
? _selectedRoomCategory['description'] ? _selectedRoomCategory['description']
: null, : null,
enabled: false, enabled: false,
isDropDown: true, isTextFieldHasSuffix: true,
validationError: roomError, validationError: roomError,
onClick: model.roomCategoryList != null && onClick: model.roomCategoryList != null &&
model.roomCategoryList.length > 0 model.roomCategoryList.length > 0
@ -423,7 +423,7 @@ class _AdmissionRequestSecondScreenState
? _selectedAdmissionType['nameEn'] ? _selectedAdmissionType['nameEn']
: null, : null,
enabled: false, enabled: false,
isDropDown: true, isTextFieldHasSuffix: true,
validationError: admissionTypeError, validationError: admissionTypeError,
onClick: model.admissionTypeList != null && onClick: model.admissionTypeList != null &&
model.admissionTypeList.length > 0 model.admissionTypeList.length > 0

@ -9,6 +9,7 @@ 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:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'lab_result_chart_and_detials.dart'; import 'lab_result_chart_and_detials.dart';
@ -17,46 +18,49 @@ class FlowChartPage extends StatelessWidget {
final PatientLabOrders patientLabOrder; final PatientLabOrders patientLabOrder;
final String filterName; final String filterName;
final PatiantInformtion patient; final PatiantInformtion patient;
FlowChartPage({this.patientLabOrder, this.filterName, this.patient}); FlowChartPage({this.patientLabOrder, this.filterName, this.patient});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<LabsViewModel>( return BaseView<LabsViewModel>(
onModelReady: (model) => model.getPatientLabOrdersResults( onModelReady: (model) => model.getPatientLabOrdersResults(
patientLabOrder: patientLabOrder, procedure: filterName,patient: patient), patientLabOrder: patientLabOrder,
procedure: filterName,
patient: patient),
builder: (context, model, w) => AppScaffold( builder: (context, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: filterName, appBarTitle: filterName,
baseViewModel: model, baseViewModel: model,
body: SingleChildScrollView( body: model.labOrdersResultsList.isNotEmpty
child: model.labOrdersResultsList.isNotEmpty ? SingleChildScrollView(
? Container( child: Container(
child: LabResultChartAndDetails( child: LabResultChartAndDetails(
name: filterName, name: filterName,
labResult: model.labOrdersResultsList, labResult: model.labOrdersResultsList,
), ),
)
: Center(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 100,
), ),
Image.asset('assets/images/no-data.png'), )
Padding( : Container(
padding: const EdgeInsets.all(8.0), child: Center(
child: AppText( child: Column(
TranslationBase.of(context).noDataAvailable, crossAxisAlignment: CrossAxisAlignment.center,
fontWeight: FontWeight.normal, mainAxisSize: MainAxisSize.min,
color: HexColor("#B8382B"), children: [
fontSize: SizeConfig.textMultiplier * 2.5, Image.asset('assets/images/no-data.png'),
), Padding(
) padding: const EdgeInsets.all(8.0),
], child: AppText(
TranslationBase.of(context).noDataAvailable,
fontWeight: FontWeight.normal,
color: HexColor("#B8382B"),
fontSize: SizeConfig.textMultiplier * 2.5,
),
)
],
),
),
), ),
),
),
), ),
); );
} }

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/patient/prescription/prescription_report_for_in_patient.dart'; import 'package:doctor_app_flutter/models/patient/prescription/prescription_report_for_in_patient.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.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';
@ -97,11 +98,11 @@ class _InpatientPrescriptionDetailsScreenState
key: 'UOM'), key: 'UOM'),
buildTableRow( buildTableRow(
des: des:
'${Helpers.getDate(prescription.startDatetime)}', '${DateUtils.getDate(prescription.startDatetime)}',
key: 'Start Date'), key: 'Start Date'),
buildTableRow( buildTableRow(
des: des:
'${Helpers.getDate(prescription.stopDatetime)}', '${DateUtils.getDate(prescription.stopDatetime)}',
key: 'Stop Date'), key: 'Stop Date'),
buildTableRow( buildTableRow(
des: '${prescription.noOfDoses}', des: '${prescription.noOfDoses}',
@ -116,7 +117,7 @@ class _InpatientPrescriptionDetailsScreenState
key: 'Pharmacy Remarks'), key: 'Pharmacy Remarks'),
buildTableRow( buildTableRow(
des: des:
'${Helpers.getDate(prescription.prescriptionDatetime)}', '${DateUtils.getDate(prescription.prescriptionDatetime)}',
key: 'Prescription Date'), key: 'Prescription Date'),
buildTableRow( buildTableRow(
des: '${prescription.refillID}', des: '${prescription.refillID}',

@ -12,7 +12,7 @@ import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget
import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart';
import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/app-textfield-custom.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.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';
@ -242,7 +242,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
hintText: TranslationBase.of(context).branch, hintText: TranslationBase.of(context).branch,
dropDownText: _referTo != null ? _referTo['name'] : null, dropDownText: _referTo != null ? _referTo['name'] : null,
enabled: false, enabled: false,
isDropDown: true, isTextFieldHasSuffix: true,
validationError: branchError, validationError: branchError,
onClick: referToList != null onClick: referToList != null
? () { ? () {
@ -295,7 +295,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
? _selectedBranch['facilityName'] ? _selectedBranch['facilityName']
: null, : null,
enabled: false, enabled: false,
isDropDown: true, isTextFieldHasSuffix: true,
validationError: hospitalError, validationError: hospitalError,
onClick: model.branchesList != null && onClick: model.branchesList != null &&
model.branchesList.length > 0 && model.branchesList.length > 0 &&
@ -343,7 +343,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
? _selectedClinic['ClinicDescription'] ? _selectedClinic['ClinicDescription']
: null, : null,
enabled: false, enabled: false,
isDropDown: true, isTextFieldHasSuffix: true,
validationError: clinicError, validationError: clinicError,
onClick: _selectedBranch != null && onClick: _selectedBranch != null &&
model.clinicsList != null && model.clinicsList != null &&
@ -393,7 +393,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
dropDownText: dropDownText:
_selectedDoctor != null ? _selectedDoctor['Name'] : null, _selectedDoctor != null ? _selectedDoctor['Name'] : null,
enabled: false, enabled: false,
isDropDown: true, isTextFieldHasSuffix: true,
validationError: doctorError, validationError: doctorError,
onClick: _selectedClinic != null && onClick: _selectedClinic != null &&
model.doctorsList != null && model.doctorsList != null &&
@ -441,7 +441,7 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
? "${DateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}" ? "${DateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}"
: null, : null,
enabled: false, enabled: false,
isDropDown: true, isTextFieldHasSuffix: true,
suffixIcon: Icon( suffixIcon: Icon(
Icons.calendar_today, Icons.calendar_today,
color: Colors.black, color: Colors.black,

@ -3,7 +3,7 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; // import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/PatchAssessmentReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/PatchAssessmentReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
@ -13,13 +13,16 @@ import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.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/shared/Text.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-textfield-custom.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.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/dialogs/master_key_dailog.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/app-textfield-custom.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/auto_complete_text_field.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/text_field_error.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/text_fields_utils.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';
@ -75,22 +78,29 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
icdNameController.text = widget.mySelectedAssessment.selectedICD.code; icdNameController.text = widget.mySelectedAssessment.selectedICD.code;
} }
InputDecoration textFieldSelectorDecoration( InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown, String hintText, String selectedText, bool isDropDown ,
{IconData icon}) {
return InputDecoration( {IconData icon, String validationError}) {
return new InputDecoration(
fillColor: Colors.white, fillColor: Colors.white,
contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10), contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0Xffffffff), width: 1.0), borderSide: BorderSide(color: (validationError != null
? Colors.red.shade700
:Color(0xFFEFEFEF)) , width: 2.5),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0Xffffffff), width: 1.0), borderSide: BorderSide(color: (validationError != null
? Colors.red.shade700
: Color(0xFFEFEFEF)), width: 2.5),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
disabledBorder: OutlineInputBorder( disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0Xffffffff), width: 1.0), borderSide: BorderSide(color: (validationError != null
? Colors.red.shade700
: Color(0xFFEFEFEF)), width: 2.5),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
), ),
hintText: selectedText != null ? selectedText : hintText, hintText: selectedText != null ? selectedText : hintText,
@ -139,10 +149,10 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
Container( Container(
margin: EdgeInsets.only(left: 0, right: 0, top: 15), margin: EdgeInsets.only(left: 0, right: 0, top: 15),
child: AppTextFieldCustom( child: AppTextFieldCustom(
height: 55.0, // height: 55.0,
hintText: hintText:
TranslationBase.of(context).appointmentNumber, TranslationBase.of(context).appointmentNumber,
isDropDown: false, isTextFieldHasSuffix: false,
enabled: false, enabled: false,
controller: appointmentIdController, controller: appointmentIdController,
), ),
@ -164,47 +174,45 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
child: widget child: widget
.mySelectedAssessment.selectedICD == .mySelectedAssessment.selectedICD ==
null null
? AutoCompleteTextField<MasterKeyModel>( ? CustomAutoCompleteTextField(
decoration: textFieldSelectorDecoration( isShowError: isFormSubmitted &&
TranslationBase.of(context) widget.mySelectedAssessment.selectedICD == null,
.nameOrICD, child:AutoCompleteTextField<MasterKeyModel>(
widget.mySelectedAssessment
.selectedICD != decoration: TextFieldsUtils.textFieldSelectorDecoration(
null TranslationBase.of(context)
? widget.mySelectedAssessment .nameOrICD, null, true, suffixIcon: Icons.search),
.selectedICD.nameEn
: null, itemSubmitted: (item) => setState(() {
true, widget.mySelectedAssessment
icon: Icons.keyboard_arrow_down), .selectedICD = item;
itemSubmitted: (item) => setState(() { icdNameController.text = '${item.code.trim()}/${item.description}';
widget.mySelectedAssessment }),
.selectedICD = item; key: key,
icdNameController.text = '${item.code.trim()}/${item.description}'; suggestions: model.listOfICD10,
}), itemBuilder: (context, suggestion) =>
key: key, new Padding(
suggestions: model.listOfICD10, child: Texts(suggestion
itemBuilder: (context, suggestion) => .description +
new Padding( " / " +
child: Texts(suggestion suggestion.code.toString()),
.description + padding: EdgeInsets.all(8.0)),
" / " + itemSorter: (a, b) => 1,
suggestion.code.toString()), itemFilter: (suggestion, input) =>
padding: EdgeInsets.all(8.0)), suggestion.description
itemSorter: (a, b) => 1, .toLowerCase()
itemFilter: (suggestion, input) => .startsWith(
suggestion.description input.toLowerCase()) ||
.toLowerCase() suggestion.description
.startsWith( .toLowerCase()
input.toLowerCase()) || .startsWith(
suggestion.description input.toLowerCase()) ||
.toLowerCase() suggestion.code
.startsWith( .toLowerCase()
input.toLowerCase()) || .startsWith(
suggestion.code input.toLowerCase()),
.toLowerCase() ),
.startsWith( )
input.toLowerCase()),
)
: AppTextFieldCustom( : AppTextFieldCustom(
onClick: model.listOfICD10 != null onClick: model.listOfICD10 != null
? () { ? () {
@ -220,19 +228,16 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
maxLines: 2, maxLines: 2,
minLines: 1, minLines: 1,
controller: icdNameController, controller: icdNameController,
enabled: true, enabled: true,
isTextFieldHasSuffix: true,
suffixIcon: Icon(Icons.search,color: Colors.grey.shade600,),
) )
), ),
), ),
if (isFormSubmitted &&
widget.mySelectedAssessment.selectedICD == null)
CustomValidationError(),
SizedBox( SizedBox(
height: 7, height: 7,
), ),
AppTextFieldCustom( AppTextFieldCustom(
height: 55.0,
onClick: model.listOfDiagnosisCondition != null onClick: model.listOfDiagnosisCondition != null
? () { ? () {
MasterKeyDailog dialog = MasterKeyDailog( MasterKeyDailog dialog = MasterKeyDailog(
@ -271,19 +276,20 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
maxLines: 2, maxLines: 2,
minLines: 1, minLines: 1,
controller: conditionController, controller: conditionController,
isDropDown: true, isTextFieldHasSuffix: true,
enabled: false, enabled: false,
hasBorder: true,
validationError: isFormSubmitted &&
widget.mySelectedAssessment
.selectedDiagnosisCondition == null?TranslationBase
.of(context)
.emptyMessage:null,
), ),
if (isFormSubmitted &&
widget.mySelectedAssessment
.selectedDiagnosisCondition ==
null)
CustomValidationError(),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
AppTextFieldCustom( AppTextFieldCustom(
height: 55.0,
onClick: model.listOfDiagnosisType != null onClick: model.listOfDiagnosisType != null
? () { ? () {
MasterKeyDailog dialog = MasterKeyDailog( MasterKeyDailog dialog = MasterKeyDailog(
@ -315,40 +321,30 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
maxLines: 2, maxLines: 2,
minLines: 1, minLines: 1,
enabled: false, enabled: false,
isDropDown: true, isTextFieldHasSuffix: true,
controller: typeController, controller: typeController,
hasBorder: true,
validationError: isFormSubmitted &&
widget.mySelectedAssessment
.selectedDiagnosisType == null?TranslationBase
.of(context)
.emptyMessage:null,
), ),
if (isFormSubmitted &&
widget.mySelectedAssessment
.selectedDiagnosisType ==
null)
CustomValidationError(),
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container( Container(
margin: EdgeInsets.only(left: 0, right: 0, top: 15), margin: EdgeInsets.only(left: 0, right: 0, top: 15),
child: TextFields( child: AppTextFieldCustom(
hintText: TranslationBase.of(context).remarks, hintText: TranslationBase.of(context).remarks,
fontSize: 13.5,
fontWeight: FontWeight.w600,
maxLines: 18, maxLines: 18,
minLines: 5, minLines: 5,
hasLabelText:
remarkController.text != '' ? true : false,
showLabelText: true,
controller: remarkController, controller: remarkController,
onChanged: (value) { onChanged: (value) {
widget.mySelectedAssessment.remark = widget.mySelectedAssessment.remark =
remarkController.text; remarkController.text;
}, },
validator: (value) { ),
if (value == null)
return TranslationBase.of(context)
.emptyMessage;
else
return null;
}),
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -458,7 +454,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
} }
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
} else { } else {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);

@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.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/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
@ -496,7 +497,7 @@ class _UpdateAssessmentPageState extends State<UpdateAssessmentPage> {
loading: model.state == ViewState.BusyLocal, loading: model.state == ViewState.BusyLocal,
onPressed: () async { onPressed: () async {
if (widget.mySelectedAssessmentList.isEmpty) { if (widget.mySelectedAssessmentList.isEmpty) {
helpers.showErrorToast( Helpers.showErrorToast(
TranslationBase TranslationBase
.of(context) .of(context)
.assessmentErrorMsg); .assessmentErrorMsg);

@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.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-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/app-textfield-custom.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/expandable-widget-header-body.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';

@ -1,7 +1,7 @@
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.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-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/app-textfield-custom.dart';
import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -43,7 +43,7 @@ class _ExaminationsListSearchWidgetState
AppTextFieldCustom( AppTextFieldCustom(
height: MediaQuery.of(context).size.height * 0.080, height: MediaQuery.of(context).size.height * 0.080,
hintText: TranslationBase.of(context).searchExamination, hintText: TranslationBase.of(context).searchExamination,
isDropDown: true, isTextFieldHasSuffix: true,
hasBorder: false, hasBorder: false,
controller: filteredSearchController, controller: filteredSearchController,
onChanged: (value) { onChanged: (value) {

@ -2,8 +2,6 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart';
@ -11,6 +9,7 @@ import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.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/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -131,9 +130,14 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
}).toList(), }).toList(),
) )
], ],
), ),
isExpanded: isSysExaminationExpand, isExpanded: isSysExaminationExpand,
), ),
SizedBox(height: MediaQuery
.of(context)
.size
.height * 0.12,)
], ],
), ),
), ),
@ -250,14 +254,14 @@ class _UpdateObjectivePageState extends State<UpdateObjectivePage> {
} }
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
} else { } else {
widget.changeLoadingState(true); widget.changeLoadingState(true);
widget.changePageViewIndex(2); widget.changePageViewIndex(2);
} }
} else { } else {
helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg); Helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg);
} }
} }

@ -13,7 +13,7 @@ import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.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/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/app-textfield-custom.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.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:flutter/material.dart'; import 'package:flutter/material.dart';
@ -85,7 +85,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
await model.getPatientProgressNote(getGetProgressNoteReqModel); await model.getPatientProgressNote(getGetProgressNoteReqModel);
if (model.patientProgressNoteList.isNotEmpty) { if (model.patientProgressNoteList.isNotEmpty) {
progressNoteController.text = helpers progressNoteController.text = Helpers
.parseHtmlString(model.patientProgressNoteList[0].planNote); .parseHtmlString(model.patientProgressNoteList[0].planNote);
widget.patientProgressNote.planNote = progressNoteController.text; widget.patientProgressNote.planNote = progressNoteController.text;
widget.patientProgressNote.createdByName = model.patientProgressNoteList[0].createdByName; widget.patientProgressNote.createdByName = model.patientProgressNoteList[0].createdByName;
@ -303,7 +303,7 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
Navigator.of(context).pop(); Navigator.of(context).pop();
} }
} else { } else {
helpers.showErrorToast(TranslationBase.of(context) Helpers.showErrorToast(TranslationBase.of(context)
.progressNoteErrorMsg); .progressNoteErrorMsg);
} }
}, },
@ -342,12 +342,12 @@ class _UpdatePlanPageState extends State<UpdatePlanPage> {
} }
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
} else { } else {
widget.changePageViewIndex(4,isChangeState:false); widget.changePageViewIndex(4,isChangeState:false);
} }
} else { } else {
helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg); Helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg);
} }
} }

@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.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/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -207,7 +208,7 @@ class _AddAllergiesState extends State<AddAllergies> {
addAllergyLocally(MySelectedAllergy mySelectedAllergy) { addAllergyLocally(MySelectedAllergy mySelectedAllergy) {
if (mySelectedAllergy.selectedAllergy == null) { if (mySelectedAllergy.selectedAllergy == null) {
helpers.showErrorToast(TranslationBase Helpers.showErrorToast(TranslationBase
.of(context) .of(context)
.requiredMsg); .requiredMsg);
} else { } else {

@ -1,5 +1,6 @@
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.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/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
@ -187,7 +188,7 @@ class _UpdateAllergiesWidgetState extends State<UpdateAllergiesWidget> {
changeParentState(); changeParentState();
Navigator.of(context).pop(); Navigator.of(context).pop();
} else { } else {
helpers.showErrorToast(TranslationBase Helpers.showErrorToast(TranslationBase
.of(context) .of(context)
.requiredMsg); .requiredMsg);
} }

@ -1,5 +1,6 @@
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/new_text_Field.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/app-textfield-custom.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/new_text_Field.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -35,33 +36,28 @@ class UpdateChiefComplaints extends StatelessWidget {
height: 20, height: 20,
), ),
//TODO handel error cases //TODO handel error cases
NewTextFields( AppTextFieldCustom(
hintText: TranslationBase.of(context).addChiefComplaints, hintText: TranslationBase.of(context).addChiefComplaints,
controller: complaintsController, controller: complaintsController,
maxLines: 25, maxLines: 25,
minLines: 3, minLines: 7,
), hasBorder: true,
validationError:complaintsController.text.isEmpty && complaintsControllerError !=''?complaintsControllerError:null ,
Container( ),
child: CustomValidationError(
error: complaintsControllerError,
)),
SizedBox( SizedBox(
height: 20, height: 20,
), ),
NewTextFields( AppTextFieldCustom(
hintText: TranslationBase hintText: TranslationBase
.of(context) .of(context)
.historyOfPresentIllness, .historyOfPresentIllness,
controller: illnessController, controller: illnessController,
maxLines: 25, maxLines: 25,
minLines: 3, minLines: 7,
), hasBorder: true,
Container( validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null ,
child: CustomValidationError(error: illnessControllerError,)),
SizedBox(
height: 20,
), ),
SizedBox( SizedBox(
height: 10, height: 10,
@ -72,16 +68,17 @@ class UpdateChiefComplaints extends StatelessWidget {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
NewTextFields( AppTextFieldCustom(
hintText: TranslationBase hintText: TranslationBase
.of(context) .of(context)
.currentMedications, .currentMedications,
controller: medicationController, controller: medicationController,
maxLines: 25, maxLines: 25,
minLines: 3, minLines: 7,
hasBorder: true,
validationError:medicationController.text.isEmpty && medicationControllerError !=''?medicationControllerError:null ,
), ),
Container(child: CustomValidationError(
error: medicationControllerError,)),
SizedBox( SizedBox(
height: 10, height: 10,
), ),

@ -8,11 +8,13 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.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/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.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/dialogs/master_key_dailog.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/app-textfield-custom.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/auto_complete_text_field.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/text_field_error.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/text_fields_utils.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';
@ -45,47 +47,13 @@ class _AddMedicationState extends State<AddMedication> {
GetMedicationResponseModel _selectedMedication; GetMedicationResponseModel _selectedMedication;
GlobalKey key = GlobalKey key =
new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>(); new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
bool isFormSubmitted = false; bool isFormSubmitted = false;
InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{IconData icon}) {
return InputDecoration(
filled: true,
fillColor: Colors.white,
contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 10),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey, width: 0.00),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey, width: 0.00),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey, width: 0.00),
borderRadius: BorderRadius.circular(8),
),
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null,
hintStyle: TextStyle(
fontSize: 10,
color: Theme
.of(context)
.hintColor,
fontWeight: FontWeight.w700
),
);
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
final screenSize = MediaQuery final screenSize = MediaQuery.of(context).size;
.of(context)
.size;
return FractionallySizedBox( return FractionallySizedBox(
child: BaseView<SOAPViewModel>( child: BaseView<SOAPViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
@ -136,7 +104,7 @@ class _AddMedicationState extends State<AddMedication> {
height: 16, height: 16,
), ),
Container( Container(
height: screenSize.height * 0.070, // height: screenSize.height * 0.070,
child: InkWell( child: InkWell(
onTap: model.allMedicationList != null onTap: model.allMedicationList != null
? () { ? () {
@ -146,48 +114,55 @@ class _AddMedicationState extends State<AddMedication> {
} }
: null, : null,
child: _selectedMedication == null child: _selectedMedication == null
? AutoCompleteTextField< ?
GetMedicationResponseModel>(
decoration:
textFieldSelectorDecoration(
TranslationBase.of(context)
.searchMedicineNameHere, CustomAutoCompleteTextField(
_selectedMedication != null isShowError: isFormSubmitted &&
? _selectedMedication _selectedMedication ==null,
.genericName child: AutoCompleteTextField<
: null, GetMedicationResponseModel>(
true,
icon: EvaIcons.search), decoration:
itemSubmitted: (item) => setState( TextFieldsUtils.textFieldSelectorDecoration(
() => TranslationBase.of(context)
_selectedMedication = item), .searchMedicineNameHere, null, true, suffixIcon: Icons.search),
key: key,
suggestions: itemSubmitted: (item) =>
model.allMedicationList, setState(
itemBuilder: (context, () =>
suggestion) => _selectedMedication =
new Padding( item),
child: Texts(suggestion key: key,
.description + suggestions:
'/' + model.allMedicationList,
suggestion.genericName), itemBuilder: (context,
padding: suggestion) =>
EdgeInsets.all(8.0)), new Padding(
itemSorter: (a, b) => 1, child: Texts(suggestion
itemFilter: (suggestion, input) => .description +
suggestion.genericName '/' +
.toLowerCase() suggestion
.startsWith( .genericName),
input.toLowerCase()) || padding:
suggestion.description EdgeInsets.all(8.0)),
.toLowerCase() itemSorter: (a, b) => 1,
.startsWith( itemFilter: (suggestion,
input.toLowerCase()) || input) =>
suggestion.keywords suggestion.genericName
.toLowerCase() .toLowerCase()
.startsWith( .startsWith(
input.toLowerCase()), input.toLowerCase()) ||
suggestion.description
.toLowerCase()
.startsWith(
input
.toLowerCase()) ||
suggestion.keywords
.toLowerCase()
.startsWith(
input.toLowerCase()),
),
) )
: AppTextFieldCustom( : AppTextFieldCustom(
hintText: _selectedMedication != null hintText: _selectedMedication != null
@ -198,13 +173,12 @@ class _AddMedicationState extends State<AddMedication> {
.searchMedicineNameHere, .searchMedicineNameHere,
minLines: 2, minLines: 2,
maxLines: 2, maxLines: 2,
isTextFieldHasSuffix: true,
suffixIcon: Icon(Icons.search,color: Colors.grey.shade600,),
enabled: false, enabled: false,
), ),
), ),
), ),
if (isFormSubmitted &&
_selectedMedication == null)
CustomValidationError(),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
@ -231,6 +205,7 @@ class _AddMedicationState extends State<AddMedication> {
.nameEn; .nameEn;
}); });
}, },
); );
showDialog( showDialog(
barrierDismissible: false, barrierDismissible: false,
@ -245,21 +220,19 @@ class _AddMedicationState extends State<AddMedication> {
TranslationBase.of(context).doseTime, TranslationBase.of(context).doseTime,
maxLines: 2, maxLines: 2,
minLines: 2, minLines: 2,
isDropDown: true, isTextFieldHasSuffix: true,
controller: doseController, controller: doseController,
validationError:isFormSubmitted &&
_selectedMedicationDose == null?TranslationBase
.of(context)
.emptyMessage:null,
), ),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
if (isFormSubmitted &&
_selectedMedicationDose == null)
CustomValidationError(),
SizedBox(
height: 5,
),
AppTextFieldCustom( AppTextFieldCustom(
enabled: false, enabled: false,
isDropDown: true, isTextFieldHasSuffix: true,
onClick: model.medicationStrengthList != null onClick: model.medicationStrengthList != null
? () { ? () {
MasterKeyDailog dialog = MasterKeyDailog dialog =
@ -296,19 +269,20 @@ class _AddMedicationState extends State<AddMedication> {
maxLines: 2, maxLines: 2,
minLines: 2, minLines: 2,
controller: strengthController, controller: strengthController,
validationError:isFormSubmitted &&
_selectedMedicationStrength == null?TranslationBase
.of(context)
.emptyMessage:null,
), ),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
if (isFormSubmitted &&
_selectedMedicationStrength == null)
CustomValidationError(),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
AppTextFieldCustom( AppTextFieldCustom(
enabled: false, enabled: false,
isDropDown: true, isTextFieldHasSuffix: true,
onClick: model.medicationRouteList != null onClick: model.medicationRouteList != null
? () { ? () {
MasterKeyDailog dialog = MasterKeyDailog dialog =
@ -344,13 +318,14 @@ class _AddMedicationState extends State<AddMedication> {
maxLines: 2, maxLines: 2,
minLines: 2, minLines: 2,
controller: routeController, controller: routeController,
validationError:isFormSubmitted &&
_selectedMedicationRoute == null?TranslationBase
.of(context)
.emptyMessage:null,
), ),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
if (isFormSubmitted &&
_selectedMedicationRoute == null)
CustomValidationError(),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
@ -391,15 +366,16 @@ class _AddMedicationState extends State<AddMedication> {
enabled: false, enabled: false,
maxLines: 2, maxLines: 2,
minLines: 2, minLines: 2,
isDropDown: true, isTextFieldHasSuffix: true,
controller: frequencyController, controller: frequencyController,
validationError:isFormSubmitted &&
_selectedMedicationFrequency == null?TranslationBase
.of(context)
.emptyMessage:null,
), ),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
if (isFormSubmitted &&
_selectedMedicationFrequency == null)
CustomValidationError(),
SizedBox( SizedBox(
height: 30, height: 30,
), ),

@ -1,4 +1,3 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
@ -15,6 +14,7 @@ import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.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/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
@ -208,7 +208,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
await model.getPatientChiefComplaint(getChiefComplaintReqModel); await model.getPatientChiefComplaint(getChiefComplaintReqModel);
if (model.patientChiefComplaintList.isNotEmpty) { if (model.patientChiefComplaintList.isNotEmpty) {
isChiefExpand = true; isChiefExpand = true;
complaintsController.text = helpers.parseHtmlString( complaintsController.text = Helpers.parseHtmlString(
model.patientChiefComplaintList[0].chiefComplaint); model.patientChiefComplaintList[0].chiefComplaint);
illnessController.text = model.patientChiefComplaintList[0].hopi; illnessController.text = model.patientChiefComplaintList[0].hopi;
medicationController.text =!(model.patientChiefComplaintList[0].currentMedication).isNotEmpty ? model.patientChiefComplaintList[0].currentMedication + '\n \n':model.patientChiefComplaintList[0].currentMedication; medicationController.text =!(model.patientChiefComplaintList[0].currentMedication).isNotEmpty ? model.patientChiefComplaintList[0].currentMedication + '\n \n':model.patientChiefComplaintList[0].currentMedication;
@ -376,19 +376,19 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
complaintsController.text.length > 25) { complaintsController.text.length > 25) {
await postChiefComplaint(model: model); await postChiefComplaint(model: model);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
} }
if (myHistoryList.length != 0) { if (myHistoryList.length != 0) {
await postHistories(model: model, myHistoryList: myHistoryList); await postHistories(model: model, myHistoryList: myHistoryList);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
} }
} }
if (myAllergiesList.length != 0) { if (myAllergiesList.length != 0) {
await postAllergy(myAllergiesList: myAllergiesList, model: model); await postAllergy(myAllergiesList: myAllergiesList, model: model);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
} }
} }
widget.changeLoadingState(true); widget.changeLoadingState(true);
@ -419,7 +419,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
.emptyMessage; .emptyMessage;
} }
}); });
helpers.showErrorToast(TranslationBase Helpers.showErrorToast(TranslationBase
.of(context) .of(context)
.chiefComplaintErrorMsg); .chiefComplaintErrorMsg);
} }
@ -470,7 +470,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
await model.getPatientAllergy(generalGetReqForSOAP, isLocalBusy : true); await model.getPatientAllergy(generalGetReqForSOAP, isLocalBusy : true);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
} }
} }
@ -501,7 +501,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> {
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
} }
} }

@ -20,7 +20,7 @@ import 'package:doctor_app_flutter/widgets/medicine/medicine_item_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.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/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/app_text_form_field.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/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
@ -83,7 +83,7 @@ postProcedure(
await model.postPrescription(postProcedureReqModel, patient.patientMRN); await model.postPrescription(postProcedureReqModel, patient.patientMRN);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
} else if (model.state == ViewState.Idle) { } else if (model.state == ViewState.Idle) {
model.getPrescriptions(patient); model.getPrescriptions(patient);
DrAppToastMsg.showSuccesToast('Medication has been added'); DrAppToastMsg.showSuccesToast('Medication has been added');
@ -715,7 +715,7 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
}); });
if (route == if (route ==
null) { null) {
helpers.showErrorToast( Helpers.showErrorToast(
'plase fill'); 'plase fill');
} }
}, },
@ -1556,12 +1556,12 @@ class _PrescriptionFormWidgetState extends State<PrescriptionFormWidget> {
searchMedicine(context, MedicineViewModel model) async { searchMedicine(context, MedicineViewModel model) async {
FocusScope.of(context).unfocus(); FocusScope.of(context).unfocus();
// if (myController.text.isEmpty()) { // if (myController.text.isEmpty()) {
// helpers.showErrorToast(TranslationBase.of(context).typeMedicineName); // Helpers.showErrorToast(TranslationBase.of(context).typeMedicineName);
// //"Type Medicine Name") // //"Type Medicine Name")
// return; // return;
// } // }
if (myController.text.length < 3) { if (myController.text.length < 3) {
helpers.showErrorToast(TranslationBase.of(context).moreThan3Letter); Helpers.showErrorToast(TranslationBase.of(context).moreThan3Letter);
return; return;
} }

@ -30,6 +30,7 @@ class PrescriptionItemsPage extends StatelessWidget {
model.getPrescriptionReport(prescriptions: prescriptions,patient: patient), model.getPrescriptionReport(prescriptions: prescriptions,patient: patient),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
backgroundColor: Colors.grey[100],
baseViewModel: model, baseViewModel: model,
appBar: PatientProfileHeaderWhitAppointmentAppBar( appBar: PatientProfileHeaderWhitAppointmentAppBar(
patient: patient, patient: patient,

@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/prescription/add_prescription_form.dart'; import 'package:doctor_app_flutter/screens/prescription/add_prescription_form.dart';
import 'package:doctor_app_flutter/screens/prescription/update_prescription_form.dart'; import 'package:doctor_app_flutter/screens/prescription/update_prescription_form.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.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/patients/profile/patient-page-header-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
@ -227,7 +228,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
13.5, 13.5,
), ),
AppText( AppText(
Helpers.getMonth(model.prescriptionList[0].entityList[index].createdOn != DateUtils.getMonth(model.prescriptionList[0].entityList[index].createdOn !=
null null
? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn)
.month) .month)
@ -250,7 +251,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
.green, .green,
), ),
AppText( AppText(
Helpers.getTimeFormated(DateTime.parse(model DateUtils.getTimeFormated(DateTime.parse(model
.prescriptionList[ .prescriptionList[
0] 0]
.entityList[ .entityList[
@ -290,7 +291,7 @@ class _NewPrescriptionScreenState extends State<NewPrescriptionScreen> {
Expanded( Expanded(
child: child:
AppText( AppText(
Helpers.getDateFormatted(DateTime.parse(model DateUtils.getDateFormatted(DateTime.parse(model
.prescriptionList[0] .prescriptionList[0]
.entityList[index] .entityList[index]
.startDate)), .startDate)),

@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/prescription/add_prescription_form.dart'; import 'package:doctor_app_flutter/screens/prescription/add_prescription_form.dart';
import 'package:doctor_app_flutter/screens/prescription/update_prescription_form.dart'; import 'package:doctor_app_flutter/screens/prescription/update_prescription_form.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.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/patients/profile/patient-page-header-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
@ -128,7 +129,7 @@ class _NewPrescriptionHistoryScreenState
13.5, 13.5,
), ),
AppText( AppText(
Helpers.getMonth(model.prescriptionList[0].entityList[index].createdOn != DateUtils.getMonth(model.prescriptionList[0].entityList[index].createdOn !=
null null
? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn)
.month) .month)
@ -151,7 +152,7 @@ class _NewPrescriptionHistoryScreenState
.green, .green,
), ),
AppText( AppText(
Helpers.getTimeFormated(DateTime.parse(model DateUtils.getTimeFormated(DateTime.parse(model
.prescriptionList[ .prescriptionList[
0] 0]
.entityList[ .entityList[
@ -190,7 +191,7 @@ class _NewPrescriptionHistoryScreenState
Expanded( Expanded(
child: child:
AppText( AppText(
Helpers.getDateFormatted(DateTime.parse(model DateUtils.getDateFormatted(DateTime.parse(model
.prescriptionList[0] .prescriptionList[0]
.entityList[index] .entityList[index]
.startDate)), .startDate)),

@ -1,7 +1,7 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/app_text_form_field.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:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';

@ -666,7 +666,7 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
child: TextField( child: TextField(
decoration: Helpers decoration: Helpers
.textFieldSelectorDecoration( .textFieldSelectorDecoration(
Helpers.getDateFormatted( DateUtils.getDateFormatted(
DateTime.parse( DateTime.parse(
widget.startDate)), widget.startDate)),
selectedDate != null selectedDate != null
@ -1005,7 +1005,7 @@ class _UpdatePrescriptionFormState extends State<UpdatePrescriptionForm> {
updatePrescriptionReqModel, patient.patientMRN); updatePrescriptionReqModel, patient.patientMRN);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
} else if (model.state == ViewState.Idle) { } else if (model.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('Medication has been updated'); DrAppToastMsg.showSuccesToast('Medication has been updated');
} }

@ -1,9 +1,12 @@
import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/patients/profile/lab_result/FlowChartPage.dart';
import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/date-utils.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/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -13,13 +16,16 @@ class ProcedureCard extends StatelessWidget {
final EntityList entityList; final EntityList entityList;
final String categoryName; final String categoryName;
final int categoryID; final int categoryID;
final PatiantInformtion patient;
const ProcedureCard( const ProcedureCard(
{Key key, {Key key,
this.onTap, this.onTap,
this.entityList, this.entityList,
this.categoryID, this.categoryID,
this.categoryName}) this.categoryName,
this.patient,
})
: super(key: key); : super(key: key);
@override @override
@ -154,6 +160,27 @@ class ProcedureCard extends StatelessWidget {
), ),
], ],
), ),
Container(
alignment: Alignment.centerRight,
child: InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: FlowChartPage(
filterName: entityList.procedureName,
patient: patient,
),
),
);
},
child: Texts(
TranslationBase.of(context).showMoreBtn,
textDecoration: TextDecoration.underline,
color: Colors.blue,
),
),
),
// Row( // Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween, // mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [ // children: [

@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.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/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
@ -75,22 +76,22 @@ postProcedure(
await model.postProcedure(postProcedureReqModel, patient.patientMRN); await model.postProcedure(postProcedureReqModel, patient.patientMRN);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
model.getProcedure(mrn: patient.patientMRN); model.getProcedure(mrn: patient.patientMRN);
} else if (model.state == ViewState.Idle) { } else if (model.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('procedure has been added'); DrAppToastMsg.showSuccesToast('procedure has been added');
} }
} else { } else {
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
model.getProcedure(mrn: patient.patientMRN); model.getProcedure(mrn: patient.patientMRN);
} else if (model.state == ViewState.Idle) { } else if (model.state == ViewState.Idle) {
helpers.showErrorToast( Helpers.showErrorToast(
model.valadteProcedureList[0].entityList[0].warringMessages); model.valadteProcedureList[0].entityList[0].warringMessages);
} }
} }
} else { } else {
helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
} }
} }

@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.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/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
@ -75,22 +76,22 @@ postProcedure(
await model.postProcedure(postProcedureReqModel, patient.patientMRN); await model.postProcedure(postProcedureReqModel, patient.patientMRN);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
model.getLabs(patient); model.getLabs(patient);
} else if (model.state == ViewState.Idle) { } else if (model.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('procedure has been added'); DrAppToastMsg.showSuccesToast('procedure has been added');
} }
} else { } else {
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
model.getLabs(patient); model.getLabs(patient);
} else if (model.state == ViewState.Idle) { } else if (model.state == ViewState.Idle) {
helpers.showErrorToast( Helpers.showErrorToast(
model.valadteProcedureList[0].entityList[0].warringMessages); model.valadteProcedureList[0].entityList[0].warringMessages);
} }
} }
} else { } else {
helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
} }
} }

@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.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/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
@ -75,22 +76,22 @@ postProcedure(
await model.postProcedure(postProcedureReqModel, patient.patientMRN); await model.postProcedure(postProcedureReqModel, patient.patientMRN);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
model.getPatientRadOrders(patient); model.getPatientRadOrders(patient);
} else if (model.state == ViewState.Idle) { } else if (model.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('procedure has been added'); DrAppToastMsg.showSuccesToast('procedure has been added');
} }
} else { } else {
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
model.getPatientRadOrders(patient); model.getPatientRadOrders(patient);
} else if (model.state == ViewState.Idle) { } else if (model.state == ViewState.Idle) {
helpers.showErrorToast( Helpers.showErrorToast(
model.valadteProcedureList[0].entityList[0].warringMessages); model.valadteProcedureList[0].entityList[0].warringMessages);
} }
} }
} else { } else {
helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
} }
} }

@ -170,9 +170,10 @@ class ProcedureScreen extends StatelessWidget {
limetNo: model.procedureList[0].entityList[index] limetNo: model.procedureList[0].entityList[index]
.lineItemNo); .lineItemNo);
// } else // } else
// helpers.showErrorToast( // Helpers.showErrorToast(
// 'You Cant Update This Procedure'); // 'You Cant Update This Procedure');
}, },
patient: patient,
), ),
), ),
if (model.procedureList.length != 0 && if (model.procedureList.length != 0 &&

@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/procedures/entity_list_checkbox_search_widget.dart'; import 'package:doctor_app_flutter/screens/procedures/entity_list_checkbox_search_widget.dart';
import 'package:doctor_app_flutter/screens/procedures/entity_list_procedure_widget.dart'; import 'package:doctor_app_flutter/screens/procedures/entity_list_procedure_widget.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.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/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
@ -410,7 +411,7 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
mrn: patient.patientMRN); mrn: patient.patientMRN);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
helpers.showErrorToast(model.error); Helpers.showErrorToast(model.error);
model.getProcedure(mrn: patient.patientMRN); model.getProcedure(mrn: patient.patientMRN);
} else if (model.state == ViewState.Idle) { } else if (model.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('procedure has been updated'); DrAppToastMsg.showSuccesToast('procedure has been updated');

@ -11,12 +11,11 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/text_validator.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/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.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_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/app_text_form_field.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/rounded_container_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';

@ -10,13 +10,12 @@ import 'package:doctor_app_flutter/screens/sick-leave/add-sickleave.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/text_validator.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/patients/profile/patient-page-header-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart';
import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.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_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/app_text_form_field.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/rounded_container_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';

@ -320,4 +320,36 @@ class DateUtils {
return false; return false;
} }
static String getDate(DateTime dateTime) {
print(dateTime);
if (dateTime != null)
return getMonth(dateTime.month) +
" " +
dateTime.day.toString() +
"," +
dateTime.year.toString();
else
return "";
}
static String getDateFormatted(DateTime dateTime) {
print(dateTime);
if (dateTime != null)
return dateTime.day.toString() +
"/" +
dateTime.month.toString() +
"/" +
dateTime.year.toString();
else
return "";
}
static String getTimeFormated(DateTime dateTime) {
print(dateTime);
if (dateTime != null)
return dateTime.hour.toString() + ":" + dateTime.minute.toString();
else
return "";
}
} }

@ -33,7 +33,7 @@ class DrAppToastMsg {
textColor: Colors.white); textColor: Colors.white);
} }
void showShortToast(msg) { static void showShortToast(msg) {
FlutterFlexibleToast.showToast( FlutterFlexibleToast.showToast(
message: msg, message: msg,
toastLength: Toast.LENGTH_SHORT, toastLength: Toast.LENGTH_SHORT,
@ -50,7 +50,7 @@ class DrAppToastMsg {
timeInSeconds: 1); timeInSeconds: 1);
} }
void showCenterShortToast(msg) { static void showCenterShortToast(msg) {
FlutterFlexibleToast.showToast( FlutterFlexibleToast.showToast(
message: msg, message: msg,
toastLength: Toast.LENGTH_SHORT, toastLength: Toast.LENGTH_SHORT,
@ -59,7 +59,7 @@ class DrAppToastMsg {
timeInSeconds: 1); timeInSeconds: 1);
} }
void showCenterShortLoadingToast(msg) { static void showCenterShortLoadingToast(msg) {
FlutterFlexibleToast.showToast( FlutterFlexibleToast.showToast(
message: msg, message: msg,
toastLength: Toast.LENGTH_LONG, toastLength: Toast.LENGTH_LONG,
@ -72,7 +72,7 @@ class DrAppToastMsg {
timeInSeconds: 2); timeInSeconds: 2);
} }
void cancelToast(msg) { static void cancelToast(msg) {
FlutterFlexibleToast.cancel(); FlutterFlexibleToast.cancel();
} }
} }

@ -1,7 +1,3 @@
// OWNER : Ibrahim albitar
// DATE : 19-04-2020
// DESCRIPTION : Extension for all classes objects.
extension Extension on Object { extension Extension on Object {
bool isNullOrEmpty() => this == null || this == ''; bool isNullOrEmpty() => this == null || this == '';

@ -18,27 +18,11 @@ import 'dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
/*
*@author: Elham Rababah
*@Date:12/4/2020
*@param:
*@return:
*@desc: This class will contian some Function will help developer
*/
class Helpers { class Helpers {
int cupertinoPickerIndex = 0; static int cupertinoPickerIndex = 0;
get currentLanguage => null; get currentLanguage => null;
static showCupertinoPicker(context, items, decKey, onSelectFun) {
/*
*@author: Elham Rababah
*@Date:12/4/2020
*@param: context, items, decKey, onSelectFun
*@return: Container Widget
*@desc: showCupertinoPicker its a general function to show cupertino picker
*/
showCupertinoPicker(context, items, decKey, onSelectFun) {
showModalBottomSheet( showModalBottomSheet(
isDismissible: false, isDismissible: false,
context: context, context: context,
@ -86,23 +70,14 @@ class Helpers {
}); });
} }
TextStyle textStyle(context) => static TextStyle textStyle(context) =>
TextStyle(color: Theme.of(context).primaryColor); TextStyle(color: Theme.of(context).primaryColor);
/* static buildPickerItems(context, List items, decKey, onSelectFun) {
*@author: Elham Rababah
*@Date:12/4/2020
*@param: context, List items, decKey, onSelectFun
*@return: Container widget
*@desc: buildPickerIterm this function will build the items of the cupertino
*/
buildPickerItems(context, List items, decKey, onSelectFun) {
return CupertinoPicker( return CupertinoPicker(
magnification: 1.5, magnification: 1.5,
scrollController: scrollController:
FixedExtentScrollController(initialItem: cupertinoPickerIndex), FixedExtentScrollController(initialItem: cupertinoPickerIndex),
// backgroundColor: Colors.black87,
children: items.map((item) { children: items.map((item) {
return Text( return Text(
'${item["$decKey"]}', '${item["$decKey"]}',
@ -111,23 +86,14 @@ class Helpers {
}).toList(), }).toList(),
itemExtent: 25, itemExtent: 25,
//height of each item
looping: false, looping: false,
onSelectedItemChanged: (int index) { onSelectedItemChanged: (int index) {
// selectitem =index;
cupertinoPickerIndex = index; cupertinoPickerIndex = index;
}, },
); );
} }
/* static showErrorToast([msg = null]) {
*@author: Elham Rababah
*@Date:12/4/2020
*@param: msg
*@return:
*@desc: showErrorToast
*/
showErrorToast([msg = null]) {
String localMsg = generateContactAdminMsg(); String localMsg = generateContactAdminMsg();
if (msg != null) { if (msg != null) {
@ -136,14 +102,6 @@ class Helpers {
DrAppToastMsg.showErrorToast(localMsg); DrAppToastMsg.showErrorToast(localMsg);
} }
/*
*@author: Mohammad Aljammal
*@Date:27/4/2020
*@param:
*@return: Boolean
*@desc: Check The Internet Connection
*/
static Future<bool> checkConnection() async { static Future<bool> checkConnection() async {
ConnectivityResult connectivityResult = ConnectivityResult connectivityResult =
await (Connectivity().checkConnectivity()); await (Connectivity().checkConnectivity());
@ -155,172 +113,6 @@ 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 "";
}
static String getTimeFormated(DateTime dateTime) {
print(dateTime);
if (dateTime != null)
return dateTime.hour.toString() + ":" + dateTime.minute.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) { static List<WorkingHours> getWorkingHours(String workingHours) {
List<WorkingHours> myWorkingHours = []; List<WorkingHours> myWorkingHours = [];
List<String> listOfHours = workingHours.split('a'); List<String> listOfHours = workingHours.split('a');
@ -337,14 +129,7 @@ class Helpers {
return myWorkingHours; return myWorkingHours;
} }
/* static generateContactAdminMsg([err = null]) {
*@author: Elham Rababah
*@Date:12/5/2020
*@param:
*@return: String
*@desc: generate Contact Admin Msg
*/
generateContactAdminMsg([err = null]) {
String localMsg = 'Something wrong happened, please contact the admin'; String localMsg = 'Something wrong happened, please contact the admin';
if (err != null) { if (err != null) {
localMsg = localMsg + '\n \n' + err.toString(); localMsg = localMsg + '\n \n' + err.toString();
@ -356,7 +141,7 @@ class Helpers {
await sharedPref.clear(); await sharedPref.clear();
} }
logout() async { static logout() async {
DEVICE_TOKEN = ""; DEVICE_TOKEN = "";
String lang = await sharedPref.getString(APP_Language); String lang = await sharedPref.getString(APP_Language);
await clearSharedPref(); await clearSharedPref();
@ -378,7 +163,7 @@ class Helpers {
(r) => false); (r) => false);
} }
String parseHtmlString(String htmlString) { static String parseHtmlString(String htmlString) {
final document = parse(htmlString); final document = parse(htmlString);
final String parsedString = parse(document.body.text).documentElement.text; final String parsedString = parse(document.body.text).documentElement.text;

@ -1,37 +0,0 @@
import '../util/extenstions.dart';
class TextValidator{
// OWNER : Ibrahim albitar
// DATE : 19-04-2020
// DESCRIPTION : Text Validator.
String validateName(String value) {
if (value.isNullOrEmpty()||value.length < 3)
return 'Name must be more than 2 charater';
else
return null;
}
String validateMobile(String value) {
if (value.isNullOrEmpty()||value.length != 10)
return 'Mobile Number must be of 10 digit';
else
return null;
}
String validateIdNumber(String value) {
if (value.isNullOrEmpty())
return 'Please input valid number';
else
return null;
}
String validateDate(String value) {
if (value.isNullOrEmpty())
return 'Please input valid date';
else
return null;
}
}

@ -1,23 +1,19 @@
import 'package:doctor_app_flutter/lookups/hospital_lookup.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/viewModel/imei_view_model.dart';
import 'package:doctor_app_flutter/screens/auth/verification_methods_screen.dart'; import 'package:doctor_app_flutter/screens/auth/verification_methods_screen.dart';
import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; import 'package:doctor_app_flutter/widgets/shared/app_button.dart';
import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.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/user-guid/text_fields/app_text_form_field.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart'; import 'package:flutter/rendering.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:imei_plugin/imei_plugin.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../config/shared_pref_kay.dart'; import '../../config/shared_pref_kay.dart';
import '../../config/size_config.dart'; import '../../config/size_config.dart';
import '../../models/doctor/user_model.dart'; import '../../models/doctor/user_model.dart';
import '../../core/viewModel/auth_view_model.dart';
import '../../core/viewModel/hospital_view_model.dart'; import '../../core/viewModel/hospital_view_model.dart';
import '../../routes.dart';
import '../../util/dr_app_shared_pref.dart'; import '../../util/dr_app_shared_pref.dart';
import '../../util/dr_app_toast_msg.dart'; import '../../util/dr_app_toast_msg.dart';
import '../../util/helpers.dart'; import '../../util/helpers.dart';
@ -28,35 +24,22 @@ DrAppToastMsg toastMsg = DrAppToastMsg();
Helpers helpers = Helpers(); Helpers helpers = Helpers();
class LoginForm extends StatefulWidget with DrAppToastMsg { class LoginForm extends StatefulWidget with DrAppToastMsg {
LoginForm({this.changeLoadingStata}); LoginForm({this.model});
final Function changeLoadingStata; final IMEIViewModel model;
@override @override
_LoginFormState createState() => _LoginFormState(); _LoginFormState createState() => _LoginFormState();
} }
//TODO recreate the all page and apply the MVVM here
class _LoginFormState extends State<LoginForm> { class _LoginFormState extends State<LoginForm> {
final loginFormKey = GlobalKey<FormState>(); final loginFormKey = GlobalKey<FormState>();
var projectIdController = TextEditingController(); var projectIdController = TextEditingController();
String _platformImei = 'Unknown';
String uniqueId = "Unknown";
var projectsList = []; var projectsList = [];
bool _isInit = true;
FocusNode focusPass = FocusNode(); FocusNode focusPass = FocusNode();
FocusNode focusProject = FocusNode(); FocusNode focusProject = FocusNode();
HospitalViewModel projectsProv; HospitalViewModel projectsProv;
var userInfo = UserModel( var userInfo = UserModel();
userID: '',
password: '',
projectID: 15,
languageID: 2,
iPAdress: "11.11.11.11",
versionID: 1.2,
channel: 9,
sessionID: "i1UJwCTSqt");
AuthViewModel authProv;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -64,9 +47,7 @@ class _LoginFormState extends State<LoginForm> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
authProv = Provider.of<AuthViewModel>(context);
projectsProv = Provider.of<HospitalViewModel>(context); projectsProv = Provider.of<HospitalViewModel>(context);
return Form( return Form(
key: loginFormKey, key: loginFormKey,
child: Column( child: Column(
@ -108,10 +89,7 @@ class _LoginFormState extends State<LoginForm> {
borderColor: Colors.white, borderColor: Colors.white,
// keyboardType: TextInputType.number, // keyboardType: TextInputType.number,
textInputAction: TextInputAction.next, textInputAction: TextInputAction.next,
// decoration: buildInputDecoration(
// context,
// TranslationBase.of(context).enterId,
// 'assets/images/user_id_icon.png'),
validator: (value) { validator: (value) {
if (value != null && value.isEmpty) { if (value != null && value.isEmpty) {
return TranslationBase.of(context) return TranslationBase.of(context)
@ -128,8 +106,6 @@ class _LoginFormState extends State<LoginForm> {
onFieldSubmitted: (_) { onFieldSubmitted: (_) {
focusPass.nextFocus(); focusPass.nextFocus();
}, },
// onEditingComplete: () {},
// autofocus: false,
) )
])), ])),
buildSizedBox(), buildSizedBox(),
@ -156,10 +132,6 @@ class _LoginFormState extends State<LoginForm> {
obscureText: true, obscureText: true,
borderColor: Colors.white, borderColor: Colors.white,
textInputAction: TextInputAction.next, textInputAction: TextInputAction.next,
// decoration: buildInputDecoration(
// context,
// TranslationBase.of(context).enterPassword,
// 'assets/images/password_icon.png'),
validator: (value) { validator: (value) {
if (value != null && value.isEmpty) { if (value != null && value.isEmpty) {
return TranslationBase.of(context) return TranslationBase.of(context)
@ -172,7 +144,7 @@ class _LoginFormState extends State<LoginForm> {
}, },
onFieldSubmitted: (_) { onFieldSubmitted: (_) {
focusPass.nextFocus(); focusPass.nextFocus();
helpers.showCupertinoPicker(context, projectsList, Helpers.showCupertinoPicker(context, projectsList,
'facilityName', onSelectProject); 'facilityName', onSelectProject);
}, },
onTap: () { onTap: () {
@ -205,18 +177,12 @@ class _LoginFormState extends State<LoginForm> {
borderColor: Colors.white, borderColor: Colors.white,
suffixIcon: Icons.arrow_drop_down, suffixIcon: Icons.arrow_drop_down,
onTap: () { onTap: () {
helpers.showCupertinoPicker( Helpers.showCupertinoPicker(
context, context,
projectsList, projectsList,
'facilityName', 'facilityName',
onSelectProject); onSelectProject);
}, },
// showCursor: false,
// //readOnly: true,
// decoration: buildInputDecoration(
// context,
// TranslationBase.of(context).selectYourProject,
// 'assets/images/password_icon.png'),
validator: (value) { validator: (value) {
if (value != null && value.isEmpty) { if (value != null && value.isEmpty) {
return TranslationBase.of(context) return TranslationBase.of(context)
@ -244,18 +210,13 @@ class _LoginFormState extends State<LoginForm> {
fontSize: 14, fontSize: 14,
)), )),
AppTextFormField( AppTextFormField(
readOnly: true, borderColor: Colors.white, readOnly: true,
borderColor: Colors.white,
prefix: IconButton( prefix: IconButton(
icon: Icon(Icons.arrow_drop_down), icon: Icon(Icons.arrow_drop_down),
iconSize: 30, iconSize: 30,
padding: EdgeInsets.only(bottom: 30), padding: EdgeInsets.only(bottom: 30),
), ),
// decoration: buildInputDecoration(
// context,
// TranslationBase.of(context)
// .pleaseEnterYourProject,
// 'assets/images/password_icon.png')
) )
])), ])),
]), ]),
@ -268,67 +229,15 @@ class _LoginFormState extends State<LoginForm> {
title: TranslationBase.of(context).login, title: TranslationBase.of(context).login,
color: HexColor('#D02127'), color: HexColor('#D02127'),
onTap: () { onTap: () {
login(context, authProv, widget.changeLoadingStata); login(context, this.widget.model);
}, },
)), )),
], ],
) )
// Row(
// mainAxisAlignment: MainAxisAlignment.end,
// children: <Widget>[
// RaisedButton(
// onPressed: () {
// login(context, authProv, widget.changeLoadingStata);
// },
// textColor: Colors.white,
// elevation: 0.0,
// padding: const EdgeInsets.all(0.0),
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(10),
// side: BorderSide(width: 0.5, color: HexColor('#CCCCCC'))),
// child: Container(
// padding: const EdgeInsets.all(10.0),
// height: 50,
// width: SizeConfig.realScreenWidth * 0.35,
// child: ),
// )
// ],
// ),
], ],
), ),
); );
} //));
/*
*@author: Elham Rababah
*@Date:20/4/2020
*@param: context, hint, asset
*@return: InputDecoration
*@desc: decorate input feilds
*/
InputDecoration buildInputDecoration(BuildContext context, hint, asset) {
return InputDecoration(
// prefixIcon: Image.asset(asset),
hintText: hint,
hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
fillColor: Colors.white,
enabledBorder: OutlineInputBorder(
//borderRadius: BorderRadius.all(Radius.circular(20)),
borderSide: BorderSide(color: HexColor('#CCCCCC')),
),
focusedBorder: OutlineInputBorder(
// borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Theme.of(context).primaryColor),
),
errorBorder: OutlineInputBorder(
// borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Theme.of(context).errorColor),
),
focusedErrorBorder: OutlineInputBorder(
// borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Theme.of(context).errorColor),
),
);
} }
SizedBox buildSizedBox() { SizedBox buildSizedBox() {
@ -337,103 +246,27 @@ class _LoginFormState extends State<LoginForm> {
); );
} }
login(context, AuthViewModel authProv, Function changeLoadingStata) { login(
showLoading(); context,
model,
) {
if (loginFormKey.currentState.validate()) { if (loginFormKey.currentState.validate()) {
loginFormKey.currentState.save(); loginFormKey.currentState.save();
sharedPref.setInt(PROJECT_ID, userInfo.projectID); sharedPref.setInt(PROJECT_ID, userInfo.projectID);
authProv.login(userInfo).then((res) { model.login(userInfo).then((res) {
//changeLoadingStata(false); if (model.loginInfo['MessageStatus'] == 1) {
hideLoading(); saveObjToString(LOGGED_IN_USER, model.loginInfo);
if (res['MessageStatus'] == 1) {
// insertDeviceImei(res, authProv);
saveObjToString(LOGGED_IN_USER, res);
sharedPref.remove(LAST_LOGIN_USER); sharedPref.remove(LAST_LOGIN_USER);
sharedPref.setString(TOKEN, res['LogInTokenID']); sharedPref.setString(TOKEN, model.loginInfo['LogInTokenID']);
print("token" + res['LogInTokenID']); Navigator.of(AppGlobal.CONTEX).pushReplacement(MaterialPageRoute(
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (BuildContext context) => VerificationMethodsScreen(
password: userInfo.password,
)));
} else {
// handel error
helpers.showErrorToast(res['ErrorEndUserMessage']);
}
}).catchError((err) {
//TODO change the logic here
if(!err.contains('eservices.hmg@drsulaimanalhabib.com') ){
hideLoading();
changeLoadingStata(false);
helpers.showErrorToast(err);}
});
} else {
changeLoadingStata(false);
}
}
insertDeviceImei(preRes, AuthViewModel authProv) {
if (_platformImei != 'Unknown') {
var imeiInfo = {
"IMEI": _platformImei,
"LogInType": 1,
"DoctorID": preRes['DoctorID'],
"DoctorName": "Test User",
"Gender": 1,
"ClinicID": 3,
"ProjectID": 15,
"DoctorTitle": "Mr.",
"ClinicName": "MED",
"ProjectName": "",
"DoctorImageURL": "UNKNOWN",
"LogInTokenID": preRes['LogInTokenID'],
"VersionID": 5.3
};
authProv.insertDeviceImei(imeiInfo).then((res) {
if (res['MessageStatus'] == 1) {
setSharedPref('platformImei', _platformImei);
saveObjToString(LOGGED_IN_USER, preRes);
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (BuildContext context) => VerificationMethodsScreen( builder: (BuildContext context) => VerificationMethodsScreen(
password: userInfo.password, password: userInfo.password,
))); )));
// save imei on shared preferance
} else {
// handel error
helpers.showErrorToast(res['ErrorEndUserMessage']);
} }
}).catchError((err) {
print(err);
helpers.showErrorToast();
}); });
} }
} }
// Platform messages are asynchronous, so we initialize in an async method.
Future<void> initPlatformState() async {
String platformImei;
String idunique;
// Platform messages may fail, so we use a try/catch PlatformException.
try {
platformImei =
await ImeiPlugin.getImei(shouldShowRequestPermissionRationale: false);
idunique = await ImeiPlugin.getImei();
} catch (e) {
platformImei = 'Failed to get platform version.';
}
// If the widget was removed from the tree while the asynchronous platform
// message was in flight, we want to discard the reply rather than calling
// setState to update our non-existent appearance.
if (!mounted) return;
setState(() {
_platformImei = platformImei;
uniqueId = idunique;
});
}
Future<void> setSharedPref(key, value) async { Future<void> setSharedPref(key, value) async {
sharedPref.setString(key, value).then((success) { sharedPref.setString(key, value).then((success) {
print("sharedPref.setString" + success.toString()); print("sharedPref.setString" + success.toString());
@ -441,9 +274,7 @@ class _LoginFormState extends State<LoginForm> {
} }
getProjectsList(memberID) { getProjectsList(memberID) {
//showLoading();
projectsProv.getProjectsList(memberID).then((res) { projectsProv.getProjectsList(memberID).then((res) {
//hideLoading();
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
projectsList = res['ProjectInfo']; projectsList = res['ProjectInfo'];
setState(() { setState(() {
@ -452,16 +283,7 @@ class _LoginFormState extends State<LoginForm> {
}); });
} else { } else {
print(res); print(res);
// handel error
// setState(() {
// projectsList = ListProject;
// });
} }
}).catchError((err) {
setState(() {
print(err);
});
print(err);
}); });
} }
@ -478,26 +300,11 @@ class _LoginFormState extends State<LoginForm> {
primaryFocus.unfocus(); primaryFocus.unfocus();
} }
showLoading() {
showDialog(
context: context,
builder: (BuildContext context) {
return Center(
child: CircularProgressIndicator(),
);
});
}
hideLoading() {
Navigator.pop(context);
}
getProjects(value) { getProjects(value) {
if (value != null && value != '') { if (value != null && value != '') {
if (projectsList.length == 0) { if (projectsList.length == 0) {
getProjectsList(value); getProjectsList(value);
} }
} }
//_isInit = false;
} }
} }

@ -96,10 +96,10 @@ class _ShowTimerTextState extends State<ShowTimerText> {
if (res['MessageStatus'] == 1) if (res['MessageStatus'] == 1)
{resendCode()} {resendCode()}
else else
{helpers.showErrorToast(res['ErrorEndUserMessage'])} {Helpers.showErrorToast(res['ErrorEndUserMessage'])}
}) })
.catchError((err) { .catchError((err) {
helpers.showErrorToast(); Helpers.showErrorToast();
}); });
} }
} }

@ -239,13 +239,6 @@ class _VerifyAccountState extends State<VerifyAccount> {
}); });
} }
/*
*@author: Elham Rababah
*@Date:19/4/2020
*@param:
*@return:
*@desc: change the style for the input field
*/
TextStyle buildTextStyle() { TextStyle buildTextStyle() {
return TextStyle( return TextStyle(
fontSize: SizeConfig.textMultiplier * 3, fontSize: SizeConfig.textMultiplier * 3,
@ -260,16 +253,8 @@ class _VerifyAccountState extends State<VerifyAccount> {
return null; return null;
} }
/*
*@author: Elham Rababah
*@Date:28/4/2020
*@param: context
*@return:InputDecoration
*@desc: buildInputDecoration
*/
InputDecoration buildInputDecoration(BuildContext context) { InputDecoration buildInputDecoration(BuildContext context) {
return InputDecoration( return InputDecoration(
// ts/images/password_icon.png
contentPadding: EdgeInsets.only(top: 30, bottom: 30), contentPadding: EdgeInsets.only(top: 30, bottom: 30),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10)), borderRadius: BorderRadius.all(Radius.circular(10)),
@ -290,13 +275,6 @@ class _VerifyAccountState extends State<VerifyAccount> {
); );
} }
/*
*@author: Elham Rababah
*@Date:28/4/2020
*@param:
*@return: RichText
*@desc: buildText
*/
RichText buildText() { RichText buildText() {
String medthodName; String medthodName;
switch (model['OTP_SendType']) { switch (model['OTP_SendType']) {
@ -329,13 +307,6 @@ class _VerifyAccountState extends State<VerifyAccount> {
); );
} }
/*
*@author: Elham Rababah
*@Date:15/4/2020
*@param: authProv
*@return:
*@desc: verify Account func call sendActivationCodeByOtpNotificationType service
*/
verifyAccount(AuthViewModel authProv, Function changeLoadingStata) async { verifyAccount(AuthViewModel authProv, Function changeLoadingStata) async {
if (verifyAccountForm.currentState.validate()) { if (verifyAccountForm.currentState.validate()) {
changeLoadingStata(true); changeLoadingStata(true);
@ -346,23 +317,6 @@ class _VerifyAccountState extends State<VerifyAccount> {
verifyAccountFormValue['digit3'] + verifyAccountFormValue['digit3'] +
verifyAccountFormValue['digit4']; verifyAccountFormValue['digit4'];
int projectID = await sharedPref.getInt(PROJECT_ID);
Map<String, dynamic> model = {
"activationCode": activationCode,
"DoctorID": _loggedUser['DoctorID'],
"LogInTokenID": _loggedUser['LogInTokenID'],
"ProjectID": projectID,
"LanguageID": 2,
"stamp": "2020-02-26T14:48:27.221Z",
"IPAdress": "11.11.11.11",
"VersionID": 1.2,
"Channel": 9,
"TokenID": "",
"SessionID": "i1UJwCTSqt",
"IsLoginForDoctorApp": true,
"IsSilentLogIN": false
};
CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = CheckActivationCodeRequestModel checkActivationCodeForDoctorApp =
new CheckActivationCodeRequestModel( new CheckActivationCodeRequestModel(
zipCode: _loggedUser['ZipCode'], zipCode: _loggedUser['ZipCode'],
@ -387,22 +341,15 @@ class _VerifyAccountState extends State<VerifyAccount> {
} }
} else { } else {
changeLoadingStata(false); changeLoadingStata(false);
helpers.showErrorToast(res['ErrorEndUserMessage']); Helpers.showErrorToast(res['ErrorEndUserMessage']);
} }
}).catchError((err) { }).catchError((err) {
changeLoadingStata(false); changeLoadingStata(false);
helpers.showErrorToast(err); Helpers.showErrorToast(err);
}); });
} }
} }
/*
*@author: Elham Rababah
*@Date:17/5/2020
*@param: Map<String, dynamic> profile, Function changeLoadingStata
*@return:
*@desc: loginProcessCompleted
*/
loginProcessCompleted( loginProcessCompleted(
Map<String, dynamic> profile, Function changeLoadingStata) { Map<String, dynamic> profile, Function changeLoadingStata) {
var doctor = DoctorProfileModel.fromJson(profile); var doctor = DoctorProfileModel.fromJson(profile);
@ -412,43 +359,10 @@ class _VerifyAccountState extends State<VerifyAccount> {
} }
getDashboard(doctor, Function changeLoadingStata) { getDashboard(doctor, Function changeLoadingStata) {
// authProv.getDashboard(doctor).then((value) {
// print(value);
changeLoadingStata(false); changeLoadingStata(false);
// sharedPref.setObj(DASHBOARD_DATA, value);
Navigator.of(context).pushReplacementNamed(HOME); Navigator.of(context).pushReplacementNamed(HOME);
// });
}
Future<dynamic> _asyncSimpleDialog(
BuildContext context, List list, String txtKey,
[String text = '']) async {
return await showDialog<dynamic>(
context: context,
barrierDismissible: true,
builder: (BuildContext context) {
return SimpleDialog(
title: Text(text),
children: list.map((value) {
return SimpleDialogOption(
onPressed: () {
Navigator.pop(context,
value); //here passing the index to be return on item selection
},
child: Text(value[txtKey]), //item value
);
}).toList(),
);
});
} }
/*
*@author: Elham Rababah
*@Date:17/5/2020
*@param: ClinicModel clinicInfo, Function changeLoadingStata
*@return:
*@desc: getDocProfiles
*/
getDocProfiles(ClinicModel clinicInfo, Function changeLoadingStata) { getDocProfiles(ClinicModel clinicInfo, Function changeLoadingStata) {
ProfileReqModel docInfo = new ProfileReqModel( ProfileReqModel docInfo = new ProfileReqModel(
doctorID: clinicInfo.doctorID, doctorID: clinicInfo.doctorID,
@ -462,11 +376,11 @@ class _VerifyAccountState extends State<VerifyAccount> {
loginProcessCompleted(res['DoctorProfileList'][0], changeLoadingStata); loginProcessCompleted(res['DoctorProfileList'][0], changeLoadingStata);
} else { } else {
changeLoadingStata(false); changeLoadingStata(false);
helpers.showErrorToast(res['ErrorEndUserMessage']); Helpers.showErrorToast(res['ErrorEndUserMessage']);
} }
}).catchError((err) { }).catchError((err) {
changeLoadingStata(false); changeLoadingStata(false);
helpers.showErrorToast(err); Helpers.showErrorToast(err);
}); });
} }
} }

@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/models/auth/send_activation_code_model2.dart'
import 'package:doctor_app_flutter/models/doctor/clinic_model.dart'; import 'package:doctor_app_flutter/models/doctor/clinic_model.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.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/otp/sms-popup.dart'; import 'package:doctor_app_flutter/widgets/otp/sms-popup.dart';
@ -111,7 +112,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
return DrAppCircularProgressIndeicator(); return DrAppCircularProgressIndeicator();
default: default:
if (snapshot.hasError) { if (snapshot.hasError) {
helpers.showErrorToast('Error: ${snapshot.error}'); Helpers.showErrorToast('Error: ${snapshot.error}');
return Text('Error: ${snapshot.error}'); return Text('Error: ${snapshot.error}');
} else { } else {
return SingleChildScrollView( return SingleChildScrollView(
@ -177,36 +178,19 @@ class _VerificationMethodsState extends State<VerificationMethods> {
user.logInTypeID, user.logInTypeID,
context), context),
fontSize: 14, fontSize: 14,
) ))),
// Text(
// user.editedOn != null
// ? formatDate(Helpers
// .convertStringToDate(
// user.editedOn))
// : user.createdOn != null
// ? formatDate(Helpers
// .convertStringToDate(user
// .createdOn))
// : '--',
// overflow:
// TextOverflow.ellipsis,
// style: TextStyle(
// fontFamily: 'Poppins'),
// textAlign:
// TextAlign.center),
)),
Flexible( Flexible(
flex: 2, flex: 2,
child: ListTile( child: ListTile(
title: AppText( title: AppText(
user.editedOn != null user.editedOn != null
? getDate(Helpers ? getDate(DateUtils
.convertStringToDate( .convertStringToDate(
user user
.editedOn)) .editedOn))
: user.createdOn != : user.createdOn !=
null null
? getDate(Helpers ? getDate(DateUtils
.convertStringToDate( .convertStringToDate(
user.createdOn)) user.createdOn))
: '--', : '--',
@ -218,13 +202,13 @@ class _VerificationMethodsState extends State<VerificationMethods> {
), ),
subtitle: AppText( subtitle: AppText(
user.editedOn != null user.editedOn != null
? getTime(Helpers ? getTime(DateUtils
.convertStringToDate( .convertStringToDate(
user user
.editedOn)) .editedOn))
: user.createdOn != : user.createdOn !=
null null
? getTime(Helpers ? getTime(DateUtils
.convertStringToDate( .convertStringToDate(
user.createdOn)) user.createdOn))
: '--', : '--',
@ -288,16 +272,6 @@ class _VerificationMethodsState extends State<VerificationMethods> {
Expanded( Expanded(
child: getButton(5, authProv)) child: getButton(5, authProv))
]), ]),
// Row(
// mainAxisAlignment:
// MainAxisAlignment.center,
// children: <Widget>[
// Expanded(
// child: getButton(1, authProv)),
// Expanded(
// child: getButton(2, authProv))
// ],
// )
]) ])
: Column( : Column(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
@ -366,13 +340,6 @@ class _VerificationMethodsState extends State<VerificationMethods> {
return verificationMethod == 4 || verificationMethod == 3 ? true : false; return verificationMethod == 4 || verificationMethod == 3 ? true : false;
} }
/*
*@author: Elham Rababah
*@Date:15/4/2020
*@param: oTPSendType
*@return:
*@desc: send Activation Code By Otp Notification Type
*/
sendActivationCodeByOtpNotificationType( sendActivationCodeByOtpNotificationType(
oTPSendType, AuthViewModel authProv) async { oTPSendType, AuthViewModel authProv) async {
// TODO : build enum for verfication method // TODO : build enum for verfication method
@ -401,19 +368,19 @@ class _VerificationMethodsState extends State<VerificationMethods> {
this.startSMSService(oTPSendType, authProv); this.startSMSService(oTPSendType, authProv);
} else { } else {
print(res['ErrorEndUserMessage']); print(res['ErrorEndUserMessage']);
helpers.showErrorToast(res['ErrorEndUserMessage']); Helpers.showErrorToast(res['ErrorEndUserMessage']);
} }
}).catchError((err) { }).catchError((err) {
print('$err'); print('$err');
widget.changeLoadingStata(false); widget.changeLoadingStata(false);
helpers.showErrorToast(); Helpers.showErrorToast();
}); });
} catch (e) {} } catch (e) {}
} 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) { if (Platform.isAndroid && oTPSendType == 3) {
helpers.showErrorToast('Your device not support this feature'); Helpers.showErrorToast('Your device not support this feature');
} else { } else {
// Navigator.of(context).push(MaterialPageRoute( // Navigator.of(context).push(MaterialPageRoute(
// builder: (BuildContext context) => // builder: (BuildContext context) =>
@ -459,13 +426,13 @@ class _VerificationMethodsState extends State<VerificationMethods> {
} }
} else { } else {
print(res['ErrorEndUserMessage']); print(res['ErrorEndUserMessage']);
helpers.showErrorToast(res['ErrorEndUserMessage']); Helpers.showErrorToast(res['ErrorEndUserMessage']);
} }
}).catchError((err) { }).catchError((err) {
print('$err'); print('$err');
widget.changeLoadingStata(false); widget.changeLoadingStata(false);
helpers.showErrorToast(); Helpers.showErrorToast();
}); });
} catch (e) {} } catch (e) {}
// } // }
@ -846,11 +813,11 @@ class _VerificationMethodsState extends State<VerificationMethods> {
} }
} else { } else {
Navigator.pop(context); Navigator.pop(context);
helpers.showErrorToast(res['ErrorEndUserMessage']); Helpers.showErrorToast(res['ErrorEndUserMessage']);
} }
}).catchError((err) { }).catchError((err) {
Navigator.pop(context); Navigator.pop(context);
helpers.showErrorToast(err); Helpers.showErrorToast(err);
}); });
} }
@ -860,7 +827,12 @@ class _VerificationMethodsState extends State<VerificationMethods> {
sharedPref.setObj(DOCTOR_PROFILE, profile); sharedPref.setObj(DOCTOR_PROFILE, profile);
projectsProvider.isLogin = true; projectsProvider.isLogin = true;
Navigator.pushAndRemoveUntil(context, FadePage(page: LandingPage(),), (r) => false); Navigator.pushAndRemoveUntil(
context,
FadePage(
page: LandingPage(),
),
(r) => false);
} }
getDocProfiles(ClinicModel clinicInfo, authProv) { getDocProfiles(ClinicModel clinicInfo, authProv) {
@ -876,11 +848,11 @@ class _VerificationMethodsState extends State<VerificationMethods> {
loginProcessCompleted(res['DoctorProfileList'][0], authProv); loginProcessCompleted(res['DoctorProfileList'][0], authProv);
} else { } else {
// changeLoadingStata(false); // changeLoadingStata(false);
helpers.showErrorToast(res['ErrorEndUserMessage']); Helpers.showErrorToast(res['ErrorEndUserMessage']);
} }
}).catchError((err) { }).catchError((err) {
// changeLoadingStata(false); // changeLoadingStata(false);
helpers.showErrorToast(err); Helpers.showErrorToast(err);
}); });
} }

@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/custom_validation_error.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/custom_validation_error.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_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/app_text_form_field.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';

@ -1,4 +1,5 @@
import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_model.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_model.dart';
import 'package:doctor_app_flutter/util/date-utils.dart';
import 'package:doctor_app_flutter/util/helpers.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/Text.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -90,7 +91,7 @@ class _VitalSignDetailsWidgetState extends State<VitalSignDetailsWidget> {
color: Colors.white, color: Colors.white,
child: Center( child: Center(
child: Texts( child: Texts(
'${Helpers.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${Helpers.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', '${DateUtils.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${DateUtils.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ',
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
), ),

@ -177,7 +177,7 @@ class _AppDrawerState extends State<AppDrawer> {
), ),
onTap: () async { onTap: () async {
Navigator.pop(context); Navigator.pop(context);
await helpers.logout(); await Helpers.logout();
projectsProvider.isLogin = false; projectsProvider.isLogin = false;
}, },
), ),

@ -7,13 +7,13 @@ import 'package:doctor_app_flutter/widgets/shared/user-guid/custom_validation_er
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/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/new_text_Field.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/new_text_Field.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'app-textfield-custom.dart'; import 'user-guid/text_fields/app-textfield-custom.dart';
import 'app_texts_widget.dart'; import 'app_texts_widget.dart';
import 'dialogs/master_key_dailog.dart'; import 'dialogs/master_key_dailog.dart';
import 'divider_with_spaces_around.dart'; import 'divider_with_spaces_around.dart';
@ -81,7 +81,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
AppTextFieldCustom( AppTextFieldCustom(
height: MediaQuery.of(context).size.height * 0.070, height: MediaQuery.of(context).size.height * 0.070,
hintText: TranslationBase.of(context).selectAllergy, hintText: TranslationBase.of(context).selectAllergy,
isDropDown: true, isTextFieldHasSuffix: true,
hasBorder: false, hasBorder: false,
// controller: filteredSearchController, // controller: filteredSearchController,
onChanged: (value) { onChanged: (value) {
@ -284,7 +284,7 @@ class _MasterKeyCheckboxSearchAllergiesWidgetState
); );
} }
: null, : null,
isDropDown: true, isTextFieldHasSuffix: true,
hintText: hintText:
TranslationBase TranslationBase
.of(context) .of(context)

@ -11,7 +11,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'app-textfield-custom.dart'; import 'user-guid/text_fields/app-textfield-custom.dart';
import 'app_texts_widget.dart'; import 'app_texts_widget.dart';
class MasterKeyCheckboxSearchWidget extends StatefulWidget { class MasterKeyCheckboxSearchWidget extends StatefulWidget {
@ -75,7 +75,7 @@ class _MasterKeyCheckboxSearchWidgetState extends State<MasterKeyCheckboxSearchW
AppTextFieldCustom( AppTextFieldCustom(
height: MediaQuery.of(context).size.height * 0.070, height: MediaQuery.of(context).size.height * 0.070,
hintText: TranslationBase.of(context).searchHistory, hintText: TranslationBase.of(context).searchHistory,
isDropDown: true, isTextFieldHasSuffix: true,
hasBorder: false, hasBorder: false,
// controller: filteredSearchController, // controller: filteredSearchController,
onChanged: (value) { onChanged: (value) {

@ -1,15 +1,17 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/text_field_error.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/text_fields_utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'app_texts_widget.dart'; import '../../app_texts_widget.dart';
class AppTextFieldCustom extends StatefulWidget { class AppTextFieldCustom extends StatefulWidget {
final double height; final double height;
final Function onClick; final Function onClick;
final String hintText; final String hintText;
final TextEditingController controller; final TextEditingController controller;
final bool isDropDown; final bool isTextFieldHasSuffix;
final bool hasBorder; final bool hasBorder;
final String dropDownText; final String dropDownText;
final Icon suffixIcon; final Icon suffixIcon;
@ -28,7 +30,7 @@ class AppTextFieldCustom extends StatefulWidget {
this.hintText, this.hintText,
this.controller, this.controller,
this.hasBorder = true, this.hasBorder = true,
this.isDropDown = false, this.isTextFieldHasSuffix = false,
this.dropDownText, this.dropDownText,
this.suffixIcon, this.suffixIcon,
this.dropDownColor, this.dropDownColor,
@ -53,7 +55,7 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
Container( Container(
height: widget.height != 0 ? widget.height + 8 : null, height: widget.height != 0 ? widget.height + 8 : null,
decoration: widget.hasBorder decoration: widget.hasBorder
? containerBorderDecoration( ? TextFieldsUtils.containerBorderDecoration(
Color(0Xffffffff), Color(0Xffffffff),
widget.validationError == null widget.validationError == null
? Color(0xFFEFEFEF) ? Color(0xFFEFEFEF)
@ -87,7 +89,7 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
widget.dropDownText == null widget.dropDownText == null
? TextField( ? TextField(
textAlign: TextAlign.left, textAlign: TextAlign.left,
decoration: textFieldSelectorDecoration( decoration: TextFieldsUtils.textFieldSelectorDecoration(
widget.hintText, null, true), widget.hintText, null, true),
style: TextStyle( style: TextStyle(
fontSize: SizeConfig.textMultiplier * 1.7, fontSize: SizeConfig.textMultiplier * 1.7,
@ -119,7 +121,7 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
), ),
), ),
), ),
widget.isDropDown widget.isTextFieldHasSuffix
? widget.suffixIcon != null ? widget.suffixIcon != null
? widget.suffixIcon ? widget.suffixIcon
: Icon( : Icon(
@ -134,91 +136,9 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
), ),
), ),
if (widget.validationError != null) if (widget.validationError != null)
Container( TextFieldsError(error: widget.validationError),
margin: EdgeInsets.only(top: 8, right: 8, left: 8, bottom: 8),
child: Row(
children: [
Icon(
DoctorApp.warning,
size: 20,
color: Colors.red.shade700,
),
SizedBox(
width: 12,
),
AppText(
widget.validationError,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.7,
color: Colors.red.shade700,
fontWeight: FontWeight.w700,
),
],
),
),
], ],
); );
} }
BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor,
{double borderWidth = -1}) {
return BoxDecoration(
color: containerColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(12)),
border: Border.fromBorderSide(BorderSide(
color: borderColor,
width: borderWidth == -1 ? 2.0 : borderWidth,
)),
);
}
static InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{Icon suffixIcon, Color dropDownColor}) {
return InputDecoration(
isDense: true,
contentPadding: EdgeInsets.symmetric(horizontal: 0, vertical: 0),
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Color(0Xffffffff)),
),
disabledBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Color(0Xffffffff)),
),
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Color(0Xffffffff)),
),
border: UnderlineInputBorder(
borderSide: BorderSide(color: Color(0Xffffffff)),
),
/*focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),*/
hintText: selectedText != null ? selectedText : hintText,
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
/*suffixIcon: isDropDown
? suffixIcon != null
? suffixIcon
: Icon(
Icons.arrow_drop_down,
color: dropDownColor != null ? dropDownColor : Colors.black,
)
: null,*/
// labelText:
// labelStyle:
);
}
} }

@ -0,0 +1,44 @@
import 'package:autocomplete_textfield/autocomplete_textfield.dart';
import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/text_field_error.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/text_fields/text_fields_utils.dart';
import 'package:flutter/material.dart';
import '../../Text.dart';
class CustomAutoCompleteTextField extends StatelessWidget {
final bool isShowError;
final Widget child;
const CustomAutoCompleteTextField({
Key key,
this.isShowError,
this.child,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
child: Column(
children: [
Container(
decoration: TextFieldsUtils.containerBorderDecoration(
Color(0Xffffffff),
isShowError ? Colors.red.shade700 : Color(0xFFEFEFEF),
),
padding:
EdgeInsets.only(top: 0.2, bottom: 2.0, left: 8.0, right: 0.0),
child: child,
),
if (isShowError)
TextFieldsError(
error: TranslationBase.of(context).emptyMessage,
)
],
),
);
}
}

@ -0,0 +1,41 @@
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:flutter/material.dart';
import '../../app_texts_widget.dart';
class TextFieldsError extends StatelessWidget {
const TextFieldsError({
Key key,
@required this.error,
}) : super(key: key);
final String error;
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.only(top: 8, right: 8, left: 8, bottom: 8),
child: Row(
children: [
Icon(
DoctorApp.warning,
size: 20,
color: Colors.red.shade700,
),
SizedBox(
width: 12,
),
AppText(
error,
fontFamily: 'Poppins',
fontSize: SizeConfig.textMultiplier * 1.7,
color: Colors.red.shade700,
fontWeight: FontWeight.w700,
),
],
),
);
}
}

@ -0,0 +1,59 @@
import 'package:flutter/material.dart';
class TextFieldsUtils{
static BoxDecoration containerBorderDecoration(
Color containerColor, Color borderColor,
{double borderWidth = -1}) {
return BoxDecoration(
color: containerColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.all(Radius.circular(12)),
border: Border.fromBorderSide(BorderSide(
color: borderColor,
width: borderWidth == -1 ? 2.0 : borderWidth,
)),
);
}
static InputDecoration textFieldSelectorDecoration(
String hintText, String selectedText, bool isDropDown,
{IconData suffixIcon, Color dropDownColor}) {
return InputDecoration(
isDense: true,
contentPadding: EdgeInsets.symmetric(horizontal: 0, vertical: 0),
enabledBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Color(0Xffffffff)),
),
disabledBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Color(0Xffffffff)),
),
focusedBorder: UnderlineInputBorder(
borderSide: BorderSide(color: Color(0Xffffffff)),
),
border: UnderlineInputBorder(
borderSide: BorderSide(color: Color(0Xffffffff)),
),
/*focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),
disabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0),
borderRadius: BorderRadius.circular(8),
),*/
hintText: selectedText != null ? selectedText : hintText,
suffixIcon: Icon(suffixIcon??null, color: Colors.grey.shade600,),
hintStyle: TextStyle(
fontSize: 14,
color: Colors.grey.shade600,
),
);
}
}
Loading…
Cancel
Save