diff --git a/lib/screens/patients/profile/note/update_note.dart b/lib/screens/patients/profile/note/update_note.dart index b8f6a174..9585e115 100644 --- a/lib/screens/patients/profile/note/update_note.dart +++ b/lib/screens/patients/profile/note/update_note.dart @@ -20,6 +20,7 @@ import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils import 'package:doctor_app_flutter/widgets/shared/speech-text-popup.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:flutter/material.dart'; +import 'package:permission_handler/permission_handler.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; @@ -57,6 +58,12 @@ class _UpdateNoteOrderState extends State { }); } + @override + void initState() { + requestPermissions(); + super.initState(); + } + @override Widget build(BuildContext context) { if (widget.note != null) { @@ -225,6 +232,12 @@ class _UpdateNoteOrderState extends State { reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; } + void requestPermissions() async { + Map statuses = await [ + Permission.microphone, + ].request(); + } + void resultListener(result) { reconizedWord = result.recognizedWords; event.setValue({"searchText": reconizedWord}); diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index 822cffb9..7aeffca4 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -114,131 +114,140 @@ class AddSickLeavScreen extends StatelessWidget { children: model.getAllSIckLeave .map((GetAllSickLeaveResponse item) { return RoundedContainer( + margin: EdgeInsets.all(10), child: Column( - children: [ - Container( - decoration: BoxDecoration( - border: Border( - left: BorderSide( - color: item.status == 1 - ? Colors.yellow[800] - : item.status == 2 - ? Colors.green - : Colors.black, - width: 5.0, - ))), - padding: EdgeInsets.all(10), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Expanded( - flex: 4, - child: Wrap( - // mainAxisAlignment: - // MainAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.start, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + left: BorderSide( + color: item.status == 1 + ? Colors.yellow[800] + : item.status == 2 + ? Colors.green + : Colors.black, + width: 5.0, + ))), + padding: EdgeInsets.all(10), + child: Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Expanded( + flex: 4, + child: Wrap( + // mainAxisAlignment: + // MainAxisAlignment.start, children: [ - Container( - padding: EdgeInsets.all(3), - child: AppText( - item.status == 1 - ? TranslationBase.of( - context) - .hold - : item.status == 2 + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.all(3), + child: AppText( + item.status == 1 ? TranslationBase.of( context) - .active - : TranslationBase.of( + .hold + : item.status == 2 + ? TranslationBase + .of( + context) + .active + : TranslationBase + .of(context) + .all, + fontWeight: + FontWeight.bold, + color: item.status == 1 + ? Colors.yellow[800] + : item.status == 2 + ? Colors.green + : Colors.black, + ), + ), + Row( + children: [ + AppText( + TranslationBase.of( context) - .all, - fontWeight: FontWeight.bold, - color: item.status == 1 - ? Colors.yellow[800] - : item.status == 2 - ? Colors.green - : Colors.black, - ), - ), - Row( - children: [ - AppText(TranslationBase.of( - context) - .daysSickleave), - AppText( - item.noOfDays.toString(), - fontWeight: FontWeight.bold, + .daysSickleave), + AppText( + item.noOfDays + .toString(), + fontWeight: + FontWeight.bold, + ), + ], ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context) - .startDate + - ' ', + Row( + children: [ + AppText( + TranslationBase.of( + context) + .startDate + + ' ', + ), + Flexible( + child: AppText( + DateUtils + .convertStringToDateFormat( + item.startDate, + 'dd-MMM-yyyy'), + fontWeight: + FontWeight.bold, + )) + ], ), - Flexible( - child: AppText( - DateUtils - .convertStringToDateFormat( - item.startDate, - 'dd-MMM-yyyy'), - fontWeight: FontWeight.bold, - )) + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + AppText( + item.remarks ?? "", + ), + // (item.status == 1 || + // item.status == 2) + // ? IconButton( + // icon: Image.asset( + // 'assets/images/edit.png'), + // + // // color: Colors.green, //Colors.black, + // onPressed: () => { + // if (item.status == + // 1) + // { + // DrAppToastMsg.showErrorToast( + // TranslationBase.of( + // context) + // .sickleaveonhold) + // } + // else + // { + // openSickLeave( + // context, + // true, + // extendedData: + // item) + // } + // }, + // ) + // : SizedBox() + ]), ], ), - Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - AppText( - item.remarks ?? "", - ), - // (item.status == 1 || - // item.status == 2) - // ? IconButton( - // icon: Image.asset( - // 'assets/images/edit.png'), - // - // // color: Colors.green, //Colors.black, - // onPressed: () => { - // if (item.status == - // 1) - // { - // DrAppToastMsg.showErrorToast( - // TranslationBase.of( - // context) - // .sickleaveonhold) - // } - // else - // { - // openSickLeave( - // context, - // true, - // extendedData: - // item) - // } - // }, - // ) - // : SizedBox() - ]), + SizedBox( + width: 20, + ), ], ), - SizedBox( - width: 20, - ), - ], - ), - ), - ], - )), - ], - )); + ), + ], + )), + ], + )); }).toList(), ) : patient.patientStatusType != 43 diff --git a/lib/screens/sick-leave/show-sickleave.dart b/lib/screens/sick-leave/show-sickleave.dart index 895745c3..aac4eaa8 100644 --- a/lib/screens/sick-leave/show-sickleave.dart +++ b/lib/screens/sick-leave/show-sickleave.dart @@ -43,130 +43,139 @@ class ShowSickLeaveScreen extends StatelessWidget { children: model.getAllSIckLeave .map((GetAllSickLeaveResponse item) { return RoundedContainer( + margin: EdgeInsets.all(10), child: Column( - children: [ - Container( - decoration: BoxDecoration( - border: Border( - left: BorderSide( - color: item.status == 1 - ? Colors.yellow[800] - : item.status == 2 - ? Colors.green - : Colors.black, - width: 5.0, - ))), - padding: EdgeInsets.all(10), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Expanded( - flex: 4, - child: Wrap( - // mainAxisAlignment: - // MainAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.start, + children: [ + Container( + decoration: BoxDecoration( + border: Border( + left: BorderSide( + color: item.status == 1 + ? Colors.yellow[800] + : item.status == 2 + ? Colors.green + : Colors.black, + width: 5.0, + ))), + padding: EdgeInsets.all(10), + child: Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Expanded( + flex: 4, + child: Wrap( + // mainAxisAlignment: + // MainAxisAlignment.start, children: [ - Container( - padding: EdgeInsets.all(3), - child: AppText( - item.status == 1 - ? TranslationBase.of( - context) - .hold - : item.status == 2 + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.all(3), + child: AppText( + item.status == 1 ? TranslationBase.of( context) - .active - : TranslationBase.of( + .hold + : item.status == 2 + ? TranslationBase + .of( + context) + .active + : TranslationBase + .of(context) + .all, + fontWeight: + FontWeight.bold, + color: item.status == 1 + ? Colors.yellow[800] + : item.status == 2 + ? Colors.green + : Colors.black, + ), + ), + Row( + children: [ + AppText( + TranslationBase.of( context) - .all, - fontWeight: FontWeight.bold, - color: item.status == 1 - ? Colors.yellow[800] - : item.status == 2 - ? Colors.green - : Colors.black, - ), - ), - Row( - children: [ - AppText(TranslationBase.of( - context) - .daysSickleave), - AppText( - item.noOfDays.toString(), - fontWeight: FontWeight.bold, + .daysSickleave), + AppText( + item.noOfDays + .toString(), + fontWeight: + FontWeight.bold, + ), + ], ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context) - .startDate + - ' ', + Row( + children: [ + AppText( + TranslationBase.of( + context) + .startDate + + ' ', + ), + Flexible( + child: AppText( + DateUtils + .convertStringToDateFormat( + item.startDate, + 'dd-MMM-yyyy'), + fontWeight: + FontWeight.bold, + )) + ], ), - Flexible( - child: AppText( - DateUtils - .convertStringToDateFormat( - item.startDate, - 'dd-MMM-yyyy'), - fontWeight: FontWeight.bold, - )) + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + AppText( + item.remarks ?? "", + ), + (item.status == 1) + ? IconButton( + icon: Image.asset( + 'assets/images/edit.png'), + + // color: Colors.green, //Colors.black, + onPressed: () => + { + if (item.status == + 1) + { + DrAppToastMsg.showErrorToast( + TranslationBase.of(context) + .sickleaveonhold) + } + // else + // { + // openSickLeave( + // context, + // true, + // extendedData: + // item) + // } + }, + ) + : SizedBox() + ]), ], ), - Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - AppText( - item.remarks ?? "", - ), - (item.status == 1) - ? IconButton( - icon: Image.asset( - 'assets/images/edit.png'), - - // color: Colors.green, //Colors.black, - onPressed: () => { - if (item.status == - 1) - { - DrAppToastMsg.showErrorToast( - TranslationBase.of( - context) - .sickleaveonhold) - } - // else - // { - // openSickLeave( - // context, - // true, - // extendedData: - // item) - // } - }, - ) - : SizedBox() - ]), + SizedBox( + width: 20, + ), ], ), - SizedBox( - width: 20, - ), - ], - ), - ), - ], - )), - ], - )); + ), + ], + )), + ], + )); }).toList(), ) : Center( diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index 3c24f2d0..15229eca 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -267,19 +267,19 @@ class PatientCard extends StatelessWidget { fontWeight: FontWeight.w700, fontSize: 15)), ]))), - - Row( - children: [ - AppText( - "${TranslationBase.of(context).numOfDays}: ", - fontSize: 15, - ), - AppText( - "${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", + if (isInpatient == true) + Row( + children: [ + AppText( + "${TranslationBase.of(context).numOfDays}: ", fontSize: 15, - fontWeight: FontWeight.w700), - ], - ), + ), + AppText( + "${DateTime.now().difference(DateUtils.getDateTimeFromServerFormat(patientInfo.admissionDate)).inDays + 1}", + fontSize: 15, + fontWeight: FontWeight.w700), + ], + ), // Container( // child: Row( // crossAxisAlignment: CrossAxisAlignment.start,