From 2d4cb00716b4f1a063576272467fd800b95bdb69 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Fri, 23 Apr 2021 19:14:29 +0300 Subject: [PATCH 1/4] fix design issue --- ios/Podfile.lock | 2 +- lib/config/config.dart | 4 +-- lib/screens/doctor/doctor_reply_screen.dart | 16 +++++------ .../profile/note/progress_note_screen.dart | 27 ++++++++++++------- lib/widgets/doctor/doctor_reply_widget.dart | 14 +++++----- 5 files changed, 36 insertions(+), 27 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 878a1850..2f4607e0 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -322,4 +322,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69 -COCOAPODS: 1.10.1 +COCOAPODS: 1.10.0.rc.1 diff --git a/lib/config/config.dart b/lib/config/config.dart index d350f66f..85e474eb 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -316,8 +316,8 @@ const PRIMARY_COLOR = 0xff515B5D; const TRANSACTION_NO = 0; const LANGUAGE_ID = 2; const STAMP = '2020-04-27T12:17:17.721Z'; -const IP_ADDRESS = '9.9.9.9'; -const VERSION_ID = 5.5; +const IP_ADDRESS = '11.11.11.11'; +const VERSION_ID = 5.6; const CHANNEL = 9; const SESSION_ID = 'BlUSkYymTt'; const IS_LOGIN_FOR_DOCTOR_APP = true; diff --git a/lib/screens/doctor/doctor_reply_screen.dart b/lib/screens/doctor/doctor_reply_screen.dart index 283ce7cd..f60f464c 100644 --- a/lib/screens/doctor/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_reply_screen.dart @@ -51,14 +51,14 @@ class DoctorReplyScreen extends StatelessWidget { onTap: reply.status != 2 ? null : () { - Navigator.push( - context, - MaterialPageRoute( - builder: (BuildContext context) => - DoctorReplayChat( - reply: reply, - previousModel: model, - ))); + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (BuildContext context) => + // DoctorReplayChat( + // reply: reply, + // previousModel: model, + // ))); }, child: DoctorReplyWidget(reply: reply), ); diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/note/progress_note_screen.dart index 5b806d4e..45e35079 100644 --- a/lib/screens/patients/profile/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/note/progress_note_screen.dart @@ -9,6 +9,7 @@ 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/patients/profile/add-order/addNewOrder.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; +import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; @@ -171,6 +172,7 @@ class _ProgressNoteState extends State { onTap: () async { showMyDialog( context: context, + actionName: "cancel", confirmFun: () async { GifLoaderDialogUtils .showMyDialog( @@ -241,7 +243,7 @@ class _ProgressNoteState extends State { ), InkWell( onTap: () async { - showMyDialog(context: context, confirmFun: () async{ + showMyDialog(context: context, actionName: "verify",confirmFun: () async{ GifLoaderDialogUtils .showMyDialog(context); UpdateNoteReqModel reqModel = @@ -400,7 +402,7 @@ class _ProgressNoteState extends State { ); } - showMyDialog({BuildContext context, Function confirmFun, isCancel = true}) { + showMyDialog({BuildContext context, Function confirmFun, String actionName}) { showDialog( context: context, child: Center( @@ -412,7 +414,7 @@ class _ProgressNoteState extends State { height: MediaQuery .of(context) .size - .height * 0.5, + .height * 0.3, child: AppScaffold( isShowAppBar: false, body: Container( @@ -420,25 +422,32 @@ class _ProgressNoteState extends State { child: Center( child: Column( - mainAxisAlignment: MainAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.center, children: [ // SizedBox(height: 20,), + SizedBox(height: 5,), + AppText( + "Confirm", fontWeight: FontWeight.w600, + color: Colors.black, + fontSize: 16,), + SizedBox(height: 5,), + DividerWithSpacesAround(), Container( padding: EdgeInsets.all(20), color: Colors.white, child: Expanded( child: AppText( - 'Are you sure you want to do this action?', + 'Are you sure you want $actionName this order?', fontSize: 15, textAlign: TextAlign.center, ), ), ), - SizedBox(height: MediaQuery - .of(context) - .size - .height * 0.2,), + + SizedBox(height: 30,), + DividerWithSpacesAround(), + // SizedBox(height: 30,), Row( mainAxisAlignment: MainAxisAlignment.center, children: [ diff --git a/lib/widgets/doctor/doctor_reply_widget.dart b/lib/widgets/doctor/doctor_reply_widget.dart index 5e8fb8cf..b346a827 100644 --- a/lib/widgets/doctor/doctor_reply_widget.dart +++ b/lib/widgets/doctor/doctor_reply_widget.dart @@ -220,15 +220,15 @@ class _DoctorReplyWidgetState extends State { Container( width: MediaQuery.of(context).size.width * 0.5, child: RichText( - maxLines: 2, - overflow: TextOverflow.ellipsis, + // maxLines: 2, + // overflow: TextOverflow.ellipsis, text: new TextSpan( style: new TextStyle( fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black), children: [ new TextSpan( - text: TranslationBase.of(context).doctorResponse + " : ", + text:"Patient Question :" ,//TranslationBase.of(context).doctorResponse + " : ", style: TextStyle(fontSize: 14, fontFamily: 'Poppins', color: Color(0xFF575757),fontWeight: FontWeight.bold)), new TextSpan( @@ -244,10 +244,10 @@ class _DoctorReplyWidgetState extends State { ],) ], ), - Container( - alignment: projectViewModel.isArabic?Alignment.centerLeft:Alignment.centerRight, - child: Icon(FontAwesomeIcons.arrowRight, - size: 20, color: Colors.black),) + // Container( + // alignment: projectViewModel.isArabic?Alignment.centerLeft:Alignment.centerRight, + // child: Icon(FontAwesomeIcons.arrowRight, + // size: 20, color: Colors.black),) ], ), // onTap: onTap, From 4a6503c2cf965ee0ece0cf637d14921885258f72 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Fri, 23 Apr 2021 19:44:37 +0300 Subject: [PATCH 2/4] fix design issue --- .../profile/note/progress_note_screen.dart | 84 ++++++++++--------- .../patients/profile/note/update_note.dart | 5 +- 2 files changed, 47 insertions(+), 42 deletions(-) diff --git a/lib/screens/patients/profile/note/progress_note_screen.dart b/lib/screens/patients/profile/note/progress_note_screen.dart index 45e35079..588c3079 100644 --- a/lib/screens/patients/profile/note/progress_note_screen.dart +++ b/lib/screens/patients/profile/note/progress_note_screen.dart @@ -411,10 +411,7 @@ class _ProgressNoteState extends State { .of(context) .size .width * 0.8, - height: MediaQuery - .of(context) - .size - .height * 0.3, + height: 200, child: AppScaffold( isShowAppBar: false, body: Container( @@ -422,54 +419,61 @@ class _ProgressNoteState extends State { child: Center( child: Column( - mainAxisAlignment: MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ // SizedBox(height: 20,), - SizedBox(height: 5,), - AppText( - "Confirm", fontWeight: FontWeight.w600, - color: Colors.black, - fontSize: 16,), - SizedBox(height: 5,), + SizedBox(height: 10,), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppText( + "Confirm", fontWeight: FontWeight.w600, + color: Colors.black, + fontSize: 16,), + ], + ), + SizedBox(height: 10,), DividerWithSpacesAround(), + SizedBox(height: 12,), + Container( padding: EdgeInsets.all(20), color: Colors.white, - child: Expanded( - child: AppText( - 'Are you sure you want $actionName this order?', - fontSize: 15, - textAlign: TextAlign.center, - ), + child: AppText( + 'Are you sure you want $actionName this order?', + fontSize: 15, + textAlign: TextAlign.center, ), ), - SizedBox(height: 30,), + SizedBox(height: 8,), DividerWithSpacesAround(), - // SizedBox(height: 30,), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - FlatButton( - child: AppText( - "Cancel", fontWeight: FontWeight.w600, - color: Colors.black, - fontSize: 16,),//Text("Cancel"), - onPressed: () { - Navigator.of(context).pop(); - }), - FlatButton( - child: AppText( - "Confirm", fontWeight: FontWeight.w600, - color: Colors.red.shade700, - fontSize: 16,), //Text("Confirm", ), - onPressed: () async { - await confirmFun(); - Navigator.of(context).pop(); - }) + FractionallySizedBox( + widthFactor: 0.75, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + FlatButton( + child: AppText( + "Cancel", fontWeight: FontWeight.w600, + color: Colors.black, + fontSize: 16,),//Text("Cancel"), + onPressed: () { + Navigator.of(context).pop(); + }), + FlatButton( + child: AppText( + "Confirm", fontWeight: FontWeight.w600, + color: Colors.red.shade700, + fontSize: 16,), //Text("Confirm", ), + onPressed: () async { + await confirmFun(); + Navigator.of(context).pop(); + }) - ], + ], + ), ) ], ), diff --git a/lib/screens/patients/profile/note/update_note.dart b/lib/screens/patients/profile/note/update_note.dart index 90b94ab3..30019a19 100644 --- a/lib/screens/patients/profile/note/update_note.dart +++ b/lib/screens/patients/profile/note/update_note.dart @@ -9,6 +9,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/models/patient/progress_note_request.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.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_scaffold_widget.dart'; @@ -159,7 +160,7 @@ class _UpdateNoteOrderState extends State { if (widget.patientModel.state == ViewState.ErrorLocal) { Helpers.showErrorToast( - Helpers.generateContactAdminMsg()); + widget.patientModel.error ); } else { ProgressNoteRequest progressNoteRequest = ProgressNoteRequest( @@ -173,8 +174,8 @@ class _UpdateNoteOrderState extends State { await widget.patientModel.getPatientProgressNote( progressNoteRequest.toJson()); } - GifLoaderDialogUtils.hideDialog(context); + DrAppToastMsg.showSuccesToast("Your Order added Successfully"); Navigator.of(context).pop(); } }), From 23cb01daf5948146aaab2029cbf7b41d2370d046 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Fri, 23 Apr 2021 20:39:21 +0300 Subject: [PATCH 3/4] prevent add spaces --- lib/screens/doctor/doctor_repaly_chat.dart | 131 ++++++++++-------- lib/screens/doctor/doctor_reply_screen.dart | 20 ++- .../patients/profile/note/update_note.dart | 4 +- lib/widgets/doctor/doctor_reply_widget.dart | 18 ++- 4 files changed, 100 insertions(+), 73 deletions(-) diff --git a/lib/screens/doctor/doctor_repaly_chat.dart b/lib/screens/doctor/doctor_repaly_chat.dart index b5576e69..2c614b29 100644 --- a/lib/screens/doctor/doctor_repaly_chat.dart +++ b/lib/screens/doctor/doctor_repaly_chat.dart @@ -20,6 +20,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:hexcolor/hexcolor.dart'; +import 'package:url_launcher/url_launcher.dart'; class DoctorReplayChat extends StatelessWidget { @@ -107,7 +108,7 @@ class DoctorReplayChat extends StatelessWidget { SizedBox(height: 30,), Container( // color: Color(0xFF2B353E), - width: MediaQuery.of(context).size.width * 0.8, + width: MediaQuery.of(context).size.width * 0.9, padding: EdgeInsets.all(10), decoration: BoxDecoration( color: Color(0xFF2B353E), @@ -135,7 +136,7 @@ class DoctorReplayChat extends StatelessWidget { width: 60, height: 60, child: Image.asset( - 1 == 1 + reply.gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, @@ -144,7 +145,7 @@ class DoctorReplayChat extends StatelessWidget { Divider(), SizedBox(width: 10,), Container( - width: MediaQuery.of(context).size.width * 0.30, + width: MediaQuery.of(context).size.width * 0.35, child: AppText( reply.patientName .toString(), @@ -154,7 +155,19 @@ class DoctorReplayChat extends StatelessWidget { fontWeight: FontWeight.bold, // fontSize: 18 ), - ) + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 4), + child: InkWell( + onTap: () { + launch("tel://" +reply.mobileNumber); + }, + child: Icon( + Icons.phone, + color: Colors.white, + ), + ), + ), ], ), Column( @@ -218,61 +231,61 @@ class DoctorReplayChat extends StatelessWidget { ), ), - Positioned( - bottom: 0, - child: Container( - width:MediaQuery.of(context).size.width * 1, - // height: MediaQuery.of(context).size.height * 0.12, - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - FractionallySizedBox( - child: Container( - - child: TextFields( - borderRadius: 0, - hintText: TranslationBase - .of(context) - .typeHereToReply, - fontSize: 13.5, - - suffixIcon: FontAwesomeIcons.arrowRight, - suffixIconColor: Colors.green, - onSuffixTap: ()async { - GifLoaderDialogUtils.showMyDialog(context); - await model.replay(msgController.text, reply); - if(model.state == ViewState.ErrorLocal) { - Helpers.showErrorToast("An error happened while you are replaying"); - } else { - DrAppToastMsg.showSuccesToast("Thank you for your replay "); - await previousModel.getDoctorReply(); - Navigator.pop(context); - } - GifLoaderDialogUtils.hideDialog(context); - - - - - }, - // 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; - }), - - ), - ), - ], - ), - ), - ) + // Positioned( + // bottom: 0, + // child: Container( + // width:MediaQuery.of(context).size.width * 1, + // // height: MediaQuery.of(context).size.height * 0.12, + // child: Column( + // mainAxisSize: MainAxisSize.min, + // children: [ + // FractionallySizedBox( + // child: Container( + // + // child: TextFields( + // borderRadius: 0, + // hintText: TranslationBase + // .of(context) + // .typeHereToReply, + // fontSize: 13.5, + // + // suffixIcon: FontAwesomeIcons.arrowRight, + // suffixIconColor: Colors.green, + // onSuffixTap: ()async { + // GifLoaderDialogUtils.showMyDialog(context); + // await model.replay(msgController.text, reply); + // if(model.state == ViewState.ErrorLocal) { + // Helpers.showErrorToast("An error happened while you are replaying"); + // } else { + // DrAppToastMsg.showSuccesToast("Thank you for your replay "); + // await previousModel.getDoctorReply(); + // Navigator.pop(context); + // } + // GifLoaderDialogUtils.hideDialog(context); + // + // + // + // + // }, + // // 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; + // }), + // + // ), + // ), + // ], + // ), + // ), + // ) ], diff --git a/lib/screens/doctor/doctor_reply_screen.dart b/lib/screens/doctor/doctor_reply_screen.dart index f60f464c..f522561f 100644 --- a/lib/screens/doctor/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_reply_screen.dart @@ -48,17 +48,15 @@ class DoctorReplyScreen extends StatelessWidget { children: model.listDoctorWorkingHoursTable.map((reply) { return InkWell( - onTap: reply.status != 2 - ? null - : () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (BuildContext context) => - // DoctorReplayChat( - // reply: reply, - // previousModel: model, - // ))); + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => + DoctorReplayChat( + reply: reply, + previousModel: model, + ))); }, child: DoctorReplyWidget(reply: reply), ); diff --git a/lib/screens/patients/profile/note/update_note.dart b/lib/screens/patients/profile/note/update_note.dart index 30019a19..5c67b153 100644 --- a/lib/screens/patients/profile/note/update_note.dart +++ b/lib/screens/patients/profile/note/update_note.dart @@ -118,7 +118,7 @@ class _UpdateNoteOrderState extends State { setState(() { isSubmitted = true; }); - if (progressNoteController.text.isNotEmpty) { + if (progressNoteController.text.trim().isNotEmpty) { GifLoaderDialogUtils.showMyDialog(context); Map profile = await sharedPref.getObj(DOCTOR_PROFILE); @@ -177,6 +177,8 @@ class _UpdateNoteOrderState extends State { GifLoaderDialogUtils.hideDialog(context); DrAppToastMsg.showSuccesToast("Your Order added Successfully"); Navigator.of(context).pop(); + } else { + Helpers.showErrorToast("You cant add only spaces"); } }), ], diff --git a/lib/widgets/doctor/doctor_reply_widget.dart b/lib/widgets/doctor/doctor_reply_widget.dart index b346a827..8ad3a071 100644 --- a/lib/widgets/doctor/doctor_reply_widget.dart +++ b/lib/widgets/doctor/doctor_reply_widget.dart @@ -11,6 +11,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; +import 'package:url_launcher/url_launcher.dart'; class DoctorReplyWidget extends StatefulWidget { final ListGtMyPatientsQuestions reply; @@ -104,6 +105,7 @@ class _DoctorReplyWidgetState extends State { ], ), Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( child: AppText( @@ -113,6 +115,18 @@ class _DoctorReplyWidgetState extends State { fontFamily: 'Poppins', ), ), + Container( + margin: EdgeInsets.symmetric(horizontal: 4), + child: InkWell( + onTap: () { + launch("tel://" +widget.reply.mobileNumber); + }, + child: Icon( + Icons.phone, + color: Colors.black87, + ), + ), + ), SizedBox( width: 4, ), @@ -220,8 +234,8 @@ class _DoctorReplyWidgetState extends State { Container( width: MediaQuery.of(context).size.width * 0.5, child: RichText( - // maxLines: 2, - // overflow: TextOverflow.ellipsis, + maxLines: 3, + overflow: TextOverflow.ellipsis, text: new TextSpan( style: new TextStyle( fontSize: 2.0 * SizeConfig.textMultiplier, From 8f871898b866a13f86f8649b45ddac2a3fce564e Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Fri, 23 Apr 2021 20:56:41 +0300 Subject: [PATCH 4/4] return config back --- lib/config/config.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 85e474eb..d350f66f 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -316,8 +316,8 @@ const PRIMARY_COLOR = 0xff515B5D; const TRANSACTION_NO = 0; const LANGUAGE_ID = 2; const STAMP = '2020-04-27T12:17:17.721Z'; -const IP_ADDRESS = '11.11.11.11'; -const VERSION_ID = 5.6; +const IP_ADDRESS = '9.9.9.9'; +const VERSION_ID = 5.5; const CHANNEL = 9; const SESSION_ID = 'BlUSkYymTt'; const IS_LOGIN_FOR_DOCTOR_APP = true;