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,