diff --git a/lib/screens/doctor/doctor_replay/all_doctor_questions.dart b/lib/screens/doctor/doctor_replay/all_doctor_questions.dart index 428a6f1c..5166d2b1 100644 --- a/lib/screens/doctor/doctor_replay/all_doctor_questions.dart +++ b/lib/screens/doctor/doctor_replay/all_doctor_questions.dart @@ -29,71 +29,65 @@ class _AllDoctorQuestionsState extends State { onModelReady: (model) { model.getDoctorReply(isLocalBusy: false); }, - builder: (_, model, w) => WillPopScope( - onWillPop: () async { - widget.changeCurrentTab(); - return false; - }, - child: AppScaffold( - baseViewModel: model, - appBarTitle: TranslationBase.of(context).replay2, - isShowAppBar: false, - body: model.listDoctorWorkingHoursTable.isEmpty - ?ErrorMessage(error: TranslationBase.of(context).noItem)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem) - : Column( - children: [ - Expanded( - child: Container( - padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), - child: NotificationListener( - child: ListView.builder( - scrollDirection: Axis.vertical, - itemCount: model.listDoctorWorkingHoursTable.length, - shrinkWrap: true, - itemBuilder: (BuildContext ctxt, int index) { - return Column( - children: [ - InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (BuildContext context) => - DoctorReplayChat( - reply: - model.listDoctorWorkingHoursTable[ - index], - previousModel: model, - ), - settings: RouteSettings( - name: 'DoctorReplayChat'), - )); - }, - child: DoctorReplyWidget( - reply: model - .listDoctorWorkingHoursTable[index]), - ), - if(model.state == ViewState.BusyLocal && index == model.listDoctorWorkingHoursTable.length-1) - DrAppCircularProgressIndeicator() + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).replay2, + isShowAppBar: false, + body: model.listDoctorWorkingHoursTable.isEmpty + ?ErrorMessage(error: TranslationBase.of(context).noItem)// DrAppEmbeddedError(error: TranslationBase.of(context).noItem) + : Column( + children: [ + Expanded( + child: Container( + padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), + child: NotificationListener( + child: ListView.builder( + scrollDirection: Axis.vertical, + itemCount: model.listDoctorWorkingHoursTable.length, + shrinkWrap: true, + itemBuilder: (BuildContext ctxt, int index) { + return Column( + children: [ + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => + DoctorReplayChat( + reply: + model.listDoctorWorkingHoursTable[ + index], + previousModel: model, + ), + settings: RouteSettings( + name: 'DoctorReplayChat'), + )); + }, + child: DoctorReplyWidget( + reply: model + .listDoctorWorkingHoursTable[index]), + ), + if(model.state == ViewState.BusyLocal && index == model.listDoctorWorkingHoursTable.length-1) + DrAppCircularProgressIndeicator() - ], - ); - }), - onNotification: (t) { - if (t is ScrollUpdateNotification && t.metrics.pixels >= t.metrics.maxScrollExtent - 50 && - model.state != ViewState.BusyLocal) { - setState(() { - pageIndex++; - }); - model.getDoctorReply(pageIndex: pageIndex); - } - return; - }, - ), + ], + ); + }), + onNotification: (t) { + if (t is ScrollUpdateNotification && t.metrics.pixels >= t.metrics.maxScrollExtent - 50 && + model.state != ViewState.BusyLocal) { + setState(() { + pageIndex++; + }); + model.getDoctorReply(pageIndex: pageIndex); + } + return; + }, ), ), - ], - ), + ), + ], ), ), ); diff --git a/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart b/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart index f2e53275..69bb9ab2 100644 --- a/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart +++ b/lib/screens/doctor/doctor_replay/doctor_reply_widget.dart @@ -202,9 +202,11 @@ class _DoctorReplyWidgetState extends State { CustomRow( label: TranslationBase.of(context).fileNumber, value: widget.reply.patientID.toString(), + isCopyable:false, ), CustomRow( label: TranslationBase.of(context).age + " : ", + isCopyable:false, value: "${AppDateUtils.getAgeByBirthday(widget.reply.dateofBirth, context)}", ), diff --git a/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart b/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart index 0a1b05c3..5b21809f 100644 --- a/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart +++ b/lib/screens/doctor/doctor_replay/not_replaied_doctor_questions.dart @@ -31,79 +31,73 @@ class _NotRepliedDoctorQuestionsState extends State { onModelReady: (model) { model.getDoctorReply(isLocalBusy: false, isGettingNotReply: true); }, - builder: (_, model, w) => WillPopScope( - onWillPop: () async { - widget.changeCurrentTab(); - return false; - }, - child: AppScaffold( - baseViewModel: model, - appBarTitle: TranslationBase.of(context).replay2, - isShowAppBar: false, - body: model.listDoctorNotRepliedQuestions.isEmpty - ? ErrorMessage(error: TranslationBase.of(context).noItem) - : Column( - children: [ - Expanded( - child: Container( - padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), - child: NotificationListener( - child: ListView.builder( - scrollDirection: Axis.vertical, - itemCount: - model.listDoctorNotRepliedQuestions.length, - shrinkWrap: true, - itemBuilder: (BuildContext ctxt, int index) { - return Column( - children: [ - InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (BuildContext context) => - DoctorReplayChat( - reply: model - .listDoctorNotRepliedQuestions[ - index], - previousModel: model, - ), - settings: RouteSettings( - name: 'DoctorReplayChat'), - )); - }, - child: DoctorReplyWidget( - reply: - model.listDoctorNotRepliedQuestions[ - index]), - ), - if (model.state == ViewState.BusyLocal && - index == - model.listDoctorNotRepliedQuestions - .length - - 1) - DrAppCircularProgressIndeicator() - ], - ); - }), - onNotification: (t) { - if (t is ScrollUpdateNotification && - t.metrics.pixels >= - t.metrics.maxScrollExtent - 50 && - model.state != ViewState.BusyLocal) { - setState(() { - pageIndex++; - }); - model.getDoctorReply(pageIndex: pageIndex, isGettingNotReply: true); - } - return; - }, - ), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).replay2, + isShowAppBar: false, + body: model.listDoctorNotRepliedQuestions.isEmpty + ? ErrorMessage(error: TranslationBase.of(context).noItem) + : Column( + children: [ + Expanded( + child: Container( + padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), + child: NotificationListener( + child: ListView.builder( + scrollDirection: Axis.vertical, + itemCount: + model.listDoctorNotRepliedQuestions.length, + shrinkWrap: true, + itemBuilder: (BuildContext ctxt, int index) { + return Column( + children: [ + InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (BuildContext context) => + DoctorReplayChat( + reply: model + .listDoctorNotRepliedQuestions[ + index], + previousModel: model, + ), + settings: RouteSettings( + name: 'DoctorReplayChat'), + )); + }, + child: DoctorReplyWidget( + reply: + model.listDoctorNotRepliedQuestions[ + index]), + ), + if (model.state == ViewState.BusyLocal && + index == + model.listDoctorNotRepliedQuestions + .length - + 1) + DrAppCircularProgressIndeicator() + ], + ); + }), + onNotification: (t) { + if (t is ScrollUpdateNotification && + t.metrics.pixels >= + t.metrics.maxScrollExtent - 50 && + model.state != ViewState.BusyLocal) { + setState(() { + pageIndex++; + }); + model.getDoctorReply(pageIndex: pageIndex, isGettingNotReply: true); + } + return; + }, ), ), - ], - ), - ), + ), + ], + ), ), ); } diff --git a/lib/widgets/shared/user-guid/CusomRow.dart b/lib/widgets/shared/user-guid/CusomRow.dart index 3768d34e..b66d4926 100644 --- a/lib/widgets/shared/user-guid/CusomRow.dart +++ b/lib/widgets/shared/user-guid/CusomRow.dart @@ -7,7 +7,7 @@ class CustomRow extends StatelessWidget { const CustomRow({ Key key, this.label, - this.value, this.labelSize, this.valueSize, this.width, + this.value, this.labelSize, this.valueSize, this.width, this.isCopyable= true, }) : super(key: key); final String label; @@ -15,6 +15,7 @@ class CustomRow extends StatelessWidget { final double labelSize; final double valueSize; final double width; + final bool isCopyable; @override Widget build(BuildContext context) { @@ -35,7 +36,7 @@ class CustomRow extends StatelessWidget { fontSize: valueSize??SizeConfig.getTextMultiplierBasedOnWidth() * 3, color: Color(0xFF2E303A), fontWeight: FontWeight.w700, - isCopyable: true, + isCopyable: isCopyable, ), ], );