From f945861e1b90054bc8254907727a862a3550b3cd Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 15 Apr 2021 15:34:48 +0300 Subject: [PATCH] add doctor replay --- lib/screens/doctor/doctor_repaly_chat.dart | 64 ++++----------------- lib/screens/doctor/doctor_reply_screen.dart | 2 +- 2 files changed, 11 insertions(+), 55 deletions(-) diff --git a/lib/screens/doctor/doctor_repaly_chat.dart b/lib/screens/doctor/doctor_repaly_chat.dart index 5a8b9a53..be5e8aea 100644 --- a/lib/screens/doctor/doctor_repaly_chat.dart +++ b/lib/screens/doctor/doctor_repaly_chat.dart @@ -23,9 +23,9 @@ class DoctorReplayChat extends StatelessWidget { final ListGtMyPatientsQuestions reply; TextEditingController msgController = TextEditingController(); - + final DoctorReplayViewModel previousModel; DoctorReplayChat( - {Key key, this.reply, + {Key key, this.reply, this.previousModel, }); @override @@ -337,13 +337,14 @@ class DoctorReplayChat extends StatelessWidget { children: [ FractionallySizedBox( child: Container( + child: TextFields( borderRadius: 0, - hasLabelText: msgController.text != '' - ? true - : false, - showLabelText: false, - hintText: "\n"+TranslationBase + // hasLabelText: msgController.text != '' + // ? true + // : false, + // showLabelText: false, + hintText: TranslationBase .of(context) .typeHereToReply, fontSize: 13.5, @@ -356,12 +357,9 @@ class DoctorReplayChat extends StatelessWidget { helpers.showErrorToast("An error happened while you are replaying"); } else { DrAppToastMsg.showSuccesToast("Thank you for your replay "); + await previousModel.getDoctorReply(); + Navigator.pop(context); - Navigator.push( - context, - MaterialPageRoute( - builder: (BuildContext context) => - DoctorReplyScreen())); } @@ -392,48 +390,6 @@ class DoctorReplayChat extends StatelessWidget { ), ), - // bottomSheet: Container( - // 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, - // onSuffixTap: (){ - // model.replay(msgController.text, reply); - // }, - // // 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 c9b9b478..51bc2652 100644 --- a/lib/screens/doctor/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_reply_screen.dart @@ -44,7 +44,7 @@ class DoctorReplyScreen extends StatelessWidget { context, MaterialPageRoute( builder: (BuildContext context) => - DoctorReplayChat(reply: reply))); + DoctorReplayChat(reply: reply, previousModel: model,))); }, child: DoctorReplyWidget(reply: reply), );