From fda75c721dfc845ed6845fb478ce16a67caa5f56 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 19 Apr 2021 15:25:14 +0300 Subject: [PATCH 001/156] bug fixes --- lib/core/service/auth_service.dart | 36 +++- lib/core/viewModel/auth_view_model.dart | 15 +- lib/core/viewModel/imei_view_model.dart | 14 +- lib/landing_page.dart | 3 +- lib/locator.dart | 1 - lib/screens/auth/login_screen.dart | 2 +- lib/widgets/auth/login_form.dart | 233 ++------------------- lib/widgets/auth/verfiy_account.dart | 86 -------- lib/widgets/auth/verification_methods.dart | 43 +--- 9 files changed, 82 insertions(+), 351 deletions(-) diff --git a/lib/core/service/auth_service.dart b/lib/core/service/auth_service.dart index e116ccdd..f009fded 100644 --- a/lib/core/service/auth_service.dart +++ b/lib/core/service/auth_service.dart @@ -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/service/base/base_service.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 { List _imeiDetails = []; List get dashboardItemsList => _imeiDetails; - + Map _loginInfo = {}; + Map get loginInfo => _loginInfo; Future selectDeviceImei(imei) async { try { // dynamic localRes; @@ -26,4 +28,36 @@ class AuthService extends BaseService { 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; + // } + } } diff --git a/lib/core/viewModel/auth_view_model.dart b/lib/core/viewModel/auth_view_model.dart index 87b89123..dd684673 100644 --- a/lib/core/viewModel/auth_view_model.dart +++ b/lib/core/viewModel/auth_view_model.dart @@ -195,26 +195,19 @@ class AuthViewModel extends BaseViewModel { } } - /* - *@author: Elham Rababah - *@Date:17/5/2020 - *@param: docInfo - *@return:Future - *@desc: getDocProfiles - */ - Future getDocProfiles(docInfo, {bool allowChangeProfile = true}) async { + Future getDocProfiles(docInfo, + {bool allowChangeProfile = true}) async { try { dynamic localRes; await baseAppClient.post(GET_DOC_PROFILES, onSuccess: (dynamic response, int statusCode) { localRes = response; - if(allowChangeProfile) { + if (allowChangeProfile) { doctorProfile = DoctorProfileModel.fromJson(response['DoctorProfileList'][0]); selectedClinicName = - response['DoctorProfileList'][0]['ClinicDescription']; + response['DoctorProfileList'][0]['ClinicDescription']; } - }, onFailure: (String error, int statusCode) { throw error; }, body: docInfo); diff --git a/lib/core/viewModel/imei_view_model.dart b/lib/core/viewModel/imei_view_model.dart index 29253b1d..16798af5 100644 --- a/lib/core/viewModel/imei_view_model.dart +++ b/lib/core/viewModel/imei_view_model.dart @@ -4,11 +4,12 @@ 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/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; +import 'package:doctor_app_flutter/models/doctor/user_model.dart'; class IMEIViewModel extends BaseViewModel { AuthService _authService = locator(); List get imeiDetails => _authService.dashboardItemsList; - + get loginInfo => _authService.loginInfo; Future selectDeviceImei(imei) async { setState(ViewState.Busy); await _authService.selectDeviceImei(imei); @@ -18,4 +19,15 @@ class IMEIViewModel extends BaseViewModel { } else 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); + } } diff --git a/lib/landing_page.dart b/lib/landing_page.dart index 15975f95..53da4477 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -51,7 +51,8 @@ class _LandingPageState extends State { leading: Builder( builder: (BuildContext context) { return IconButton( - icon: Icon(DoctorApp.drawer_icon), + icon: Image.asset('assets/images/menu.png', + height: 50, width: 50), iconSize: 15, color: Colors.black, onPressed: () => Scaffold.of(context).openDrawer(), diff --git a/lib/locator.dart b/lib/locator.dart index 1e688d96..d64a8ed3 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -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/procedure_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/imei_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart'; diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart index 465ef71e..41941831 100644 --- a/lib/screens/auth/login_screen.dart +++ b/lib/screens/auth/login_screen.dart @@ -122,7 +122,7 @@ class _LoginsreenState extends State { height: 40, ), LoginForm( - changeLoadingStata: changeLoadingStata, + model: model, ), ], ) diff --git a/lib/widgets/auth/login_form.dart b/lib/widgets/auth/login_form.dart index 9fc50008..ef129e4a 100644 --- a/lib/widgets/auth/login_form.dart +++ b/lib/widgets/auth/login_form.dart @@ -1,7 +1,7 @@ -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/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:flutter/cupertino.dart'; @@ -9,15 +9,11 @@ import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; -import 'package:imei_plugin/imei_plugin.dart'; import 'package:provider/provider.dart'; - import '../../config/shared_pref_kay.dart'; import '../../config/size_config.dart'; import '../../models/doctor/user_model.dart'; -import '../../core/viewModel/auth_view_model.dart'; import '../../core/viewModel/hospital_view_model.dart'; -import '../../routes.dart'; import '../../util/dr_app_shared_pref.dart'; import '../../util/dr_app_toast_msg.dart'; import '../../util/helpers.dart'; @@ -28,35 +24,22 @@ DrAppToastMsg toastMsg = DrAppToastMsg(); Helpers helpers = Helpers(); class LoginForm extends StatefulWidget with DrAppToastMsg { - LoginForm({this.changeLoadingStata}); + LoginForm({this.model}); - final Function changeLoadingStata; + final IMEIViewModel model; @override _LoginFormState createState() => _LoginFormState(); } -//TODO recreate the all page and apply the MVVM here + class _LoginFormState extends State { final loginFormKey = GlobalKey(); var projectIdController = TextEditingController(); - String _platformImei = 'Unknown'; - String uniqueId = "Unknown"; var projectsList = []; - bool _isInit = true; FocusNode focusPass = FocusNode(); FocusNode focusProject = FocusNode(); HospitalViewModel projectsProv; - var userInfo = UserModel( - userID: '', - password: '', - projectID: 15, - languageID: 2, - iPAdress: "11.11.11.11", - versionID: 1.2, - channel: 9, - sessionID: "i1UJwCTSqt"); - - AuthViewModel authProv; + var userInfo = UserModel(); @override void initState() { super.initState(); @@ -64,9 +47,7 @@ class _LoginFormState extends State { @override Widget build(BuildContext context) { - authProv = Provider.of(context); projectsProv = Provider.of(context); - return Form( key: loginFormKey, child: Column( @@ -108,10 +89,7 @@ class _LoginFormState extends State { borderColor: Colors.white, // keyboardType: TextInputType.number, textInputAction: TextInputAction.next, - // decoration: buildInputDecoration( - // context, - // TranslationBase.of(context).enterId, - // 'assets/images/user_id_icon.png'), + validator: (value) { if (value != null && value.isEmpty) { return TranslationBase.of(context) @@ -128,8 +106,6 @@ class _LoginFormState extends State { onFieldSubmitted: (_) { focusPass.nextFocus(); }, - // onEditingComplete: () {}, - // autofocus: false, ) ])), buildSizedBox(), @@ -156,10 +132,6 @@ class _LoginFormState extends State { obscureText: true, borderColor: Colors.white, textInputAction: TextInputAction.next, - // decoration: buildInputDecoration( - // context, - // TranslationBase.of(context).enterPassword, - // 'assets/images/password_icon.png'), validator: (value) { if (value != null && value.isEmpty) { return TranslationBase.of(context) @@ -211,12 +183,6 @@ class _LoginFormState extends State { 'facilityName', onSelectProject); }, - // showCursor: false, - // //readOnly: true, - // decoration: buildInputDecoration( - // context, - // TranslationBase.of(context).selectYourProject, - // 'assets/images/password_icon.png'), validator: (value) { if (value != null && value.isEmpty) { return TranslationBase.of(context) @@ -244,18 +210,13 @@ class _LoginFormState extends State { fontSize: 14, )), AppTextFormField( - readOnly: true, borderColor: Colors.white, + readOnly: true, + borderColor: Colors.white, prefix: IconButton( icon: Icon(Icons.arrow_drop_down), iconSize: 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 { title: TranslationBase.of(context).login, color: HexColor('#D02127'), onTap: () { - login(context, authProv, widget.changeLoadingStata); + login(context, this.widget.model); }, )), ], ) - // Row( - // mainAxisAlignment: MainAxisAlignment.end, - // children: [ - // 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() { @@ -337,103 +246,27 @@ class _LoginFormState extends State { ); } - login(context, AuthViewModel authProv, Function changeLoadingStata) { - showLoading(); + login( + context, + model, + ) { if (loginFormKey.currentState.validate()) { loginFormKey.currentState.save(); sharedPref.setInt(PROJECT_ID, userInfo.projectID); - authProv.login(userInfo).then((res) { - //changeLoadingStata(false); - hideLoading(); - if (res['MessageStatus'] == 1) { - // insertDeviceImei(res, authProv); - saveObjToString(LOGGED_IN_USER, res); + model.login(userInfo).then((res) { + if (model.loginInfo['MessageStatus'] == 1) { + saveObjToString(LOGGED_IN_USER, model.loginInfo); sharedPref.remove(LAST_LOGIN_USER); - sharedPref.setString(TOKEN, res['LogInTokenID']); - print("token" + res['LogInTokenID']); - 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( + sharedPref.setString(TOKEN, model.loginInfo['LogInTokenID']); + Navigator.of(AppGlobal.CONTEX).pushReplacement(MaterialPageRoute( builder: (BuildContext context) => VerificationMethodsScreen( 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 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 setSharedPref(key, value) async { sharedPref.setString(key, value).then((success) { print("sharedPref.setString" + success.toString()); @@ -441,9 +274,7 @@ class _LoginFormState extends State { } getProjectsList(memberID) { - //showLoading(); projectsProv.getProjectsList(memberID).then((res) { - //hideLoading(); if (res['MessageStatus'] == 1) { projectsList = res['ProjectInfo']; setState(() { @@ -452,16 +283,7 @@ class _LoginFormState extends State { }); } else { print(res); - // handel error - // setState(() { - // projectsList = ListProject; - // }); } - }).catchError((err) { - setState(() { - print(err); - }); - print(err); }); } @@ -478,26 +300,11 @@ class _LoginFormState extends State { primaryFocus.unfocus(); } - showLoading() { - showDialog( - context: context, - builder: (BuildContext context) { - return Center( - child: CircularProgressIndicator(), - ); - }); - } - - hideLoading() { - Navigator.pop(context); - } - getProjects(value) { if (value != null && value != '') { if (projectsList.length == 0) { getProjectsList(value); } } - //_isInit = false; } } diff --git a/lib/widgets/auth/verfiy_account.dart b/lib/widgets/auth/verfiy_account.dart index 587c248c..b2ff2ece 100644 --- a/lib/widgets/auth/verfiy_account.dart +++ b/lib/widgets/auth/verfiy_account.dart @@ -239,13 +239,6 @@ class _VerifyAccountState extends State { }); } -/* - *@author: Elham Rababah - *@Date:19/4/2020 - *@param: - *@return: - *@desc: change the style for the input field - */ TextStyle buildTextStyle() { return TextStyle( fontSize: SizeConfig.textMultiplier * 3, @@ -260,16 +253,8 @@ class _VerifyAccountState extends State { return null; } -/* - *@author: Elham Rababah - *@Date:28/4/2020 - *@param: context - *@return:InputDecoration - *@desc: buildInputDecoration - */ InputDecoration buildInputDecoration(BuildContext context) { return InputDecoration( - // ts/images/password_icon.png contentPadding: EdgeInsets.only(top: 30, bottom: 30), enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10)), @@ -290,13 +275,6 @@ class _VerifyAccountState extends State { ); } -/* - *@author: Elham Rababah - *@Date:28/4/2020 - *@param: - *@return: RichText - *@desc: buildText - */ RichText buildText() { String medthodName; switch (model['OTP_SendType']) { @@ -329,13 +307,6 @@ class _VerifyAccountState extends State { ); } -/* - *@author: Elham Rababah - *@Date:15/4/2020 - *@param: authProv - *@return: - *@desc: verify Account func call sendActivationCodeByOtpNotificationType service - */ verifyAccount(AuthViewModel authProv, Function changeLoadingStata) async { if (verifyAccountForm.currentState.validate()) { changeLoadingStata(true); @@ -346,23 +317,6 @@ class _VerifyAccountState extends State { verifyAccountFormValue['digit3'] + verifyAccountFormValue['digit4']; - int projectID = await sharedPref.getInt(PROJECT_ID); - - Map 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 = new CheckActivationCodeRequestModel( zipCode: _loggedUser['ZipCode'], @@ -396,13 +350,6 @@ class _VerifyAccountState extends State { } } - /* - *@author: Elham Rababah - *@Date:17/5/2020 - *@param: Map profile, Function changeLoadingStata - *@return: - *@desc: loginProcessCompleted - */ loginProcessCompleted( Map profile, Function changeLoadingStata) { var doctor = DoctorProfileModel.fromJson(profile); @@ -412,43 +359,10 @@ class _VerifyAccountState extends State { } getDashboard(doctor, Function changeLoadingStata) { - // authProv.getDashboard(doctor).then((value) { - // print(value); changeLoadingStata(false); - // sharedPref.setObj(DASHBOARD_DATA, value); Navigator.of(context).pushReplacementNamed(HOME); - // }); - } - - Future _asyncSimpleDialog( - BuildContext context, List list, String txtKey, - [String text = '']) async { - return await showDialog( - context: context, - barrierDismissible: true, - builder: (BuildContext context) { - return SimpleDialog( - title: Text(text), - children: list.map((value) { - return SimpleDialogOption( - onPressed: () { - Navigator.pop(context, - value); //here passing the index to be return on item selection - }, - child: Text(value[txtKey]), //item value - ); - }).toList(), - ); - }); } - /* - *@author: Elham Rababah - *@Date:17/5/2020 - *@param: ClinicModel clinicInfo, Function changeLoadingStata - *@return: - *@desc: getDocProfiles - */ getDocProfiles(ClinicModel clinicInfo, Function changeLoadingStata) { ProfileReqModel docInfo = new ProfileReqModel( doctorID: clinicInfo.doctorID, diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index b4d39894..c3c59dde 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -177,24 +177,7 @@ class _VerificationMethodsState extends State { user.logInTypeID, context), 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( flex: 2, child: ListTile( @@ -288,16 +271,6 @@ class _VerificationMethodsState extends State { Expanded( child: getButton(5, authProv)) ]), - // Row( - // mainAxisAlignment: - // MainAxisAlignment.center, - // children: [ - // Expanded( - // child: getButton(1, authProv)), - // Expanded( - // child: getButton(2, authProv)) - // ], - // ) ]) : Column( mainAxisAlignment: MainAxisAlignment.start, @@ -366,13 +339,6 @@ class _VerificationMethodsState extends State { 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( oTPSendType, AuthViewModel authProv) async { // TODO : build enum for verfication method @@ -860,7 +826,12 @@ class _VerificationMethodsState extends State { sharedPref.setObj(DOCTOR_PROFILE, profile); projectsProvider.isLogin = true; - Navigator.pushAndRemoveUntil(context, FadePage(page: LandingPage(),), (r) => false); + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: LandingPage(), + ), + (r) => false); } getDocProfiles(ClinicModel clinicInfo, authProv) { From 59ec9d8e56ccfc01afaa83284ec8c8d7c4943e0b Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 19 Apr 2021 15:35:10 +0300 Subject: [PATCH 002/156] first step from change text fields --- lib/core/service/prescription_service.dart | 2 +- .../assessment/add_assessment_details.dart | 44 +++++++++---------- .../objective/update_objective_page.dart | 5 +++ .../update_Chief_complaints.dart | 35 +++++++-------- .../subjective/medication/add_medication.dart | 34 +++++++------- 5 files changed, 61 insertions(+), 59 deletions(-) diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/prescription_service.dart index 67b3491c..643c719d 100644 --- a/lib/core/service/prescription_service.dart +++ b/lib/core/service/prescription_service.dart @@ -112,7 +112,7 @@ class PrescriptionService extends LookupService { }, body: _drugRequestModel.toJson()); } - Future getMedicationList({String drug}) async { + Future getMedicationList({String drug =''}) async { hasError = false; _drugRequestModel.search = ["$drug"]; await baseAppClient.post(SEARCH_DRUG, diff --git a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart index a2083bd9..a0ac3678 100644 --- a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart +++ b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart @@ -220,6 +220,12 @@ class _AddAssessmentDetailsState extends State { maxLines: 2, minLines: 1, controller: icdNameController, + // hasBorder: true, + // validationError: isFormSubmitted && + // widget.mySelectedAssessment + // .selectedICD == null?TranslationBase + // .of(context) + // .emptyMessage:null, enabled: true, ) @@ -273,12 +279,14 @@ class _AddAssessmentDetailsState extends State { controller: conditionController, isDropDown: true, enabled: false, + hasBorder: true, + validationError: isFormSubmitted && + widget.mySelectedAssessment + .selectedDiagnosisCondition == null?TranslationBase + .of(context) + .emptyMessage:null, ), - if (isFormSubmitted && - widget.mySelectedAssessment - .selectedDiagnosisCondition == - null) - CustomValidationError(), + SizedBox( height: 10, ), @@ -317,38 +325,28 @@ class _AddAssessmentDetailsState extends State { enabled: false, isDropDown: true, controller: typeController, + hasBorder: true, + validationError: isFormSubmitted && + widget.mySelectedAssessment + .selectedDiagnosisType == null?TranslationBase + .of(context) + .emptyMessage:null, ), - if (isFormSubmitted && - widget.mySelectedAssessment - .selectedDiagnosisType == - null) - CustomValidationError(), SizedBox( height: 10, ), Container( margin: EdgeInsets.only(left: 0, right: 0, top: 15), - child: TextFields( + child: AppTextFieldCustom( hintText: TranslationBase.of(context).remarks, - fontSize: 13.5, - fontWeight: FontWeight.w600, maxLines: 18, minLines: 5, - hasLabelText: - remarkController.text != '' ? true : false, - showLabelText: true, controller: remarkController, onChanged: (value) { widget.mySelectedAssessment.remark = remarkController.text; }, - validator: (value) { - if (value == null) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }), + ), ), SizedBox( height: 10, diff --git a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart index abb62808..dfdb21f9 100644 --- a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart @@ -131,9 +131,14 @@ class _UpdateObjectivePageState extends State { }).toList(), ) ], + ), isExpanded: isSysExaminationExpand, ), + SizedBox(height: MediaQuery + .of(context) + .size + .height * 0.12,) ], ), ), diff --git a/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart b/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart index cdc6cad5..821e8334 100644 --- a/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart +++ b/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart @@ -1,4 +1,5 @@ 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/new_text_Field.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -35,33 +36,28 @@ class UpdateChiefComplaints extends StatelessWidget { height: 20, ), //TODO handel error cases - NewTextFields( + AppTextFieldCustom( hintText: TranslationBase.of(context).addChiefComplaints, controller: complaintsController, maxLines: 25, - minLines: 3, - ), + minLines: 7, + hasBorder: true, + validationError:complaintsController.text.isEmpty && complaintsControllerError !=''?complaintsControllerError:null , - Container( - child: CustomValidationError( - error: complaintsControllerError, - )), + ), SizedBox( height: 20, ), - NewTextFields( + AppTextFieldCustom( hintText: TranslationBase .of(context) .historyOfPresentIllness, controller: illnessController, maxLines: 25, - minLines: 3, - ), - Container( - child: CustomValidationError(error: illnessControllerError,)), - SizedBox( - height: 20, + minLines: 7, + hasBorder: true, + validationError:illnessController.text.isEmpty && illnessControllerError !=''?illnessControllerError:null , ), SizedBox( height: 10, @@ -72,16 +68,17 @@ class UpdateChiefComplaints extends StatelessWidget { SizedBox( height: 10, ), - NewTextFields( + AppTextFieldCustom( hintText: TranslationBase .of(context) .currentMedications, controller: medicationController, - maxLines: 25, - minLines: 3, + maxLines: 25, + minLines: 7, + hasBorder: true, + validationError:medicationController.text.isEmpty && medicationControllerError !=''?medicationControllerError:null , + ), - Container(child: CustomValidationError( - error: medicationControllerError,)), SizedBox( height: 10, ), diff --git a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart index 3b96cd65..6773ae98 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart @@ -204,7 +204,7 @@ class _AddMedicationState extends State { ), if (isFormSubmitted && _selectedMedication == null) - CustomValidationError(), + Container(child: CustomValidationError()), SizedBox( height: 5, ), @@ -231,6 +231,7 @@ class _AddMedicationState extends State { .nameEn; }); }, + ); showDialog( barrierDismissible: false, @@ -247,16 +248,14 @@ class _AddMedicationState extends State { minLines: 2, isDropDown: true, controller: doseController, + validationError:isFormSubmitted && + _selectedMedicationDose == null?TranslationBase + .of(context) + .emptyMessage:null, ), SizedBox( height: 5, ), - if (isFormSubmitted && - _selectedMedicationDose == null) - CustomValidationError(), - SizedBox( - height: 5, - ), AppTextFieldCustom( enabled: false, isDropDown: true, @@ -296,13 +295,14 @@ class _AddMedicationState extends State { maxLines: 2, minLines: 2, controller: strengthController, + validationError:isFormSubmitted && + _selectedMedicationStrength == null?TranslationBase + .of(context) + .emptyMessage:null, ), SizedBox( height: 5, ), - if (isFormSubmitted && - _selectedMedicationStrength == null) - CustomValidationError(), SizedBox( height: 5, ), @@ -344,13 +344,14 @@ class _AddMedicationState extends State { maxLines: 2, minLines: 2, controller: routeController, + validationError:isFormSubmitted && + _selectedMedicationRoute == null?TranslationBase + .of(context) + .emptyMessage:null, ), SizedBox( height: 5, ), - if (isFormSubmitted && - _selectedMedicationRoute == null) - CustomValidationError(), SizedBox( height: 5, ), @@ -393,13 +394,14 @@ class _AddMedicationState extends State { minLines: 2, isDropDown: true, controller: frequencyController, + validationError:isFormSubmitted && + _selectedMedicationFrequency == null?TranslationBase + .of(context) + .emptyMessage:null, ), SizedBox( height: 5, ), - if (isFormSubmitted && - _selectedMedicationFrequency == null) - CustomValidationError(), SizedBox( height: 30, ), From e73ca8af71bd8d1407fe6d7315d650d8556f8250 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 19 Apr 2021 17:22:16 +0300 Subject: [PATCH 003/156] first step from change text fields --- .../medicine/medicine_search_screen.dart | 2 +- .../patients/patient_search_screen.dart | 2 +- .../profile/UCAF/UCAF-input-screen.dart | 2 +- .../admission-request-first-screen.dart | 2 +- .../admission-request-third-screen.dart | 2 +- .../admission-request_second-screen.dart | 2 +- .../profile/refer_patient_screen.dart | 2 +- .../referral/refer-patient-screen.dart | 2 +- .../assessment/add_assessment_details.dart | 124 ++++++++++-------- .../objective/add_examination_widget.dart | 2 +- .../examinations_list_search_widget.dart | 2 +- .../soap_update/plan/update_plan_page.dart | 2 +- .../update_Chief_complaints.dart | 4 +- .../subjective/medication/add_medication.dart | 2 +- .../prescription/add_prescription_form.dart | 2 +- .../prescription/prescription_warnings.dart | 2 +- .../reschedule-leaves/reschedule_leave.dart | 2 +- lib/screens/sick-leave/sick_leave.dart | 2 +- lib/widgets/auth/login_form.dart | 2 +- lib/widgets/patients/dynamic_elements.dart | 2 +- ..._key_checkbox_search_allergies_widget.dart | 4 +- .../master_key_checkbox_search_widget.dart | 2 +- .../text_fields}/app-textfield-custom.dart | 37 +----- .../text_fields}/app_text_form_field.dart | 0 .../text_fields/auto_complete_text_field.dart | 0 .../text_fields}/new_text_Field.dart | 0 .../text_fields/text_field_error.dart | 41 ++++++ 27 files changed, 137 insertions(+), 111 deletions(-) rename lib/widgets/shared/{ => user-guid/text_fields}/app-textfield-custom.dart (87%) rename lib/widgets/shared/{ => user-guid/text_fields}/app_text_form_field.dart (100%) create mode 100644 lib/widgets/shared/user-guid/text_fields/auto_complete_text_field.dart rename lib/widgets/shared/{ => user-guid/text_fields}/new_text_Field.dart (100%) create mode 100644 lib/widgets/shared/user-guid/text_fields/text_field_error.dart diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index 9dea3448..c1705deb 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -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/shared/app_buttons_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/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 51750e38..53a0e1c5 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -17,7 +17,7 @@ import '../../lookups/patient_lookup.dart'; import '../../widgets/patients/dynamic_elements.dart'; import '../../widgets/shared/app_buttons_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/rounded_container_widget.dart'; diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index fa94d3fa..ecdd29a7 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -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/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/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_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; diff --git a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart index 876066ce..b395a623 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart @@ -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-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/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_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; diff --git a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart index bf896145..d0dfff21 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart @@ -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-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/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_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; diff --git a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart index a4aebc9f..99dad8fe 100644 --- a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart @@ -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-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/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_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; diff --git a/lib/screens/patients/profile/refer_patient_screen.dart b/lib/screens/patients/profile/refer_patient_screen.dart index ffa1608a..3e4340f5 100644 --- a/lib/screens/patients/profile/refer_patient_screen.dart +++ b/lib/screens/patients/profile/refer_patient_screen.dart @@ -5,7 +5,7 @@ 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/translations_delegate_base.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/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index c27a5c46..391d40ca 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -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-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/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_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; diff --git a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart index a0ac3678..9b1a1db6 100644 --- a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart +++ b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart @@ -15,11 +15,11 @@ 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/util/translations_delegate_base.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_scaffold_widget.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/text_field_error.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; @@ -75,22 +75,29 @@ class _AddAssessmentDetailsState extends State { icdNameController.text = widget.mySelectedAssessment.selectedICD.code; } InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {IconData icon}) { - return InputDecoration( + String hintText, String selectedText, bool isDropDown , + + {IconData icon, String validationError}) { + return new InputDecoration( fillColor: Colors.white, contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10), 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), ), 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), ), 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), ), hintText: selectedText != null ? selectedText : hintText, @@ -164,47 +171,64 @@ class _AddAssessmentDetailsState extends State { child: widget .mySelectedAssessment.selectedICD == null - ? AutoCompleteTextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .nameOrICD, - widget.mySelectedAssessment - .selectedICD != - null - ? widget.mySelectedAssessment - .selectedICD.nameEn - : null, - true, - icon: Icons.keyboard_arrow_down), - itemSubmitted: (item) => setState(() { - widget.mySelectedAssessment - .selectedICD = item; - icdNameController.text = '${item.code.trim()}/${item.description}'; - }), - key: key, - suggestions: model.listOfICD10, - itemBuilder: (context, suggestion) => - new Padding( - child: Texts(suggestion - .description + - " / " + - suggestion.code.toString()), - padding: EdgeInsets.all(8.0)), - itemSorter: (a, b) => 1, - itemFilter: (suggestion, input) => - suggestion.description - .toLowerCase() - .startsWith( - input.toLowerCase()) || + ? Container( + child: Column( + children: [ + AutoCompleteTextField( + + decoration: textFieldSelectorDecoration( + TranslationBase.of(context) + .nameOrICD, + widget.mySelectedAssessment + .selectedICD != + null + ? widget.mySelectedAssessment + .selectedICD.nameEn + : null, + true, + icon: Icons.search, + validationError: isFormSubmitted && + widget.mySelectedAssessment.selectedICD == null?TranslationBase + .of(context) + .emptyMessage:null + ), + + itemSubmitted: (item) => setState(() { + widget.mySelectedAssessment + .selectedICD = item; + icdNameController.text = '${item.code.trim()}/${item.description}'; + }), + key: key, + suggestions: model.listOfICD10, + itemBuilder: (context, suggestion) => + new Padding( + child: Texts(suggestion + .description + + " / " + + suggestion.code.toString()), + padding: EdgeInsets.all(8.0)), + itemSorter: (a, b) => 1, + itemFilter: (suggestion, input) => suggestion.description .toLowerCase() .startsWith( input.toLowerCase()) || - suggestion.code - .toLowerCase() - .startsWith( - input.toLowerCase()), - ) + suggestion.description + .toLowerCase() + .startsWith( + input.toLowerCase()) || + suggestion.code + .toLowerCase() + .startsWith( + input.toLowerCase()), + ), + if (isFormSubmitted && + widget.mySelectedAssessment.selectedICD == null) + TextFieldsError(error:TranslationBase + .of(context) + .emptyMessage ,) + ], + ),) : AppTextFieldCustom( onClick: model.listOfICD10 != null ? () { @@ -220,20 +244,10 @@ class _AddAssessmentDetailsState extends State { maxLines: 2, minLines: 1, controller: icdNameController, - // hasBorder: true, - // validationError: isFormSubmitted && - // widget.mySelectedAssessment - // .selectedICD == null?TranslationBase - // .of(context) - // .emptyMessage:null, - enabled: true, ) ), ), - if (isFormSubmitted && - widget.mySelectedAssessment.selectedICD == null) - CustomValidationError(), SizedBox( height: 7, ), diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart index 82cef2e9..ea933cee 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_widget.dart @@ -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/my_selected_examination.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/expandable-widget-header-body.dart'; import 'package:flutter/material.dart'; diff --git a/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart b/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart index 941b60ca..7d20d4ff 100644 --- a/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart +++ b/lib/screens/patients/profile/soap_update/objective/examinations_list_search_widget.dart @@ -1,7 +1,7 @@ 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/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:flutter/material.dart'; diff --git a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart index 6f57ceb8..ea30e9cb 100644 --- a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart +++ b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart @@ -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/translations_delegate_base.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_scaffold_widget.dart'; import 'package:flutter/material.dart'; diff --git a/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart b/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart index 821e8334..e0e64288 100644 --- a/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart +++ b/lib/screens/patients/profile/soap_update/subjective/cheif_complaints/update_Chief_complaints.dart @@ -1,6 +1,6 @@ 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/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/material.dart'; diff --git a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart index 6773ae98..062e8b84 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart @@ -8,7 +8,7 @@ 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/util/translations_delegate_base.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_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart'; diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 67c483a8..2c8c5f54 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -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/TextFields.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/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; diff --git a/lib/screens/prescription/prescription_warnings.dart b/lib/screens/prescription/prescription_warnings.dart index 44bcab0c..f5773af8 100644 --- a/lib/screens/prescription/prescription_warnings.dart +++ b/lib/screens/prescription/prescription_warnings.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/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_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:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index e2959c75..9afd4e17 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -16,7 +16,7 @@ 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/app_buttons_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/rounded_container_widget.dart'; import 'package:flutter/cupertino.dart'; diff --git a/lib/screens/sick-leave/sick_leave.dart b/lib/screens/sick-leave/sick_leave.dart index 0e1a8491..bee27a39 100644 --- a/lib/screens/sick-leave/sick_leave.dart +++ b/lib/screens/sick-leave/sick_leave.dart @@ -16,7 +16,7 @@ import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header- 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_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/rounded_container_widget.dart'; import 'package:flutter/cupertino.dart'; diff --git a/lib/widgets/auth/login_form.dart b/lib/widgets/auth/login_form.dart index 9fc50008..9209df17 100644 --- a/lib/widgets/auth/login_form.dart +++ b/lib/widgets/auth/login_form.dart @@ -2,7 +2,7 @@ import 'package:doctor_app_flutter/lookups/hospital_lookup.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_loader_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:flutter/cupertino.dart'; import 'package:flutter/material.dart'; diff --git a/lib/widgets/patients/dynamic_elements.dart b/lib/widgets/patients/dynamic_elements.dart index 1760c796..1d85574d 100644 --- a/lib/widgets/patients/dynamic_elements.dart +++ b/lib/widgets/patients/dynamic_elements.dart @@ -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/widgets/shared/user-guid/custom_validation_error.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:hexcolor/hexcolor.dart'; import 'package:intl/intl.dart'; diff --git a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart index 3e4d1186..c9282245 100644 --- a/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_allergies_widget.dart @@ -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/widgets/shared/TextFields.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:flutter/cupertino.dart'; import 'package:flutter/material.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 'dialogs/master_key_dailog.dart'; import 'divider_with_spaces_around.dart'; diff --git a/lib/widgets/shared/master_key_checkbox_search_widget.dart b/lib/widgets/shared/master_key_checkbox_search_widget.dart index f0ef63bd..6e436625 100644 --- a/lib/widgets/shared/master_key_checkbox_search_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_widget.dart @@ -11,7 +11,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.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'; class MasterKeyCheckboxSearchWidget extends StatefulWidget { diff --git a/lib/widgets/shared/app-textfield-custom.dart b/lib/widgets/shared/user-guid/text_fields/app-textfield-custom.dart similarity index 87% rename from lib/widgets/shared/app-textfield-custom.dart rename to lib/widgets/shared/user-guid/text_fields/app-textfield-custom.dart index 9f671c66..a62b233f 100644 --- a/lib/widgets/shared/app-textfield-custom.dart +++ b/lib/widgets/shared/user-guid/text_fields/app-textfield-custom.dart @@ -1,8 +1,9 @@ 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/widgets/shared/user-guid/text_fields/text_field_error.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; -import 'app_texts_widget.dart'; +import '../../app_texts_widget.dart'; class AppTextFieldCustom extends StatefulWidget { final double height; @@ -134,28 +135,7 @@ class _AppTextFieldCustomState extends State { ), ), if (widget.validationError != null) - 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( - widget.validationError, - fontFamily: 'Poppins', - fontSize: SizeConfig.textMultiplier * 1.7, - color: Colors.red.shade700, - fontWeight: FontWeight.w700, - ), - ], - ), - ), + TextFieldsError(error: widget.validationError), ], ); } @@ -209,16 +189,7 @@ class _AppTextFieldCustomState extends State { 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: ); } } + diff --git a/lib/widgets/shared/app_text_form_field.dart b/lib/widgets/shared/user-guid/text_fields/app_text_form_field.dart similarity index 100% rename from lib/widgets/shared/app_text_form_field.dart rename to lib/widgets/shared/user-guid/text_fields/app_text_form_field.dart diff --git a/lib/widgets/shared/user-guid/text_fields/auto_complete_text_field.dart b/lib/widgets/shared/user-guid/text_fields/auto_complete_text_field.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/widgets/shared/new_text_Field.dart b/lib/widgets/shared/user-guid/text_fields/new_text_Field.dart similarity index 100% rename from lib/widgets/shared/new_text_Field.dart rename to lib/widgets/shared/user-guid/text_fields/new_text_Field.dart diff --git a/lib/widgets/shared/user-guid/text_fields/text_field_error.dart b/lib/widgets/shared/user-guid/text_fields/text_field_error.dart new file mode 100644 index 00000000..6108f997 --- /dev/null +++ b/lib/widgets/shared/user-guid/text_fields/text_field_error.dart @@ -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, + ), + ], + ), + ); + } +} From 65585ab586017e46206000837f7a70c1658b30c3 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 19 Apr 2021 18:47:40 +0300 Subject: [PATCH 004/156] add charts to procedures --- lib/core/service/labs_service.dart | 28 +++++----- .../profile/lab_result/FlowChartPage.dart | 52 ++++++++++--------- lib/screens/procedures/ProcedureCard.dart | 29 ++++++++++- lib/screens/procedures/procedure_screen.dart | 1 + 4 files changed, 72 insertions(+), 38 deletions(-) diff --git a/lib/core/service/labs_service.dart b/lib/core/service/labs_service.dart index 1a641d1f..ecfc96a1 100644 --- a/lib/core/service/labs_service.dart +++ b/lib/core/service/labs_service.dart @@ -48,8 +48,7 @@ class LabsService extends BaseService { _requestPatientLabSpecialResult.orderNo = orderNo; await baseAppClient.postPatient(GET_Patient_LAB_SPECIAL_RESULT, - patient: patient, - onSuccess: (dynamic response, int statusCode) { + patient: patient, onSuccess: (dynamic response, int statusCode) { patientLabSpecialResult.clear(); response['ListPLSR'].forEach((hospital) { patientLabSpecialResult.add(PatientLabSpecialResult.fromJson(hospital)); @@ -60,7 +59,8 @@ class LabsService extends BaseService { }, body: _requestPatientLabSpecialResult.toJson()); } - Future getPatientLabResult({PatientLabOrders patientLabOrder,PatiantInformtion patient}) async { + Future getPatientLabResult( + {PatientLabOrders patientLabOrder, PatiantInformtion patient}) async { hasError = false; Map body = Map(); body['InvoiceNo'] = patientLabOrder.invoiceNo; @@ -69,8 +69,7 @@ class LabsService extends BaseService { body['SetupID'] = patientLabOrder.setupID; body['ProjectID'] = patientLabOrder.projectID; body['ClinicID'] = patientLabOrder.clinicID; - await baseAppClient.postPatient(GET_Patient_LAB_RESULT, - patient: patient, + await baseAppClient.postPatient(GET_Patient_LAB_RESULT, patient: patient, onSuccess: (dynamic response, int statusCode) { patientLabSpecialResult.clear(); labResultList.clear(); @@ -84,19 +83,22 @@ class LabsService extends BaseService { } Future getPatientLabOrdersResults( - {PatientLabOrders patientLabOrder, String procedure,PatiantInformtion patient}) async { + {PatientLabOrders patientLabOrder, + String procedure, + PatiantInformtion patient}) async { hasError = false; Map body = Map(); - body['InvoiceNo'] = patientLabOrder.invoiceNo; - body['OrderNo'] = patientLabOrder.orderNo; + if (patientLabOrder != null) { + body['InvoiceNo'] = patientLabOrder.invoiceNo; + body['OrderNo'] = patientLabOrder.orderNo; + body['SetupID'] = patientLabOrder.setupID; + body['ProjectID'] = patientLabOrder.projectID; + body['ClinicID'] = patientLabOrder.clinicID; + } body['isDentalAllowedBackend'] = false; - body['SetupID'] = patientLabOrder.setupID; - body['ProjectID'] = patientLabOrder.projectID; - body['ClinicID'] = patientLabOrder.clinicID; body['Procedure'] = procedure; await baseAppClient.postPatient(GET_Patient_LAB_ORDERS_RESULT, - patient: patient, - onSuccess: (dynamic response, int statusCode) { + patient: patient, onSuccess: (dynamic response, int statusCode) { labOrdersResultsList.clear(); response['ListPLR'].forEach((lab) { labOrdersResultsList.add(LabOrderResult.fromJson(lab)); diff --git a/lib/screens/patients/profile/lab_result/FlowChartPage.dart b/lib/screens/patients/profile/lab_result/FlowChartPage.dart index 4bf0b0c3..6f1e0888 100644 --- a/lib/screens/patients/profile/lab_result/FlowChartPage.dart +++ b/lib/screens/patients/profile/lab_result/FlowChartPage.dart @@ -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:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'lab_result_chart_and_detials.dart'; @@ -17,46 +18,49 @@ class FlowChartPage extends StatelessWidget { final PatientLabOrders patientLabOrder; final String filterName; final PatiantInformtion patient; + FlowChartPage({this.patientLabOrder, this.filterName, this.patient}); @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.getPatientLabOrdersResults( - patientLabOrder: patientLabOrder, procedure: filterName,patient: patient), + patientLabOrder: patientLabOrder, + procedure: filterName, + patient: patient), builder: (context, model, w) => AppScaffold( isShowAppBar: true, appBarTitle: filterName, baseViewModel: model, - body: SingleChildScrollView( - child: model.labOrdersResultsList.isNotEmpty - ? Container( + body: model.labOrdersResultsList.isNotEmpty + ? SingleChildScrollView( + child: Container( child: LabResultChartAndDetails( name: filterName, labResult: model.labOrdersResultsList, ), - ) - : Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, ), - 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, - ), - ) - ], + ) + : Container( + child: Center( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisSize: MainAxisSize.min, + children: [ + 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, + ), + ) + ], + ), + ), ), - ), - ), ), ); } diff --git a/lib/screens/procedures/ProcedureCard.dart b/lib/screens/procedures/ProcedureCard.dart index 2f3718a3..761db652 100644 --- a/lib/screens/procedures/ProcedureCard.dart +++ b/lib/screens/procedures/ProcedureCard.dart @@ -1,9 +1,12 @@ 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/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/translations_delegate_base.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/material.dart'; import 'package:provider/provider.dart'; @@ -13,13 +16,16 @@ class ProcedureCard extends StatelessWidget { final EntityList entityList; final String categoryName; final int categoryID; + final PatiantInformtion patient; const ProcedureCard( {Key key, this.onTap, this.entityList, this.categoryID, - this.categoryName}) + this.categoryName, + this.patient, + }) : super(key: key); @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( // mainAxisAlignment: MainAxisAlignment.spaceBetween, // children: [ diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 1e6d55a8..0ccbc1e6 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -173,6 +173,7 @@ class ProcedureScreen extends StatelessWidget { // helpers.showErrorToast( // 'You Cant Update This Procedure'); }, + patient: patient, ), ), if (model.procedureList.length != 0 && From 0e459de1a3f061f8e18432789aa7f3d9319a7718 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 19 Apr 2021 21:29:18 +0300 Subject: [PATCH 005/156] fix pharmacies list --- .../medicine/pharmacies_list_screen.dart | 162 ++++++++---------- 1 file changed, 76 insertions(+), 86 deletions(-) diff --git a/lib/screens/medicine/pharmacies_list_screen.dart b/lib/screens/medicine/pharmacies_list_screen.dart index 6af1d5b7..49c39c53 100644 --- a/lib/screens/medicine/pharmacies_list_screen.dart +++ b/lib/screens/medicine/pharmacies_list_screen.dart @@ -23,7 +23,6 @@ class PharmaciesListScreen extends StatefulWidget { final String url; - // In the constructor, require a item id. PharmaciesListScreen({Key key, @required this.itemID, this.url}) : super(key: key); @@ -32,18 +31,9 @@ class PharmaciesListScreen extends StatefulWidget { } class _PharmaciesListState extends State { - var _data; Helpers helpers = new Helpers(); ProjectViewModel projectsProvider; - bool _isInit = true; - //bool _isOutOfStuck = false; - - @override - void didChangeDependencies() { - super.didChangeDependencies(); - _isInit = false; - } @override Widget build(BuildContext context) { @@ -145,90 +135,90 @@ class _PharmaciesListState extends State { ? Alignment.topRight : Alignment.topLeft, ), - Expanded( - child: Container( - width: SizeConfig.screenWidth * 0.99, - child: ListView.builder( - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - itemCount: model.pharmaciesList == null ? 0 : model - .pharmaciesList.length, - itemBuilder: (BuildContext context, int index) { - return RoundedContainer( - child: Row( - children: [ - Expanded( - flex: 1, - child: ClipRRect( - borderRadius: - BorderRadius.all(Radius.circular(7)), - child: Image.network( - model - .pharmaciesList[index]["ProjectImageURL"], - height: - SizeConfig.imageSizeMultiplier * 15, - width: - SizeConfig.imageSizeMultiplier * 15, - fit: BoxFit.cover, - ), - ), - ), - Expanded( - flex: 4, - child: AppText( + Container( + width: SizeConfig.screenWidth * 0.99, + margin: EdgeInsets.only(left: 10,right: 10), + child: ListView.builder( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemCount: model.pharmaciesList == null ? 0 : model + .pharmaciesList.length, + itemBuilder: (BuildContext context, int index) { + return RoundedContainer( + margin: EdgeInsets.only(top: 5), + child: Row( + children: [ + Expanded( + flex: 1, + child: ClipRRect( + borderRadius: + BorderRadius.all(Radius.circular(7)), + child: Image.network( model - .pharmaciesList[index]["LocationDescription"], - margin: 10, + .pharmaciesList[index]["ProjectImageURL"], + height: + SizeConfig.imageSizeMultiplier * 15, + width: + SizeConfig.imageSizeMultiplier * 15, + fit: BoxFit.cover, ), ), - Expanded( - flex: 2, - child: Wrap( - direction: Axis.horizontal, - alignment: WrapAlignment.end, - crossAxisAlignment: WrapCrossAlignment.end, - children: [ - Padding( - padding: EdgeInsets.all(5), - child: InkWell( - child: Icon( - Icons.call, - color: Colors.red, - ), - onTap: () => - launch("tel://" + - model - .pharmaciesList[index]["PhoneNumber"]), + ), + Expanded( + flex: 4, + child: AppText( + model + .pharmaciesList[index]["LocationDescription"], + margin: 10, + ), + ), + Expanded( + flex: 2, + child: Wrap( + direction: Axis.horizontal, + alignment: WrapAlignment.end, + crossAxisAlignment: WrapCrossAlignment.end, + children: [ + Padding( + 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), - child: InkWell( - child: Icon( - 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"]); - }, + ), + Padding( + padding: EdgeInsets.all(5), + child: InkWell( + child: Icon( + 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"]); + }, ), - ], - ), + ), + ], ), - ], - ), - ); - }), - ), + ), + ], + ), + ); + }), ) ]), ),),); From b8f6c35e75602784e46911515811b386310e35ae Mon Sep 17 00:00:00 2001 From: mosazaid Date: Tue, 20 Apr 2021 13:28:16 +0300 Subject: [PATCH 006/156] working on buttons widgets --- lib/UpdatePage.dart | 2 +- lib/screens/QR_reader_screen.dart | 9 +- .../medicine/medicine_search_screen.dart | 2 +- .../patients/patient_search_screen.dart | 2 +- lib/screens/patients/patients_screen.dart | 3 - .../profile/UCAF/UCAF-detail-screen.dart | 43 +-- .../profile/UCAF/UCAF-input-screen.dart | 2 +- .../admission-request-detail-screen.dart | 2 +- .../admission-request-first-screen.dart | 2 +- .../admission-request-third-screen.dart | 2 +- .../admission-request_second-screen.dart | 2 +- .../profile/lab_result/LineChartCurved.dart | 9 +- .../profile/patient_profile_screen.dart | 51 ++-- .../radiology/radiology_details_page.dart | 7 +- .../radiology/radiology_report_screen.dart | 2 +- .../profile/refer_patient_screen.dart | 2 +- .../referral/my-referral-detail-screen.dart | 247 ++++++++++-------- .../referral/refer-patient-screen.dart | 2 +- .../assessment/add_assessment_details.dart | 2 +- .../assessment/update_assessment_page.dart | 2 +- .../objective/add_examination_page.dart | 14 +- .../objective/update_objective_page.dart | 2 +- .../soap_update/plan/update_plan_page.dart | 2 +- .../subjective/allergies/add_allergies.dart | 2 +- .../history/add_history_dialog.dart | 2 +- .../subjective/medication/add_medication.dart | 2 +- .../subjective/update_subjective_page.dart | 2 +- .../prescription/add_prescription_form.dart | 2 +- .../prescription/prescription_warnings.dart | 2 +- .../update_prescription_form.dart | 2 +- .../procedures/add-procedure-form.dart | 2 +- lib/screens/procedures/add_lab_orders.dart | 2 +- .../procedures/add_radiology_order.dart | 2 +- .../entity_list_checkbox_search_widget.dart | 2 +- .../entity_list_procedure_widget.dart | 2 +- lib/screens/procedures/update-procedure.dart | 2 +- .../reschedule-leaves/reschedule_leave.dart | 2 +- lib/screens/sick-leave/sick_leave.dart | 2 +- lib/widgets/auth/login_form.dart | 22 +- lib/widgets/auth/verification_methods.dart | 15 +- .../doctor/my_referral_patient_widget.dart | 17 +- lib/widgets/shared/app_button.dart | 150 ----------- lib/widgets/shared/app_buttons_widget.dart | 92 ------- lib/widgets/shared/borderedButton.dart | 87 ------ .../shared/buttons/app_buttons_widget.dart | 117 +++++++++ .../shared/buttons/button_bottom_sheet.dart | 16 ++ .../{ => buttons}/secondary_button.dart | 2 +- ..._key_checkbox_search_allergies_widget.dart | 2 +- .../master_key_checkbox_search_widget.dart | 2 +- 49 files changed, 408 insertions(+), 557 deletions(-) delete mode 100644 lib/widgets/shared/app_button.dart delete mode 100644 lib/widgets/shared/app_buttons_widget.dart delete mode 100644 lib/widgets/shared/borderedButton.dart create mode 100644 lib/widgets/shared/buttons/app_buttons_widget.dart create mode 100644 lib/widgets/shared/buttons/button_bottom_sheet.dart rename lib/widgets/shared/{ => buttons}/secondary_button.dart (99%) diff --git a/lib/UpdatePage.dart b/lib/UpdatePage.dart index dc94b6e6..e3a689a0 100644 --- a/lib/UpdatePage.dart +++ b/lib/UpdatePage.dart @@ -1,7 +1,7 @@ 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/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/secondary_button.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/widgets/shared/buttons/secondary_button.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:url_launcher/url_launcher.dart'; diff --git a/lib/screens/QR_reader_screen.dart b/lib/screens/QR_reader_screen.dart index 2ddb4049..36b10200 100644 --- a/lib/screens/QR_reader_screen.dart +++ b/lib/screens/QR_reader_screen.dart @@ -9,9 +9,10 @@ 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/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; + import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -93,11 +94,11 @@ class _QrReaderScreenState extends State { SizedBox( height: 35, ), - Button( - onTap: () { + AppButton( + title : TranslationBase.of(context).scanQr, + onPressed: () { _scanQrAndGetPatient(context, model); }, - title: TranslationBase.of(context).scanQr, loading: isLoading, icon: Image.asset('assets/images/qr_code_white.png'), ), diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index 9dea3448..c092ea10 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -12,7 +12,7 @@ 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/widgets/medicine/medicine_item_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_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/app_texts_widget.dart'; diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 51750e38..6ec6a272 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -15,7 +15,7 @@ import '../../config/config.dart'; import '../../config/size_config.dart'; import '../../lookups/patient_lookup.dart'; import '../../widgets/patients/dynamic_elements.dart'; -import '../../widgets/shared/app_buttons_widget.dart'; +import '../../widgets/shared/buttons/app_buttons_widget.dart'; import '../../widgets/shared/app_scaffold_widget.dart'; import '../../widgets/shared/app_text_form_field.dart'; import '../../widgets/shared/app_texts_widget.dart'; diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 0209991b..4440a6b6 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -17,9 +17,6 @@ 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/clinic_list_dropdwon.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/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; diff --git a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart index ec7a7355..d714603c 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -16,7 +16,8 @@ import 'package:doctor_app_flutter/widgets/patients/profile/PatientHeaderWidgetN import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.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/borderedButton.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; + import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -47,9 +48,9 @@ class _UcafDetailScreenState extends State { }, builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: true, - appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType, arrivalType), + isShowAppBar: true, + appBar: PatientProfileHeaderNewDesignAppBar( + patient, patientType, arrivalType), appBarTitle: TranslationBase.of(context).ucaf, body: Column( children: [ @@ -114,18 +115,19 @@ class _UcafDetailScreenState extends State { children: [ Expanded( child: Container( - child: BorderedButton( - TranslationBase.of(context).cancel, + child: AppButton( + title: TranslationBase.of(context).cancel, hasBorder: true, vPadding: 8, hPadding: 8, borderColor: Colors.white, - backgroundColor: Colors.white, - textColor: HexColor("#B8382B"), - fontSize: SizeConfig.textMultiplier * 2.2, - handler: () { + color: Colors.white, + fontColor: HexColor("#B8382B"), + fontSize: 2.2, + onPressed: () { Navigator.of(context).popUntil((route) { - return route.settings.name == PATIENTS_PROFILE; + return route.settings.name == + PATIENTS_PROFILE; }); }, ), @@ -136,22 +138,24 @@ class _UcafDetailScreenState extends State { ), Expanded( child: Container( - child: BorderedButton( - TranslationBase.of(context).save, + child: AppButton( + title: TranslationBase.of(context).save, hasBorder: true, vPadding: 8, hPadding: 8, borderColor: HexColor("#B8382B"), - backgroundColor: HexColor("#B8382B"), - textColor: Colors.white, - fontSize: SizeConfig.textMultiplier * 2.0, - handler: () async { + color: HexColor("#B8382B"), + fontColor: Colors.white, + fontSize: 2.0, + onPressed: () async { await model.postUCAF(patient); if (model.state == ViewState.Idle) { DrAppToastMsg.showSuccesToast( - TranslationBase.of(context).postUcafSuccessMsg); + TranslationBase.of(context) + .postUcafSuccessMsg); Navigator.of(context).popUntil((route) { - return route.settings.name == PATIENTS_PROFILE; + return route.settings.name == + PATIENTS_PROFILE; }); } else { DrAppToastMsg.showErrorToast(model.error); @@ -163,7 +167,6 @@ class _UcafDetailScreenState extends State { ], ), ), - ], ), )); diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index fa94d3fa..131c24d8 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -10,7 +10,7 @@ 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/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/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_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:flutter/material.dart'; diff --git a/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart index 23e33db3..51ce2873 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart @@ -7,7 +7,7 @@ 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/widgets/patients/profile/patient-page-header-widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_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/dialogs/dailog-list-select.dart'; diff --git a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart index 876066ce..4c4617c2 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart @@ -12,7 +12,7 @@ import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header- 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/shared/app-textfield-custom.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_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/dialogs/dailog-list-select.dart'; diff --git a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart index bf896145..04c83fca 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart @@ -14,7 +14,7 @@ import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header- 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/shared/app-textfield-custom.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_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/dialogs/dailog-list-select.dart'; diff --git a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart index a4aebc9f..96aaaac6 100644 --- a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart @@ -15,7 +15,7 @@ import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header- 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/shared/app-textfield-custom.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_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/dialogs/dailog-list-select.dart'; diff --git a/lib/screens/patients/profile/lab_result/LineChartCurved.dart b/lib/screens/patients/profile/lab_result/LineChartCurved.dart index fe4677ae..9d7b4db8 100644 --- a/lib/screens/patients/profile/lab_result/LineChartCurved.dart +++ b/lib/screens/patients/profile/lab_result/LineChartCurved.dart @@ -65,7 +65,7 @@ class LineChartCurvedState extends State { ), Expanded( child: Padding( - padding: const EdgeInsets.only(right: 16.0, left: 6.0), + padding: const EdgeInsets.only(right: 16.0, left: 8.0), child: LineChart( sampleData1(), swapAnimationDuration: const Duration(milliseconds: 250), @@ -99,9 +99,9 @@ class LineChartCurvedState extends State { showTitles: true, getTextStyles: (value) => const TextStyle( color: Colors.black, - fontSize: 12, + fontSize: 11, ), - margin: 22, + margin: 28, rotateAngle:-65, getTitles: (value) { print(value); @@ -213,8 +213,9 @@ class LineChartCurvedState extends State { spots: spots, isCurved: true, colors: [Colors.red], - barWidth: 5, + barWidth: 3, isStrokeCapRound: true, + curveSmoothness: 0.12, dotData: FlDotData( show: false, ), diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 63a1247b..da4c6c52 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -10,7 +10,8 @@ import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-head import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget_search.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/borderedButton.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; + import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -103,24 +104,24 @@ class PatientProfileScreen extends StatelessWidget { children: [ Expanded(child: Container()), if (patient.episodeNo == 0) - BorderedButton( - "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", - backgroundColor: patient.patientStatusType == 43 + AppButton( + title: + "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", + color: patient.patientStatusType == 43 ? Colors.red.shade700 : Colors.grey.shade700, - textColor: Colors.white, + fontColor: Colors.white, vPadding: 8, radius: 30, hPadding: 20, fontWeight: FontWeight.normal, - fontSize: 12, - fontFamily: 'Poppins', + fontSize: 1.6, icon: Image.asset( "assets/images/create-episod.png", color: Colors.white, height: 30, ), - handler: () async { + onPressed: () async { if (patient.patientStatusType == 43) { PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel( @@ -139,32 +140,30 @@ class PatientProfileScreen extends StatelessWidget { }, ), if (patient.episodeNo != 0) - BorderedButton( - "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", - backgroundColor: - patient.patientStatusType == 43 - ? Colors.red.shade700 - : Colors.grey.shade700, - textColor: Colors.white, + AppButton( + title: + "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", + color: patient.patientStatusType == 43 + ? Colors.red.shade700 + : Colors.grey.shade700, + fontColor: Colors.white, vPadding: 8, radius: 30, hPadding: 20, fontWeight: FontWeight.normal, - fontSize: 12, - fontFamily: 'Poppins', + fontSize: 1.6, icon: Image.asset( "assets/images/modilfy-episode.png", color: Colors.white, height: 30, - ), - handler: () { - if (patient.patientStatusType == 43) { - Navigator.of(context).pushNamed( - UPDATE_EPISODE, - arguments: {'patient': patient}); - } - } - ), + ), + onPressed: () { + if (patient.patientStatusType == 43) { + Navigator.of(context).pushNamed( + UPDATE_EPISODE, + arguments: {'patient': patient}); + } + }), ], ), ), diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index fc98fefb..556832aa 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -1,17 +1,12 @@ -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/radiology_view_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/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.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_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/secondary_button.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/widgets/shared/buttons/secondary_button.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:url_launcher/url_launcher.dart'; diff --git a/lib/screens/patients/profile/radiology/radiology_report_screen.dart b/lib/screens/patients/profile/radiology/radiology_report_screen.dart index 75be23e8..d5b4fd5d 100644 --- a/lib/screens/patients/profile/radiology/radiology_report_screen.dart +++ b/lib/screens/patients/profile/radiology/radiology_report_screen.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.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/buttons/app_buttons_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:flutter/cupertino.dart'; diff --git a/lib/screens/patients/profile/refer_patient_screen.dart b/lib/screens/patients/profile/refer_patient_screen.dart index ffa1608a..b6946a88 100644 --- a/lib/screens/patients/profile/refer_patient_screen.dart +++ b/lib/screens/patients/profile/refer_patient_screen.dart @@ -4,7 +4,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/util/dr_app_toast_msg.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/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index dcba8fba..583f92a2 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -9,11 +9,11 @@ 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/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget_search.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/borderedButton.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; + import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; @@ -113,107 +113,148 @@ class MyReferralDetailScreen extends StatelessWidget { child: Column( children: [ Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ AppText( - pendingReferral.referralStatus != null ? pendingReferral.referralStatus : "", + pendingReferral.referralStatus != null + ? pendingReferral.referralStatus + : "", fontFamily: 'Poppins', - fontSize: 1.9 * SizeConfig.textMultiplier, + fontSize: + 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, - color: pendingReferral.referralStatus != null - ? pendingReferral.referralStatus == 'Pending' - ? Color(0xffc4aa54) - : pendingReferral.referralStatus == 'Accepted' - ? Colors.green[700] - : Colors.red[700] + color: pendingReferral + .referralStatus != + null + ? pendingReferral + .referralStatus == + 'Pending' + ? Color(0xffc4aa54) + : pendingReferral + .referralStatus == + 'Accepted' + ? Colors.green[700] + : Colors.red[700] : Colors.grey[500], ), AppText( - pendingReferral.referredOn.split(" ")[0], + pendingReferral.referredOn + .split(" ")[0], fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 2.0 * SizeConfig.textMultiplier, + fontSize: + 2.0 * SizeConfig.textMultiplier, color: Color(0XFF28353E), ) ], ), Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ Row( - mainAxisAlignment: MainAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).fileNumber, + TranslationBase.of(context) + .fileNumber, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * + SizeConfig.textMultiplier, color: Color(0XFF575757), ), AppText( "${pendingReferral.patientID}", fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * + SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], ), AppText( - pendingReferral.referredOn.split(" ")[1], + pendingReferral.referredOn + .split(" ")[1], fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: + 1.8 * SizeConfig.textMultiplier, color: Color(0XFF575757), ) ], ), Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.center, children: [ Expanded( child: Column( children: [ Row( - mainAxisAlignment: MainAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).referredFrom, + TranslationBase.of(context) + .referredFrom, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * + SizeConfig + .textMultiplier, color: Color(0XFF575757), ), AppText( - pendingReferral.isReferralDoctorSameBranch - ? TranslationBase.of(context).sameBranch - : TranslationBase.of(context) - .otherBranch, + pendingReferral + .isReferralDoctorSameBranch + ? TranslationBase.of( + context) + .sameBranch + : TranslationBase.of( + context) + .otherBranch, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * + SizeConfig + .textMultiplier, color: Color(0XFF2E303A), ), ], ), Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).remarks + " : ", + TranslationBase.of(context) + .remarks + + " : ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * + SizeConfig + .textMultiplier, color: Color(0XFF575757), ), Expanded( child: AppText( - pendingReferral.remarksFromSource, + pendingReferral + .remarksFromSource, fontFamily: 'Poppins', - fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontWeight: + FontWeight.w700, + fontSize: 1.8 * + SizeConfig + .textMultiplier, color: Color(0XFF2E303A), ), ), @@ -225,52 +266,74 @@ class MyReferralDetailScreen extends StatelessWidget { Row( children: [ AppText( - pendingReferral - .patientDetails.nationalityName != null ? pendingReferral - .patientDetails.nationalityName : "", + pendingReferral.patientDetails + .nationalityName != + null + ? pendingReferral + .patientDetails + .nationalityName + : "", fontWeight: FontWeight.bold, color: Color(0xFF2E303A), - fontSize: 1.4 * SizeConfig.textMultiplier, + fontSize: 1.4 * + SizeConfig.textMultiplier, ), - pendingReferral.nationalityFlagUrl != null + pendingReferral + .nationalityFlagUrl != + null ? ClipRRect( - borderRadius: BorderRadius.circular(20.0), - child: Image.network( - pendingReferral.nationalityFlagUrl, - height: 25, - width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { - return Text('No Image'); - }, - )) + borderRadius: + BorderRadius.circular( + 20.0), + child: Image.network( + pendingReferral + .nationalityFlagUrl, + height: 25, + width: 30, + errorBuilder: + (BuildContext context, + Object exception, + StackTrace + stackTrace) { + return Text('No Image'); + }, + )) : SizedBox() ], ) ], ), Row( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only(left: 10, right: 0), - child: Image.asset('assets/images/patient/ic_ref_arrow_up.png', + margin: EdgeInsets.only( + left: 10, right: 0), + child: Image.asset( + 'assets/images/patient/ic_ref_arrow_up.png', height: 50, width: 30, ), ), Container( margin: EdgeInsets.only( - left: 0, top: 25, right: 0, bottom: 0), - padding: EdgeInsets.only(left: 4.0, right: 4.0), + left: 0, + top: 25, + right: 0, + bottom: 0), + padding: EdgeInsets.only( + left: 4.0, right: 4.0), child: Container( width: 40, height: 40, child: CircleAvatar( radius: 25.0, - backgroundImage: NetworkImage(pendingReferral.doctorImageUrl), - backgroundColor: Colors.transparent, + backgroundImage: NetworkImage( + pendingReferral + .doctorImageUrl), + backgroundColor: + Colors.transparent, ), ), ), @@ -278,14 +341,19 @@ class MyReferralDetailScreen extends StatelessWidget { flex: 4, child: Container( margin: EdgeInsets.only( - left: 10, top: 25, right: 10, bottom: 0), + left: 10, + top: 25, + right: 10, + bottom: 0), child: Column( children: [ AppText( - pendingReferral.referredByDoctorInfo, + pendingReferral + .referredByDoctorInfo, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * + SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], @@ -312,39 +380,6 @@ class MyReferralDetailScreen extends StatelessWidget { SizedBox( height: 16, ), - /*Padding( - padding: - const EdgeInsets.symmetric(horizontal: 16.0), - child: AppText( - TranslationBase.of(context).myReferralPatient, - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - ),*/ - /*PatientReferralItemWidget( - referralStatus: pendingReferral.referralStatus, - patientName: pendingReferral.patientName, - patientGender: - pendingReferral.patientDetails.gender, - referredDate: - pendingReferral.referredOn.split(" ")[0], - referredTime: - pendingReferral.referredOn.split(" ")[1], - patientID: "${pendingReferral.patientID}", - isSameBranch: - pendingReferral.isReferralDoctorSameBranch, - isReferral: true, - remark: pendingReferral.remarksFromSource, - nationality: pendingReferral - .patientDetails.nationalityName, - nationalityFlag: - pendingReferral.nationalityFlagUrl, - doctorAvatar: pendingReferral.doctorImageUrl, - referralDoctorName: - pendingReferral.referredByDoctorInfo, - clinicDescription: null, - ),*/ Padding( padding: const EdgeInsets.symmetric(horizontal: 16), @@ -367,14 +402,14 @@ class MyReferralDetailScreen extends StatelessWidget { child: Row( children: [ Expanded( - child: BorderedButton( - TranslationBase.of(context).accept, - backgroundColor: Color(0xFF4BA821), - textColor: Colors.white, + child: AppButton( + title: TranslationBase.of(context).accept, + color: Color(0xFF4BA821), + fontColor: Colors.white, fontSize: 16, hPadding: 8, vPadding: 12, - handler: () async { + onPressed: () async { await model.responseReferral( pendingReferral, true); if (model.state == ViewState.ErrorLocal) { @@ -393,14 +428,14 @@ class MyReferralDetailScreen extends StatelessWidget { height: 8, ), Expanded( - child: BorderedButton( - TranslationBase.of(context).reject, - backgroundColor: Color(0xFFB9382C), - textColor: Colors.white, + child: AppButton( + title: TranslationBase.of(context).reject, + color: Color(0xFFB9382C), + fontColor: Colors.white, fontSize: 16, hPadding: 8, vPadding: 12, - handler: () async { + onPressed: () async { await model.responseReferral( pendingReferral, true); if (model.state == ViewState.ErrorLocal) { diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index c27a5c46..22bdb343 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -13,7 +13,7 @@ import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header- 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/shared/app-textfield-custom.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_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/dialogs/dailog-list-select.dart'; diff --git a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart index a2083bd9..bafe322f 100644 --- a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart +++ b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart @@ -17,7 +17,7 @@ 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/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/buttons/app_buttons_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:flutter/material.dart'; diff --git a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart index 7a42fe79..65042e5c 100644 --- a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart +++ b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart @@ -11,7 +11,7 @@ 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/translations_delegate_base.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/buttons/app_buttons_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:flutter/material.dart'; diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart index b9f1bd63..c2bde367 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart @@ -7,7 +7,8 @@ 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/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/borderedButton.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; + import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -115,16 +116,15 @@ class _AddExaminationPageState extends State { Container( padding: EdgeInsets.all(16), color: Colors.white, - child: BorderedButton( - "${TranslationBase.of(context).addExamination}", - backgroundColor: HexColor("#359846"), - textColor: Colors.white, + child: AppButton( + title:"${TranslationBase.of(context).addExamination}", + color: HexColor("#359846"), + fontColor: Colors.white, vPadding: 12, radius: 12, fontWeight: FontWeight.w600, fontSize: SizeConfig.textMultiplier * 2.5, - fontFamily: 'Poppins', - handler: () { + onPressed: () { widget.addSelectedExamination(); }, ), diff --git a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart index abb62808..42ca6db2 100644 --- a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart @@ -12,7 +12,7 @@ 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/screens/base/base_view.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/buttons/app_buttons_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/transitions/fade_page.dart'; diff --git a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart index 6f57ceb8..b6ec5ac1 100644 --- a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart +++ b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart @@ -14,7 +14,7 @@ import 'package:doctor_app_flutter/util/helpers.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/app-textfield-custom.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart index c1cbcd28..b69c7096 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart @@ -6,7 +6,7 @@ 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/screens/base/base_view.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/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_allergies_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; diff --git a/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart b/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart index 6f610a8e..bdb37985 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart @@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_history.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/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; diff --git a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart index 3b96cd65..51e7b49f 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart @@ -9,7 +9,7 @@ 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/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/buttons/app_buttons_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:eva_icons_flutter/eva_icons_flutter.dart'; diff --git a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart index d78c8c45..9b40a085 100644 --- a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -16,7 +16,7 @@ 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/screens/base/base_view.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/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 67c483a8..bfcb8c8c 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -19,7 +19,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/shared/Text.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/buttons/app_buttons_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/dialogs/dailog-list-select.dart'; diff --git a/lib/screens/prescription/prescription_warnings.dart b/lib/screens/prescription/prescription_warnings.dart index 44bcab0c..f6f040c2 100644 --- a/lib/screens/prescription/prescription_warnings.dart +++ b/lib/screens/prescription/prescription_warnings.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/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/buttons/app_buttons_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:flutter/material.dart'; diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index 7c1bc88e..c520c5f2 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -14,7 +14,7 @@ import 'package:doctor_app_flutter/util/helpers.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/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_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/network_base_view.dart'; diff --git a/lib/screens/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart index 8fe7deea..bf62faf7 100644 --- a/lib/screens/procedures/add-procedure-form.dart +++ b/lib/screens/procedures/add-procedure-form.dart @@ -11,7 +11,7 @@ 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/translations_delegate_base.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/buttons/app_buttons_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/dialogs/dailog-list-select.dart'; diff --git a/lib/screens/procedures/add_lab_orders.dart b/lib/screens/procedures/add_lab_orders.dart index 29f01858..294cac72 100644 --- a/lib/screens/procedures/add_lab_orders.dart +++ b/lib/screens/procedures/add_lab_orders.dart @@ -11,7 +11,7 @@ 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/translations_delegate_base.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/buttons/app_buttons_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/dialogs/dailog-list-select.dart'; diff --git a/lib/screens/procedures/add_radiology_order.dart b/lib/screens/procedures/add_radiology_order.dart index 9e614d44..1807aee6 100644 --- a/lib/screens/procedures/add_radiology_order.dart +++ b/lib/screens/procedures/add_radiology_order.dart @@ -11,7 +11,7 @@ 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/translations_delegate_base.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/buttons/app_buttons_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/dialogs/dailog-list-select.dart'; diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index 0ca2e360..708aa49d 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -6,7 +6,7 @@ import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.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/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; diff --git a/lib/screens/procedures/entity_list_procedure_widget.dart b/lib/screens/procedures/entity_list_procedure_widget.dart index 2f5c6ea2..14108811 100644 --- a/lib/screens/procedures/entity_list_procedure_widget.dart +++ b/lib/screens/procedures/entity_list_procedure_widget.dart @@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.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/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart index d9c6a20a..696dc1ad 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -12,7 +12,7 @@ import 'package:doctor_app_flutter/screens/procedures/entity_list_procedure_widg 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/widgets/shared/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_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/loader/gif_loader_dialog_utils.dart'; diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index e2959c75..ae29cee6 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -14,7 +14,7 @@ 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/widgets/shared/Text.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_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/app_texts_widget.dart'; diff --git a/lib/screens/sick-leave/sick_leave.dart b/lib/screens/sick-leave/sick_leave.dart index 0e1a8491..9b19e6cd 100644 --- a/lib/screens/sick-leave/sick_leave.dart +++ b/lib/screens/sick-leave/sick_leave.dart @@ -14,7 +14,7 @@ import 'package:doctor_app_flutter/util/text_validator.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/shared/Text.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_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/app_texts_widget.dart'; diff --git a/lib/widgets/auth/login_form.dart b/lib/widgets/auth/login_form.dart index 9fc50008..c9e13fd6 100644 --- a/lib/widgets/auth/login_form.dart +++ b/lib/widgets/auth/login_form.dart @@ -1,9 +1,8 @@ -import 'package:doctor_app_flutter/lookups/hospital_lookup.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_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/buttons/app_buttons_widget.dart'; + import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; @@ -17,7 +16,6 @@ import '../../config/size_config.dart'; import '../../models/doctor/user_model.dart'; import '../../core/viewModel/auth_view_model.dart'; import '../../core/viewModel/hospital_view_model.dart'; -import '../../routes.dart'; import '../../util/dr_app_shared_pref.dart'; import '../../util/dr_app_toast_msg.dart'; import '../../util/helpers.dart'; @@ -35,6 +33,7 @@ class LoginForm extends StatefulWidget with DrAppToastMsg { @override _LoginFormState createState() => _LoginFormState(); } + //TODO recreate the all page and apply the MVVM here class _LoginFormState extends State { final loginFormKey = GlobalKey(); @@ -57,6 +56,7 @@ class _LoginFormState extends State { sessionID: "i1UJwCTSqt"); AuthViewModel authProv; + @override void initState() { super.initState(); @@ -264,10 +264,11 @@ class _LoginFormState extends State { mainAxisAlignment: MainAxisAlignment.end, children: [ Expanded( - child: Button( + child: AppButton( title: TranslationBase.of(context).login, color: HexColor('#D02127'), - onTap: () { + fontWeight: FontWeight.bold, + onPressed: () { login(context, authProv, widget.changeLoadingStata); }, )), @@ -361,10 +362,11 @@ class _LoginFormState extends State { } }).catchError((err) { //TODO change the logic here - if(!err.contains('eservices.hmg@drsulaimanalhabib.com') ){ - hideLoading(); - changeLoadingStata(false); - helpers.showErrorToast(err);} + if (!err.contains('eservices.hmg@drsulaimanalhabib.com')) { + hideLoading(); + changeLoadingStata(false); + helpers.showErrorToast(err); + } }); } else { changeLoadingStata(false); diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index b4d39894..51867456 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -12,8 +12,10 @@ import 'package:doctor_app_flutter/models/doctor/profile_req_Model.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/widgets/otp/sms-popup.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; + import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; + import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; @@ -341,11 +343,11 @@ class _VerificationMethodsState extends State { ? Row( children: [ Expanded( - child: Button( + child: AppButton( title: TranslationBase.of(context) .useAnotherAccount, color: Colors.red[700], - onTap: () { + onPressed: () { Navigator.of(context).pushNamed(LOGIN); }, )), @@ -860,7 +862,12 @@ class _VerificationMethodsState extends State { sharedPref.setObj(DOCTOR_PROFILE, profile); projectsProvider.isLogin = true; - Navigator.pushAndRemoveUntil(context, FadePage(page: LandingPage(),), (r) => false); + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: LandingPage(), + ), + (r) => false); } getDocProfiles(ClinicModel clinicInfo, authProv) { diff --git a/lib/widgets/doctor/my_referral_patient_widget.dart b/lib/widgets/doctor/my_referral_patient_widget.dart index 98371a9f..29f62d1d 100644 --- a/lib/widgets/doctor/my_referral_patient_widget.dart +++ b/lib/widgets/doctor/my_referral_patient_widget.dart @@ -7,8 +7,10 @@ import 'package:doctor_app_flutter/util/helpers.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/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; + import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; + import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; import 'package:flutter/cupertino.dart'; @@ -21,7 +23,12 @@ class MyReferralPatientWidget extends StatefulWidget { final bool isExpand; final Function expandClick; - MyReferralPatientWidget({Key key, this.myReferralPatientModel, this.model, this.isExpand, this.expandClick}); + MyReferralPatientWidget( + {Key key, + this.myReferralPatientModel, + this.model, + this.isExpand, + this.expandClick}); @override _MyReferralPatientWidgetState createState() => @@ -428,8 +435,9 @@ class _MyReferralPatientWidgetState extends State { Container( width: double.infinity, margin: EdgeInsets.only(left: 10, right: 10), - child: Button( - onTap: () async { + child: AppButton( + title : TranslationBase.of(context).replay, + onPressed: () async { final form = _formKey.currentState; if (form.validate()) { try { @@ -443,7 +451,6 @@ class _MyReferralPatientWidgetState extends State { } } }, - title: TranslationBase.of(context).replay, loading: widget.model.state == ViewState.BusyLocal, ), ) diff --git a/lib/widgets/shared/app_button.dart b/lib/widgets/shared/app_button.dart deleted file mode 100644 index 3f9c4549..00000000 --- a/lib/widgets/shared/app_button.dart +++ /dev/null @@ -1,150 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; - -class Button extends StatefulWidget { - final String title; - final Widget icon; - final VoidCallback onTap; - final bool loading; - final Color color; - - Button({ - Key key, - this.title = "", - this.icon, - this.onTap, - this.loading= false, - this.color, - }) : super(key: key); - - - - @override - _ButtonState createState() => _ButtonState(); -} - -class _ButtonState extends State