From 5f482663ddf72a809dfb4710780d4a90aba78c96 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 6 Apr 2021 10:47:57 +0300 Subject: [PATCH 1/7] fix the stepper --- lib/screens/doctor/doctor_repaly_chat.dart | 5 +- lib/widgets/doctor/my_schedule_widget.dart | 4 +- .../profile/soap_update/steps_widget.dart | 75 ++++++++++--------- 3 files changed, 43 insertions(+), 41 deletions(-) diff --git a/lib/screens/doctor/doctor_repaly_chat.dart b/lib/screens/doctor/doctor_repaly_chat.dart index 35718793..362603b5 100644 --- a/lib/screens/doctor/doctor_repaly_chat.dart +++ b/lib/screens/doctor/doctor_repaly_chat.dart @@ -43,10 +43,11 @@ class DoctorReplayChat extends StatelessWidget { decoration: BoxDecoration( color: Colors.white, ), - height: 150, + height: 130, child: Container( + color: Colors.red, padding: EdgeInsets.only( - left: 10, right: 10, bottom: 10), + left: 10, right: 10), margin: EdgeInsets.only(top: 50), child: Column( children: [ diff --git a/lib/widgets/doctor/my_schedule_widget.dart b/lib/widgets/doctor/my_schedule_widget.dart index c1ba098e..d705010d 100644 --- a/lib/widgets/doctor/my_schedule_widget.dart +++ b/lib/widgets/doctor/my_schedule_widget.dart @@ -31,7 +31,7 @@ class MyScheduleWidget extends StatelessWidget { ), AppText( workingHoursTable.dayName, - fontSize: 2.5 * SizeConfig.textMultiplier, + fontSize: 18, fontFamily: 'Poppins', // fontSize: 18 ), @@ -40,7 +40,7 @@ class MyScheduleWidget extends StatelessWidget { ), AppText( ' ${workingHoursTable.date.day} ${(DateUtils.getMonth(workingHoursTable.date.month).toString().substring(0, 3))}', - fontSize: 2.5 * SizeConfig.textMultiplier, + fontSize: 18, fontWeight: FontWeight.w700, fontFamily: 'Poppins', // fontSize: 18 diff --git a/lib/widgets/patients/profile/soap_update/steps_widget.dart b/lib/widgets/patients/profile/soap_update/steps_widget.dart index dab907b2..9a6747c8 100644 --- a/lib/widgets/patients/profile/soap_update/steps_widget.dart +++ b/lib/widgets/patients/profile/soap_update/steps_widget.dart @@ -32,7 +32,7 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 45, + top: 50, left: 0, child: InkWell( onTap: () => changeCurrentTab(0), @@ -40,8 +40,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - width: 50, - height:50, + width: 38, + height: 38, decoration: BoxDecoration( border: index == 0 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -57,7 +57,7 @@ class StepsWidget extends StatelessWidget { : Color(0xFFCCCCCC), ), child: Center( - child: Icon(FontAwesomeIcons.check, size: 25, + child: Icon(FontAwesomeIcons.check, size: 20, color: Colors.white,) ), ), @@ -70,7 +70,7 @@ class StepsWidget extends StatelessWidget { AppText( "Subjective", fontWeight: FontWeight.bold, - fontSize: 14, + fontSize: 12, ), StatusLabel(selectedStepId: index, stepId: 0,), @@ -81,7 +81,7 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 45, + top: 50, left: MediaQuery .of(context) .size @@ -92,8 +92,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - width: 50, - height: 50, + width: 38, + height: 38, decoration: BoxDecoration( border: index == 1 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -109,7 +109,7 @@ class StepsWidget extends StatelessWidget { : Color(0xFFCCCCCC), ), child: Center( - child: Icon(FontAwesomeIcons.check, size: 25, + child: Icon(FontAwesomeIcons.check, size: 20, color: Colors.white,) ), ), @@ -122,7 +122,7 @@ class StepsWidget extends StatelessWidget { AppText( "Objective", fontWeight: FontWeight.bold, - fontSize: 14, + fontSize: 12, ), StatusLabel(selectedStepId: index, stepId: 1,), @@ -134,7 +134,7 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 45, + top: 50, left: MediaQuery .of(context) .size @@ -148,8 +148,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - width:50, - height:50, + width: 38, + height: 38, decoration: BoxDecoration( border: index == 2 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -165,7 +165,7 @@ class StepsWidget extends StatelessWidget { : Color(0xFFCCCCCC), ), child: Center( - child: Icon(FontAwesomeIcons.check, size: 25, + child: Icon(FontAwesomeIcons.check, size: 20, color: Colors.white,) ), ), @@ -178,7 +178,7 @@ class StepsWidget extends StatelessWidget { AppText( "Assessment", fontWeight: FontWeight.bold, - fontSize: 14, + fontSize: 12, ), StatusLabel(selectedStepId: index, stepId: 2,), ], @@ -188,16 +188,16 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 45, + top: 50, right: 0, child: InkWell( onTap: () => index >= 3 ? changeCurrentTab(4) : null, child: Column( - crossAxisAlignment: CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.end, children: [ Container( - width:50, - height:50, + width: 38, + height: 38, decoration: BoxDecoration( border: index == 3 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -213,7 +213,7 @@ class StepsWidget extends StatelessWidget { : Color(0xFFCCCCCC), ), child: Center( - child: Icon(FontAwesomeIcons.check, size: 25, + child: Icon(FontAwesomeIcons.check, size: 20, color: Colors.white,) ), ), @@ -227,7 +227,7 @@ class StepsWidget extends StatelessWidget { "Plan", fontWeight: FontWeight.bold, textAlign: TextAlign.center, - fontSize: 14, + fontSize: 12, ), StatusLabel(selectedStepId: index, stepId: 3,), ], @@ -257,7 +257,7 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 45, + top: 50, right: 0, child: InkWell( onTap: () => changeCurrentTab(0), @@ -265,8 +265,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - width: 50, - height:50, + width: 38, + height: 38, decoration: BoxDecoration( border: index == 0 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -282,7 +282,7 @@ class StepsWidget extends StatelessWidget { : Color(0xFFCCCCCC), ), child: Center( - child: Icon(FontAwesomeIcons.check, size: 25, + child: Icon(FontAwesomeIcons.check, size: 20, color: Colors.white,) ), ), @@ -299,7 +299,7 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 45, + top: 50, right: MediaQuery .of(context) .size @@ -310,8 +310,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - width: 50, - height: 50, + width: 38, + height: 38, decoration: BoxDecoration( border: index == 1 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -327,7 +327,7 @@ class StepsWidget extends StatelessWidget { : Color(0xFFCCCCCC), ), child: Center( - child: Icon(FontAwesomeIcons.check, size: 25, + child: Icon(FontAwesomeIcons.check, size: 20, color: Colors.white,) ), ), @@ -355,8 +355,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - width:50, - height:50, + width: 38, + height: 38, decoration: BoxDecoration( border: index == 2 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -372,7 +372,7 @@ class StepsWidget extends StatelessWidget { : Color(0xFFCCCCCC), ), child: Center( - child: Icon(FontAwesomeIcons.check, size: 25, + child: Icon(FontAwesomeIcons.check, size: 20, color: Colors.white,) ), ), @@ -393,7 +393,7 @@ class StepsWidget extends StatelessWidget { ), ), Positioned( - top: 45, + top: 50, left: 0, child: InkWell( onTap: () => index >= 3 ? changeCurrentTab(4) : null, @@ -401,8 +401,8 @@ class StepsWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( - width:50, - height:50, + width: 38, + height: 38, decoration: BoxDecoration( border: index == 3 ? Border.all(color: Color(0xFFCC9B14), width: 2) @@ -418,7 +418,7 @@ class StepsWidget extends StatelessWidget { : Color(0xFFCCCCCC), ), child: Center( - child: Icon(FontAwesomeIcons.check, size: 25, + child: Icon(FontAwesomeIcons.check, size: 20, color: Colors.white,) ), ), @@ -453,7 +453,8 @@ class StatusLabel extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - padding: EdgeInsets.symmetric(horizontal: 5, vertical: 3), + width: 65, + padding: EdgeInsets.symmetric(horizontal: 2, vertical: 3), decoration: BoxDecoration( color: stepId == selectedStepId ? Color(0xFFF1E9D3) : stepId < selectedStepId ? Color(0xFFD8E8DB) : Color(0xFFCCCCCC), From d8cce04b8ab3919491c18cc4257176a6679304e1 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 6 Apr 2021 11:16:07 +0300 Subject: [PATCH 2/7] fix replay design --- lib/screens/doctor/doctor_repaly_chat.dart | 100 +++++++++++++++------ lib/widgets/shared/TextFields.dart | 15 ++-- 2 files changed, 81 insertions(+), 34 deletions(-) diff --git a/lib/screens/doctor/doctor_repaly_chat.dart b/lib/screens/doctor/doctor_repaly_chat.dart index 362603b5..6980348b 100644 --- a/lib/screens/doctor/doctor_repaly_chat.dart +++ b/lib/screens/doctor/doctor_repaly_chat.dart @@ -43,12 +43,11 @@ class DoctorReplayChat extends StatelessWidget { decoration: BoxDecoration( color: Colors.white, ), - height: 130, + height: 115, child: Container( - color: Colors.red, padding: EdgeInsets.only( left: 10, right: 10), - margin: EdgeInsets.only(top: 50), + margin: EdgeInsets.only(top: 40), child: Column( children: [ Row( @@ -301,31 +300,76 @@ class DoctorReplayChat extends StatelessWidget { ), ), bottomSheet: Container( - child:TextFields( - hasLabelText: msgController.text != '' - ? true - : false, - showLabelText: false, - hintText: TranslationBase - .of(context) - .typeHereToReply, - fontSize: 13.5, - suffixIcon: FontAwesomeIcons.arrowRight, - suffixIconColor: Colors.green, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 50, - minLines: 3, - controller: msgController, - validator: (value) { - if (value == null || value == "") - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }), - height: MediaQuery.of(context).size.height * 0.1, - ), + width: double.infinity, + // height: MediaQuery.of(context).size.height * 0.12, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + FractionallySizedBox( + child: Container( + child: TextFields( + borderRadius: 0, + hasLabelText: msgController.text != '' + ? true + : false, + showLabelText: false, + hintText: "\n"+TranslationBase + .of(context) + .typeHereToReply, + fontSize: 13.5, + + suffixIcon: FontAwesomeIcons.arrowRight, + suffixIconColor: Colors.green, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 50, + minLines: 3, + controller: msgController, + validator: (value) { + if (value == null || value == "") + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }), + + ), + ), + ], + ), + ) + + + // Container( + // child:SingleChildScrollView( + // child: TextFields( + // borderRadius: 0, + // hasLabelText: msgController.text != '' + // ? true + // : false, + // showLabelText: false, + // hintText: "\n"+TranslationBase + // .of(context) + // .typeHereToReply, + // fontSize: 13.5, + // + // suffixIcon: FontAwesomeIcons.arrowRight, + // suffixIconColor: Colors.green, + // // hintColor: Colors.black, + // fontWeight: FontWeight.w600, + // maxLines: 50, + // minLines: 3, + // controller: msgController, + // validator: (value) { + // if (value == null || value == "") + // return TranslationBase.of(context) + // .emptyMessage; + // else + // return null; + // }), + // ), + // height: MediaQuery.of(context).size.height * 0.11, + // ), )); } } diff --git a/lib/widgets/shared/TextFields.dart b/lib/widgets/shared/TextFields.dart index 706c65b7..aab1eb61 100644 --- a/lib/widgets/shared/TextFields.dart +++ b/lib/widgets/shared/TextFields.dart @@ -77,7 +77,7 @@ class TextFields extends StatefulWidget { this.hasBorder = true, this.onTapTextFields, this.hasLabelText = false, - this.showLabelText = false}) + this.showLabelText = false, this.borderRadius= 8.0}) : super(key: key); final String hintText; @@ -116,6 +116,8 @@ class TextFields extends StatefulWidget { final Color fillColor; final bool hasBorder; final bool showLabelText; + + final double borderRadius; bool hasLabelText; @override @@ -276,6 +278,7 @@ class _TextFieldsState extends State { hintText: widget.hintText, hintStyle: TextStyle( fontSize: widget.fontSize, + fontWeight: widget.fontWeight, color: widget.hintColor ?? Theme.of(context).hintColor, ), @@ -304,7 +307,7 @@ class _TextFieldsState extends State { width: 1.0) : BorderSide(color: Colors.transparent, width: 0), borderRadius: widget.hasBorder - ? BorderRadius.circular(widget.bare ? 0.0 : 8.0) + ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) : BorderRadius.circular(0.0), ), focusedErrorBorder: OutlineInputBorder( @@ -315,13 +318,13 @@ class _TextFieldsState extends State { .withOpacity(widget.bare ? 0.0 : 0.5), width: 1.0) : BorderSide(color: Colors.transparent, width: 0), - borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)), + borderRadius: BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius)), focusedBorder: OutlineInputBorder( borderSide: widget.hasBorder ? BorderSide(color: Colors.grey, width: 1.0) : BorderSide(color: Colors.transparent, width: 0), borderRadius: widget.hasBorder - ? BorderRadius.circular(widget.bare ? 0.0 : 8.0) + ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) : BorderRadius.circular(0.0), ), disabledBorder: OutlineInputBorder( @@ -329,14 +332,14 @@ class _TextFieldsState extends State { ? BorderSide(color: Colors.grey, width: 1.0) : BorderSide(color: Colors.transparent, width: 0), borderRadius: widget.hasBorder - ? BorderRadius.circular(widget.bare ? 0.0 : 8.0) + ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) : BorderRadius.circular(0.0)), enabledBorder: OutlineInputBorder( borderSide: widget.hasBorder ? BorderSide(color: Colors.grey, width: 1.0) : BorderSide(color: Colors.transparent, width: 0), borderRadius: widget.hasBorder - ? BorderRadius.circular(widget.bare ? 0.0 : 8.0) + ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) : BorderRadius.circular(0.0), ), ), From 9559265a2d20b86011d9ed3d8a01d0b57031d5e0 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 6 Apr 2021 11:41:59 +0300 Subject: [PATCH 3/7] update chief complaint design --- .../soap_update/expandable_SOAP_widget.dart | 2 +- .../profile/soap_update/steps_widget.dart | 1 + .../subjective/update_Chief_complaints.dart | 193 +++++++++--------- lib/widgets/shared/new_text_Field.dart | 7 + 4 files changed, 108 insertions(+), 95 deletions(-) diff --git a/lib/widgets/patients/profile/soap_update/expandable_SOAP_widget.dart b/lib/widgets/patients/profile/soap_update/expandable_SOAP_widget.dart index 24a69a0b..57eb065b 100644 --- a/lib/widgets/patients/profile/soap_update/expandable_SOAP_widget.dart +++ b/lib/widgets/patients/profile/soap_update/expandable_SOAP_widget.dart @@ -38,7 +38,7 @@ class ExpandableSOAPWidget extends StatelessWidget { Texts(headerTitle, variant: isExpanded ? "bodyText" : '', bold: isExpanded ? true : false, - fontSize: 20, + fontSize: 15, color: Colors.black), Icon( FontAwesomeIcons.asterisk, diff --git a/lib/widgets/patients/profile/soap_update/steps_widget.dart b/lib/widgets/patients/profile/soap_update/steps_widget.dart index 9a6747c8..88c47706 100644 --- a/lib/widgets/patients/profile/soap_update/steps_widget.dart +++ b/lib/widgets/patients/profile/soap_update/steps_widget.dart @@ -222,6 +222,7 @@ class StepsWidget extends StatelessWidget { ), Center( child: Column( + crossAxisAlignment: CrossAxisAlignment.end, children: [ AppText( "Plan", diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_Chief_complaints.dart b/lib/widgets/patients/profile/soap_update/subjective/update_Chief_complaints.dart index 90211413..ef1caeb5 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_Chief_complaints.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_Chief_complaints.dart @@ -28,80 +28,78 @@ class UpdateChiefComplaints extends StatelessWidget { SizedBox( height: 20, ), - - Container( - - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - border: Border.all( - color: HexColor('#707070'), - width: 0.30), - ), - child: NewTextFields( - hintText: TranslationBase.of(context).addChiefComplaints, - controller: complaintsController, - ), - ), - Container( - margin: - EdgeInsets.only(left: 10, right: 10, top: 15), - child: TextFields( - hasLabelText: complaintsController.text != '' - ? true - : false, - hintText: TranslationBase - .of(context) - .addChiefComplaints, - fontSize: 13.5, - // hintColor: Colors.black, - showLabelText: true, - fontWeight: FontWeight.w600, - maxLines: 25, - minLines: 13, - controller: complaintsController, - validator: (value) { - if (value == null || value == "") - return TranslationBase.of(context) - .emptyMessage; - else if (value.length < 25) - return TranslationBase - .of(context) - .chiefComplaintLength; - //""; - else - return null; - }), + //TODO handel error cases + NewTextFields( + hintText: TranslationBase.of(context).addChiefComplaints, + controller: complaintsController, + maxLines: 25, + minLines: 13, ), + + // Container( + // margin: + // EdgeInsets.only(left: 10, right: 10, top: 15), + // child: TextFields( + // hasLabelText: complaintsController.text != '' + // ? true + // : false, + // hintText: TranslationBase + // .of(context) + // .addChiefComplaints, + // fontSize: 13.5, + // // hintColor: Colors.black, + // showLabelText: true, + // fontWeight: FontWeight.w600, + // maxLines: 25, + // minLines: 13, + // controller: complaintsController, + // validator: (value) { + // if (value == null || value == "") + // return TranslationBase.of(context) + // .emptyMessage; + // else if (value.length < 25) + // return TranslationBase + // .of(context) + // .chiefComplaintLength; + // //""; + // else + // return null; + // }), + // ), SizedBox( height: 20, ), - Container( - margin: - EdgeInsets.only(left: 10, right: 10, top: 15), - child: TextFields( - hasLabelText: - illnessController.text != '' ? true : false, - showLabelText: true, - hintText: TranslationBase - .of(context) - .historyOfPresentIllness, - fontSize: 13.5, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 25, - minLines: 13, - controller: illnessController, - validator: (value) { - if (value == null || value == "") - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }), + + NewTextFields( + hintText: TranslationBase.of(context).historyOfPresentIllness, + controller: illnessController, + maxLines: 25, + minLines: 13, ), + // Container( + // margin: + // EdgeInsets.only(left: 10, right: 10, top: 15), + // child: TextFields( + // hasLabelText: + // illnessController.text != '' ? true : false, + // showLabelText: true, + // hintText: TranslationBase + // .of(context) + // .historyOfPresentIllness, + // fontSize: 13.5, + // // hintColor: Colors.black, + // fontWeight: FontWeight.w600, + // maxLines: 25, + // minLines: 13, + // controller: illnessController, + // validator: (value) { + // if (value == null || value == "") + // return TranslationBase.of(context) + // .emptyMessage; + // else + // return null; + // }), + // ), SizedBox( height: 20, ), @@ -114,31 +112,38 @@ class UpdateChiefComplaints extends StatelessWidget { SizedBox( height: 10, ), - Container( - margin: - EdgeInsets.only(left: 10, right: 10, top: 15), - child: TextFields( - hasLabelText: medicationController.text != '' - ? true - : false, - showLabelText: true, - hintText: TranslationBase - .of(context) - .currentMedications, - fontSize: 13.5, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 23, - minLines: 10, - controller: medicationController, - validator: (value) { - if (value == null || value == "") - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), + // Container( + // margin: + // EdgeInsets.only(left: 10, right: 10, top: 15), + // child: TextFields( + // hasLabelText: medicationController.text != '' + // ? true + // : false, + // showLabelText: true, + // hintText: TranslationBase + // .of(context) + // .currentMedications, + // fontSize: 13.5, + // // hintColor: Colors.black, + // fontWeight: FontWeight.w600, + // maxLines: 23, + // minLines: 10, + // controller: medicationController, + // validator: (value) { + // if (value == null || value == "") + // return TranslationBase + // .of(context) + // .emptyMessage; + // else + // return null; + // }), + // ), + + NewTextFields( + hintText: TranslationBase.of(context).currentMedications, + controller: medicationController, + maxLines: 23, + minLines: 10, ), SizedBox( height: 10, diff --git a/lib/widgets/shared/new_text_Field.dart b/lib/widgets/shared/new_text_Field.dart index dc361abd..6ad3d570 100644 --- a/lib/widgets/shared/new_text_Field.dart +++ b/lib/widgets/shared/new_text_Field.dart @@ -2,6 +2,7 @@ import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:hexcolor/hexcolor.dart'; class NumberTextInputFormatter extends TextInputFormatter { @override @@ -158,9 +159,15 @@ class _NewTextFieldsState extends State { duration: Duration(milliseconds: 300), decoration: BoxDecoration( borderRadius: BorderRadius.circular(12), + border: Border.all( + color: HexColor('#707070'), + width: 0.30), color: Colors.white), child: Container( margin: EdgeInsets.only(top: 8), + padding: EdgeInsets.only(top: 8), + + child: TextFormField( enabled: widget.isEnabled, initialValue: widget.initialValue, From 8fd318548aeab00be1093124829fe2583f70f8ef Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 6 Apr 2021 13:15:45 +0300 Subject: [PATCH 4/7] finish chief complaint design --- .../subjective/update_Chief_complaints.dart | 140 +++++++----------- .../subjective/update_medication_widget.dart | 7 +- .../subjective/update_subjective_page.dart | 46 +++++- lib/widgets/shared/TextFields.dart | 13 +- 4 files changed, 106 insertions(+), 100 deletions(-) diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_Chief_complaints.dart b/lib/widgets/patients/profile/soap_update/subjective/update_Chief_complaints.dart index ef1caeb5..fd424767 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_Chief_complaints.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_Chief_complaints.dart @@ -1,10 +1,10 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_medication_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/new_text_Field.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; + +import '../custom_validation_error.dart'; class UpdateChiefComplaints extends StatelessWidget { const UpdateChiefComplaints({ @@ -13,18 +13,24 @@ class UpdateChiefComplaints extends StatelessWidget { @required this.complaintsController, @required this.illnessController, @required this.medicationController, + this.complaintsControllerError, + this.illnessControllerError, + this.medicationControllerError, }) : super(key: key); final GlobalKey formKey; final TextEditingController complaintsController; final TextEditingController illnessController; final TextEditingController medicationController; + final String complaintsControllerError; + final String illnessControllerError; + final String medicationControllerError; @override Widget build(BuildContext context) { return Form( key: formKey, - child: Column(children: [ + child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 20, ), @@ -33,9 +39,14 @@ class UpdateChiefComplaints extends StatelessWidget { hintText: TranslationBase.of(context).addChiefComplaints, controller: complaintsController, maxLines: 25, - minLines: 13, + minLines: 3, ), + Container( + child: CustomValidationError( + error: complaintsControllerError, + )), + // Container( // margin: // EdgeInsets.only(left: 10, right: 10, top: 15), @@ -66,89 +77,46 @@ class UpdateChiefComplaints extends StatelessWidget { // return null; // }), // ), - SizedBox( - height: 20, - ), - - NewTextFields( - hintText: TranslationBase.of(context).historyOfPresentIllness, - controller: illnessController, - maxLines: 25, - minLines: 13, - ), - // Container( - // margin: - // EdgeInsets.only(left: 10, right: 10, top: 15), - // child: TextFields( - // hasLabelText: - // illnessController.text != '' ? true : false, - // showLabelText: true, - // hintText: TranslationBase - // .of(context) - // .historyOfPresentIllness, - // fontSize: 13.5, - // // hintColor: Colors.black, - // fontWeight: FontWeight.w600, - // maxLines: 25, - // minLines: 13, - // controller: illnessController, - // validator: (value) { - // if (value == null || value == "") - // return TranslationBase.of(context) - // .emptyMessage; - // else - // return null; - // }), - // ), - SizedBox( - height: 20, - ), - SizedBox( - height: 10, - ), - UpdateMedicationWidget( - medicationController: medicationController, - ), - SizedBox( - height: 10, - ), - // Container( - // margin: - // EdgeInsets.only(left: 10, right: 10, top: 15), - // child: TextFields( - // hasLabelText: medicationController.text != '' - // ? true - // : false, - // showLabelText: true, - // hintText: TranslationBase - // .of(context) - // .currentMedications, - // fontSize: 13.5, - // // hintColor: Colors.black, - // fontWeight: FontWeight.w600, - // maxLines: 23, - // minLines: 10, - // controller: medicationController, - // validator: (value) { - // if (value == null || value == "") - // return TranslationBase - // .of(context) - // .emptyMessage; - // else - // return null; - // }), - // ), + SizedBox( + height: 20, + ), - NewTextFields( - hintText: TranslationBase.of(context).currentMedications, - controller: medicationController, - maxLines: 23, - minLines: 10, - ), - SizedBox( - height: 10, - ), - ]), + NewTextFields( + hintText: TranslationBase + .of(context) + .historyOfPresentIllness, + controller: illnessController, + maxLines: 25, + minLines: 3, + ), + Container( + child: CustomValidationError(error: illnessControllerError,)), + SizedBox( + height: 20, + ), + SizedBox( + height: 10, + ), + UpdateMedicationWidget( + medicationController: medicationController, + ), + SizedBox( + height: 10, + ), + NewTextFields( + hintText: TranslationBase + .of(context) + .currentMedications, + controller: medicationController, + maxLines: 25, + minLines: 3, + ), + Container(child: CustomValidationError( + error: medicationControllerError,)), + SizedBox( + height: 10, + ), + ]), ); } } \ No newline at end of file diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_medication_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_medication_widget.dart index f32bfe6e..68844765 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_medication_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_medication_widget.dart @@ -16,6 +16,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; import '../custom_validation_error.dart'; @@ -40,17 +41,19 @@ class _UpdateMedicationWidgetState extends State { return Column( children: [ Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), child: TextFields( hintText: TranslationBase.of(context).addMedication, + borderColor: HexColor('#707070'), + borderWidth: 0.30, fontSize: 13.5, + borderRadius: 12, onTapTextFields: () { openMedicationList(context); }, readOnly: true, // hintColor: Colors.black, suffixIcon: EvaIcons.plusCircleOutline, - suffixIconColor: AppGlobal.appPrimaryColor, + suffixIconColor: Color(0xFF2B353E), fontWeight: FontWeight.w600, // controller: messageController, validator: (value) { diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index 140fec54..c40ee25e 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -19,8 +19,6 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_Chief_complaints.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_history_widget.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_medication_widget.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_scaffold_widget.dart'; import 'package:flutter/material.dart'; @@ -53,7 +51,9 @@ class _UpdateSubjectivePageState extends State { TextEditingController illnessController = TextEditingController(); TextEditingController complaintsController = TextEditingController(); TextEditingController medicationController = TextEditingController(); - + String complaintsControllerError = ''; + String medicationControllerError = ''; + String illnessControllerError = ''; final formKey = GlobalKey(); getHistory(SOAPViewModel model) async { @@ -235,8 +235,7 @@ class _UpdateSubjectivePageState extends State { height: 30, ), ExpandableSOAPWidget( - headerTitle: TranslationBase - .of(context) + headerTitle: TranslationBase.of(context) .chiefComplaints .toUpperCase(), onTap: () { @@ -244,7 +243,15 @@ class _UpdateSubjectivePageState extends State { isChiefExpand = !isChiefExpand; }); }, - child: UpdateChiefComplaints(formKey: formKey, complaintsController: complaintsController, illnessController: illnessController, medicationController: medicationController), + child: UpdateChiefComplaints( + formKey: formKey, + complaintsController: complaintsController, + illnessController: illnessController, + medicationController: medicationController, + complaintsControllerError: complaintsControllerError, + illnessControllerError: illnessControllerError, + medicationControllerError: medicationControllerError, + ), isExpanded: isChiefExpand, ), SizedBox( @@ -356,7 +363,9 @@ class _UpdateSubjectivePageState extends State { formKey.currentState.save(); formKey.currentState.validate(); - + complaintsControllerError = ''; + medicationControllerError = ''; + illnessControllerError = ''; if (complaintsController.text.isNotEmpty && illnessController.text.isNotEmpty && complaintsController.text.length > 25) { @@ -382,6 +391,29 @@ class _UpdateSubjectivePageState extends State { widget.changePageViewIndex(1); } else { + setState(() { + if (complaintsController.text.isEmpty) { + complaintsControllerError = TranslationBase + .of(context) + .emptyMessage; + } else if (complaintsController.text.length < 25) { + complaintsControllerError = TranslationBase + .of(context) + .chiefComplaintLength; + } + + if (illnessController.text.isEmpty) { + illnessControllerError = TranslationBase + .of(context) + .emptyMessage; + } + + if (medicationController.text.isEmpty) { + medicationControllerError = TranslationBase + .of(context) + .emptyMessage; + } + }); helpers.showErrorToast(TranslationBase .of(context) .chiefComplaintErrorMsg); diff --git a/lib/widgets/shared/TextFields.dart b/lib/widgets/shared/TextFields.dart index aab1eb61..18d8e778 100644 --- a/lib/widgets/shared/TextFields.dart +++ b/lib/widgets/shared/TextFields.dart @@ -77,7 +77,7 @@ class TextFields extends StatefulWidget { this.hasBorder = true, this.onTapTextFields, this.hasLabelText = false, - this.showLabelText = false, this.borderRadius= 8.0}) + this.showLabelText = false, this.borderRadius= 8.0, this.borderColor, this.borderWidth = 1, }) : super(key: key); final String hintText; @@ -116,8 +116,9 @@ class TextFields extends StatefulWidget { final Color fillColor; final bool hasBorder; final bool showLabelText; - + Color borderColor; final double borderRadius; + final double borderWidth; bool hasLabelText; @override @@ -202,6 +203,8 @@ class _TextFieldsState extends State { @override Widget build(BuildContext context) { + + widget.borderColor = widget.borderColor?? Colors.grey; return (AnimatedContainer( duration: Duration(milliseconds: 300), decoration: widget.bare @@ -321,7 +324,7 @@ class _TextFieldsState extends State { borderRadius: BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius)), focusedBorder: OutlineInputBorder( borderSide: widget.hasBorder - ? BorderSide(color: Colors.grey, width: 1.0) + ? BorderSide(color: widget.borderColor,width: widget.borderWidth) : BorderSide(color: Colors.transparent, width: 0), borderRadius: widget.hasBorder ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) @@ -329,14 +332,14 @@ class _TextFieldsState extends State { ), disabledBorder: OutlineInputBorder( borderSide: widget.hasBorder - ? BorderSide(color: Colors.grey, width: 1.0) + ? BorderSide(color: widget.borderColor,width: widget.borderWidth) : BorderSide(color: Colors.transparent, width: 0), borderRadius: widget.hasBorder ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) : BorderRadius.circular(0.0)), enabledBorder: OutlineInputBorder( borderSide: widget.hasBorder - ? BorderSide(color: Colors.grey, width: 1.0) + ? BorderSide(color: widget.borderColor,width: widget.borderWidth) : BorderSide(color: Colors.transparent, width: 0), borderRadius: widget.hasBorder ? BorderRadius.circular(widget.bare ? 0.0 : widget.borderRadius) From da0f93202439e0ca82797625148cb6373eedc48a Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 6 Apr 2021 13:26:04 +0300 Subject: [PATCH 5/7] update Text Fields --- lib/widgets/shared/new_text_Field.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/widgets/shared/new_text_Field.dart b/lib/widgets/shared/new_text_Field.dart index 6ad3d570..f2e90f44 100644 --- a/lib/widgets/shared/new_text_Field.dart +++ b/lib/widgets/shared/new_text_Field.dart @@ -71,8 +71,8 @@ class NewTextFields extends StatefulWidget { this.prefixIcon, this.bare = false, this.onTap, - this.fontSize = 16.0, - this.fontWeight = FontWeight.w700, + this.fontSize = 15.0, + this.fontWeight = FontWeight.w500, this.autoValidate = false, this.hintColor, this.isEnabled = true}) @@ -197,7 +197,7 @@ class _NewTextFieldsState extends State { validator: widget.validator, onSaved: widget.onSaved, style: Theme.of(context).textTheme.body2.copyWith( - fontSize: widget.fontSize, fontWeight: widget.fontWeight), + fontSize: widget.fontSize, fontWeight: widget.fontWeight, color: Color(0xFF575757), fontFamily: 'Poppins'), inputFormatters: widget.keyboardType == TextInputType.phone ? [ WhitelistingTextInputFormatter.digitsOnly, @@ -207,7 +207,7 @@ class _NewTextFieldsState extends State { decoration: InputDecoration( labelText: widget.hintText, labelStyle: - TextStyle(color: Theme.of(context).textTheme.bodyText1.color), + TextStyle(color: Color(0xFF2E303A), fontSize:15,fontWeight: FontWeight.w700), errorBorder: OutlineInputBorder( borderSide: BorderSide( color: Theme.of(context).errorColor.withOpacity(0.5), From 2af1b6470ae0361196c66f0a9b9a80215012a370 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 6 Apr 2021 13:27:46 +0300 Subject: [PATCH 6/7] remove commented code --- lib/screens/doctor/doctor_repaly_chat.dart | 32 ---------------------- 1 file changed, 32 deletions(-) diff --git a/lib/screens/doctor/doctor_repaly_chat.dart b/lib/screens/doctor/doctor_repaly_chat.dart index 6980348b..d183406b 100644 --- a/lib/screens/doctor/doctor_repaly_chat.dart +++ b/lib/screens/doctor/doctor_repaly_chat.dart @@ -338,38 +338,6 @@ class DoctorReplayChat extends StatelessWidget { ], ), ) - - - // Container( - // child:SingleChildScrollView( - // child: TextFields( - // borderRadius: 0, - // hasLabelText: msgController.text != '' - // ? true - // : false, - // showLabelText: false, - // hintText: "\n"+TranslationBase - // .of(context) - // .typeHereToReply, - // fontSize: 13.5, - // - // suffixIcon: FontAwesomeIcons.arrowRight, - // suffixIconColor: Colors.green, - // // hintColor: Colors.black, - // fontWeight: FontWeight.w600, - // maxLines: 50, - // minLines: 3, - // controller: msgController, - // validator: (value) { - // if (value == null || value == "") - // return TranslationBase.of(context) - // .emptyMessage; - // else - // return null; - // }), - // ), - // height: MediaQuery.of(context).size.height * 0.11, - // ), )); } } From 654955fc76270892ac0b0604e23f0f5a1f0458ac Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 6 Apr 2021 13:31:57 +0300 Subject: [PATCH 7/7] fix label issue --- .../soap_update/subjective/update_subjective_page.dart | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index c40ee25e..c3a43648 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -237,7 +237,7 @@ class _UpdateSubjectivePageState extends State { ExpandableSOAPWidget( headerTitle: TranslationBase.of(context) .chiefComplaints - .toUpperCase(), + , onTap: () { setState(() { isChiefExpand = !isChiefExpand; @@ -262,8 +262,7 @@ class _UpdateSubjectivePageState extends State { ExpandableSOAPWidget( headerTitle: TranslationBase .of(context) - .histories - .toUpperCase(), + .histories, onTap: () { setState(() { isHistoryExpand = !isHistoryExpand; @@ -285,7 +284,7 @@ class _UpdateSubjectivePageState extends State { headerTitle: TranslationBase .of(context) .allergiesSoap - .toUpperCase(), + , onTap: () { setState(() { isAllergiesExpand = !isAllergiesExpand;