diff --git a/android/settings_aar.gradle b/android/settings_aar.gradle new file mode 100644 index 00000000..e7b4def4 --- /dev/null +++ b/android/settings_aar.gradle @@ -0,0 +1 @@ +include ':app' diff --git a/lib/config/config.dart b/lib/config/config.dart index d5086b5b..0f1db566 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -299,6 +299,9 @@ const GENERAL_ID = 'Cs2020@2016\$2958'; const PATIENT_TYPE = 1; const PATIENT_TYPE_ID = 1; + +const Color IN_PROGRESS_COLOR = Color(0xFFCC9B14); + /// Timer Info const TIMER_MIN = 10; diff --git a/lib/screens/doctor/doctor_repaly_chat.dart b/lib/screens/doctor/doctor_repaly_chat.dart index 935dbf7c..24487964 100644 --- a/lib/screens/doctor/doctor_repaly_chat.dart +++ b/lib/screens/doctor/doctor_repaly_chat.dart @@ -10,6 +10,7 @@ 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_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:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -17,19 +18,31 @@ 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 { +class DoctorReplayChat extends StatefulWidget { final ListGtMyPatientsQuestions reply; - TextEditingController msgController = TextEditingController(); final DoctorReplayViewModel previousModel; + bool showMsgBox = false; DoctorReplayChat( {Key key, this.reply, this.previousModel, }); + @override + _DoctorReplayChatState createState() => _DoctorReplayChatState(); +} + +class _DoctorReplayChatState extends State { + TextEditingController msgController = TextEditingController(); + + @override Widget build(BuildContext context) { - if(reply.doctorResponse.isNotEmpty){ - msgController.text = reply.doctorResponse; + if(widget.reply.doctorResponse.isNotEmpty){ + msgController.text = widget.reply.doctorResponse; + + } else { + widget.showMsgBox = true; + } return BaseView( onModelReady: (model) async { @@ -72,7 +85,7 @@ class DoctorReplayChat extends StatelessWidget { color: Colors.black), children: [ new TextSpan( - text: reply.patientName + text: widget.reply.patientName .toString(), style: TextStyle( color: Color(0xFF2B353E), @@ -135,7 +148,7 @@ class DoctorReplayChat extends StatelessWidget { width: 50, height: 50, child: Image.asset( - reply.gender == 1 + widget.reply.gender == 1 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, @@ -146,7 +159,7 @@ class DoctorReplayChat extends StatelessWidget { Container( width: MediaQuery.of(context).size.width * 0.31, child: AppText( - reply.patientName + widget.reply.patientName .toString(), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontFamily: 'Poppins', @@ -159,7 +172,7 @@ class DoctorReplayChat extends StatelessWidget { margin: EdgeInsets.symmetric(horizontal: 0), child: InkWell( onTap: () { - launch("tel://" +reply.mobileNumber); + launch("tel://" +widget.reply.mobileNumber); }, child: Icon( Icons.phone, @@ -174,14 +187,14 @@ class DoctorReplayChat extends StatelessWidget { children: [ AppText( - reply.createdOn !=null?AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(reply.createdOn)):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), + widget.reply.createdOn !=null?AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn)):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), fontWeight: FontWeight .w500, color: Colors.white, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8, ), AppText( - reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(reply.createdOn)):AppDateUtils.getHour(DateTime.now()), + widget.reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn)):AppDateUtils.getHour(DateTime.now()), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8, fontFamily: 'Poppins', color: Colors.white, @@ -205,7 +218,7 @@ class DoctorReplayChat extends StatelessWidget { child: Container( width: MediaQuery.of(context).size.width * 0.7, child: AppText( - reply.remarks, + widget.reply.remarks, fontSize: 15, fontFamily: 'Poppins', color: Colors.white, @@ -223,7 +236,7 @@ class DoctorReplayChat extends StatelessWidget { SizedBox(height: 30,), SizedBox(height: 30,), - if(reply.doctorResponse != null && reply.doctorResponse.isNotEmpty) + if(widget.reply.doctorResponse != null && widget.reply.doctorResponse.isNotEmpty) Align( alignment: Alignment.centerRight, child: Container( @@ -256,7 +269,7 @@ class DoctorReplayChat extends StatelessWidget { width: 50, height: 50, child: Image.asset( - previousModel.doctorProfile.gender == 0 + widget.previousModel.doctorProfile.gender == 0 ? 'assets/images/male_avatar.png' : 'assets/images/female_avatar.png', fit: BoxFit.cover, @@ -267,7 +280,7 @@ class DoctorReplayChat extends StatelessWidget { Container( width: MediaQuery.of(context).size.width * 0.35, child: AppText( - previousModel.doctorProfile.doctorName, + widget.previousModel.doctorProfile.doctorName, fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *3, fontFamily: 'Poppins', color: Color(0xFF2B353E), @@ -282,14 +295,14 @@ class DoctorReplayChat extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.end, children: [ AppText( - reply.createdOn !=null?AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(reply.createdOn)):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), + widget.reply.createdOn !=null?AppDateUtils.getDayMonthYearDateFormatted(AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn)):AppDateUtils.getDayMonthYearDateFormatted(DateTime.now()), fontWeight: FontWeight .w500, color: Color(0xFF2B353E), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8, ), AppText( - reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(reply.createdOn)):AppDateUtils.getHour(DateTime.now()), + widget.reply.createdOn !=null?AppDateUtils.getHour(AppDateUtils.getDateTimeFromServerFormat(widget.reply.createdOn)):AppDateUtils.getHour(DateTime.now()), fontSize: SizeConfig.getTextMultiplierBasedOnWidth() *2.8, fontFamily: 'Poppins', color: Color(0xFF2B353E), @@ -313,7 +326,7 @@ class DoctorReplayChat extends StatelessWidget { child: Container( width: MediaQuery.of(context).size.width * 0.7, child: AppText( - reply.doctorResponse, + widget.reply.doctorResponse, fontSize: 15, fontFamily: 'Poppins', color: Color(0xFF2B353E), @@ -338,9 +351,39 @@ class DoctorReplayChat extends StatelessWidget { ), ), + + Positioned( - bottom: 0, - child: Container( + bottom: !widget.showMsgBox?80:0, + left: !widget.showMsgBox?20:0, + child: !widget.showMsgBox? Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText("You already replied to this question."), + SizedBox(height: 10,), + Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + SizedBox(width: 20,), + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Center( + child: AppButton( + fontWeight: FontWeight.w700, + color: Colors.green[600], + title: "Update Your Answer", //TranslationBase.of(context).close, + onPressed: () { + setState(() { + widget.showMsgBox = true; + }); + }, + ), + ), + ), + ], + ) + ], + ):Container( width:MediaQuery.of(context).size.width * 1, height: MediaQuery.of(context).size.height * 0.12, child: Column( @@ -365,21 +408,16 @@ class DoctorReplayChat extends StatelessWidget { return; } else { GifLoaderDialogUtils.showMyDialog(context); - await previousModel.createDoctorResponse(msgController.text, reply); - if(previousModel.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(previousModel.error); + await widget.previousModel.createDoctorResponse(msgController.text, widget.reply); + if(widget.previousModel.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(widget.previousModel.error); } else { DrAppToastMsg.showSuccesToast("Thank you for your replay "); - await previousModel.getDoctorReply(isLocalBusy: false); + await widget.previousModel.getDoctorReply(isLocalBusy: false); Navigator.pop(context); } GifLoaderDialogUtils.hideDialog(context); } - - - - - }, // hintColor: Colors.black, fontWeight: FontWeight.w500, diff --git a/lib/widgets/doctor/doctor_reply_widget.dart b/lib/widgets/doctor/doctor_reply_widget.dart index 7817ba3c..f39994d2 100644 --- a/lib/widgets/doctor/doctor_reply_widget.dart +++ b/lib/widgets/doctor/doctor_reply_widget.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; @@ -30,9 +31,9 @@ class _DoctorReplyWidgetState extends State { return Container( child: CardWithBgWidget( bgColor: - widget.reply.status == 2 - ? Color(0xFF2E303A) - : Color(0xFFD02127), + widget.reply.infoStatus == 4 + ? IN_PROGRESS_COLOR + : widget.reply.infoStatus == 3 ?Color(0xFFD02127): Colors.green[600], hasBorder: false, widget: Container( // padding: EdgeInsets.only(left: 20, right: 0, bottom: 0), @@ -50,11 +51,11 @@ class _DoctorReplyWidgetState extends State { color: Colors.black), children: [ new TextSpan( - text: widget.reply.status==2 ? "Active":widget.reply.status==1?"Hold":"Cancelled",//TranslationBase.of(context).replied :TranslationBase.of(context).unReplied , + text: widget.reply.infoDesc,//widget.reply.status==2 ? "Active":widget.reply.status==1?"Hold":"Cancelled",//TranslationBase.of(context).replied :TranslationBase.of(context).unReplied , style: TextStyle( - color: widget.reply.status == 2 - ? Color(0xFF2E303A) - : Color(0xFFD02127), + color: widget.reply.infoStatus == 4 + ? IN_PROGRESS_COLOR + : widget.reply.infoStatus == 3 ?Color(0xFFD02127): Colors.green[600], fontWeight: FontWeight.w700, fontFamily: 'Poppins',