diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 6577d31e..eabd50fc 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -96,4 +96,21 @@ const Map> localizedValues = { 'en': 'You don\'t have any lab orders', 'ar': 'ليس لديك اي فحوصات طبية' }, + 'answerThePatient': {'en': 'answer the patient', 'ar': 'اجب المريض '}, + 'pleaseEnterAnswer': { + 'en': 'please enter answer', + 'ar': 'الرجاء ادخال اجابة ' + }, + 'replay': {'en': 'Replay', 'ar': 'تاكيد'}, + 'progressNote': {'en': 'Progress Note', 'ar': 'ملاحظة التقدم'}, + 'searchNote': {'en': 'Search Note', 'ar': 'بحث عن ملاحظة'}, + 'errorNoProgressNote': { + 'en': 'You don\'t have any Progress Note', + 'ar': 'ليس لديك اي ملاحظة تقدم ' + }, + 'invoiceNo:': {'en': 'Invoice No :', 'ar': 'رقم الفاتورة'}, + 'generalResult': {'en': 'General Result :', 'ar': 'النتيجة العامة'}, + 'description': {'en': 'Description', 'ar': 'الوصف'}, + 'value': {'en': 'Value', 'ar': 'القيمة'}, + 'range': {'en': 'range', 'ar': 'النطاق'}, }; diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 5a947f66..cb55582f 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -399,7 +399,7 @@ class _DashboardScreenState extends State { child: DashboardItemIconText( widget.iconURL + 'qr-code.svg', "", - "QR Reader", + TranslationBase.of(context).qrReader, showBorder: true, backgroundColor: Colors.white, valueFontColor: Colors.black, diff --git a/lib/screens/doctor/my_referral_patient_screen.dart b/lib/screens/doctor/my_referral_patient_screen.dart index 58c6e432..10b73d6b 100644 --- a/lib/screens/doctor/my_referral_patient_screen.dart +++ b/lib/screens/doctor/my_referral_patient_screen.dart @@ -17,7 +17,7 @@ class MyReferralPatient extends StatelessWidget { Widget build(BuildContext context) { referralPatientProvider = Provider.of(context); return AppScaffold( - appBarTitle: 'My Referral Patient', + appBarTitle: TranslationBase.of(context).myReferralPatient, body: referralPatientProvider.isLoading ? DrAppCircularProgressIndeicator() : referralPatientProvider.isError @@ -43,11 +43,12 @@ class MyReferralPatient extends StatelessWidget { children: [ SizedBox( height: 10, - ), Container( child: Column( - children: referralPatientProvider.listMyReferralPatientModel.map((item) { + children: referralPatientProvider + .listMyReferralPatientModel + .map((item) { return MyReferralPatientWidget( myReferralPatientModel: item, ); diff --git a/lib/screens/doctor/my_referred_patient_screen.dart b/lib/screens/doctor/my_referred_patient_screen.dart index e2220855..48c68c61 100644 --- a/lib/screens/doctor/my_referred_patient_screen.dart +++ b/lib/screens/doctor/my_referred_patient_screen.dart @@ -9,58 +9,59 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import '../../widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; class MyReferredPatient extends StatelessWidget { - MyReferredPatientProvider referredPatientProvider; @override Widget build(BuildContext context) { referredPatientProvider = Provider.of(context); return AppScaffold( - appBarTitle: 'My Referred Patient', + appBarTitle: TranslationBase.of(context).myReferredPatient, body: referredPatientProvider.isLoading ? DrAppCircularProgressIndeicator() : referredPatientProvider.isError - ? Center( - child: AppText( - referredPatientProvider.error, - color: Theme.of(context).errorColor, - ), - ) - - : referredPatientProvider.listMyReferredPatientModel.length == 0 - ? Center( - child: AppText( - TranslationBase.of(context).errorNoSchedule, - color: Theme.of(context).errorColor, - ), - ) - : Container( - padding: EdgeInsetsDirectional.fromSTEB(20, 0, 20, 0), - child: ListView( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 10, - ), - Container( - child: Column( - //children: referredPatientProvider.listMyReferralPatientModel.map((item) { - children: referredPatientProvider.listMyReferredPatientModel.map((item) { - return MyReferredPatientWidget( - myReferredPatientModel: item, - ); - }).toList(), + ? Center( + child: AppText( + referredPatientProvider.error, + color: Theme.of(context).errorColor, ), - ), - ], - ), - ], - ), - ), + ) + : referredPatientProvider.listMyReferredPatientModel.length == 0 + ? Center( + child: AppText( + TranslationBase.of(context).errorNoSchedule, + color: Theme.of(context).errorColor, + ), + ) + : Container( + padding: EdgeInsetsDirectional.fromSTEB(20, 0, 20, 0), + child: ListView( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10, + ), + Container( + child: Column( + //children: referredPatientProvider.listMyReferralPatientModel.map((item) { + children: referredPatientProvider + .listMyReferredPatientModel + .map((item) { + return MyReferredPatientWidget( + myReferredPatientModel: item, + ); + }).toList(), + ), + ), + ], + ), + ], + ), + ), ); } } diff --git a/lib/screens/patients/profile/lab_result/lab_result_secreen.dart b/lib/screens/patients/profile/lab_result/lab_result_secreen.dart index a8583d4a..54c9e30a 100644 --- a/lib/screens/patients/profile/lab_result/lab_result_secreen.dart +++ b/lib/screens/patients/profile/lab_result/lab_result_secreen.dart @@ -12,6 +12,7 @@ import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; class LabResult extends StatefulWidget { final LabOrdersResModel labOrders; @@ -40,13 +41,14 @@ class _LabResultState extends State { @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: "Lab Orders", + appBarTitle: TranslationBase.of(context).labOrders, body: patientsProv.isLoading ? DrAppCircularProgressIndeicator() : patientsProv.isError ? DrAppEmbeddedError(error: patientsProv.error) : patientsProv.labResultList.length == 0 - ? DrAppEmbeddedError(error: 'You don\'t have any Orders') + ? DrAppEmbeddedError( + error: TranslationBase.of(context).errorNoLabOrders) : Container( margin: EdgeInsets.fromLTRB( SizeConfig.realScreenWidth * 0.05, @@ -57,25 +59,25 @@ class _LabResultState extends State { children: [ CardWithBgWidgetNew( widget: Row( - mainAxisAlignment: - MainAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - ' Invoice No :', - fontSize: - 2 * SizeConfig.textMultiplier, + TranslationBase.of(context).invoiceNo, + fontSize: 2 * SizeConfig.textMultiplier, color: Colors.grey[800], ), AppText( ' ${widget.labOrders.invoiceNo}', - fontSize: - 2 * SizeConfig.textMultiplier, + fontSize: 2 * SizeConfig.textMultiplier, color: Colors.grey[800], ), ], ), ), - CardWithBgWidgetNew(widget: LabResultWidget(labResult: patientsProv.labResultList,)) + CardWithBgWidgetNew( + widget: LabResultWidget( + labResult: patientsProv.labResultList, + )) ], ), ), diff --git a/lib/screens/patients/profile/progress_note_screen.dart b/lib/screens/patients/profile/progress_note_screen.dart index f9d8be44..a2aea154 100644 --- a/lib/screens/patients/profile/progress_note_screen.dart +++ b/lib/screens/patients/profile/progress_note_screen.dart @@ -14,6 +14,7 @@ import '../../../util/dr_app_shared_pref.dart'; import '../../../widgets/shared/app_scaffold_widget.dart'; import '../../../widgets/shared/app_texts_widget.dart'; import '../../../widgets/shared/dr_app_circular_progress_Indeicator.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); @@ -75,14 +76,14 @@ class _ProgressNoteState extends State { @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: "Progress Note", + appBarTitle: TranslationBase.of(context).progressNote, body: patientsProv.isLoading ? DrAppCircularProgressIndeicator() : patientsProv.isError ? DrAppEmbeddedError(error: patientsProv.error) : notesList == null ? DrAppEmbeddedError( - error: 'You don\'t have any Progress Note') + error: TranslationBase.of(context).errorNoProgressNote) : Column( children: [ Container( @@ -93,8 +94,8 @@ class _ProgressNoteState extends State { onChanged: (String str) { this.searchData(str); }, - decoration: - buildInputDecoration(context, 'Search Note'), + decoration: buildInputDecoration(context, + TranslationBase.of(context).searchNote), ), ), Expanded( @@ -116,7 +117,8 @@ class _ProgressNoteState extends State { ExpansionTile( title: Container( child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ AppText( notesList[index] @@ -138,12 +140,12 @@ class _ProgressNoteState extends State { ), children: [ Divider( - color: Colors.black, - height: 20, - thickness: 1, - indent: 0, - endIndent: 0, - ), + color: Colors.black, + height: 20, + thickness: 1, + indent: 0, + endIndent: 0, + ), AppText( notesList[index]["Notes"], margin: 5, @@ -182,7 +184,7 @@ class _ProgressNoteState extends State { if (strExist) { filteredNotesList = null; - filteredNotesList = patientsProv.patientProgressNoteList + filteredNotesList = patientsProv.patientProgressNoteList .where((note) => note["DoctorName"].toString().contains(str.toUpperCase())) .toList(); diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index b9e63bf4..f99d615a 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -125,6 +125,22 @@ class TranslationBase { String get labOrders => localizedValues['labOrders'][locale.languageCode]; String get errorNoLabOrders => localizedValues['errorNoLabOrders'][locale.languageCode]; + String get answerThePatient => + localizedValues['answerThePatient'][locale.languageCode]; + String get pleaseEnterAnswer => + localizedValues['pleaseEnterAnswer'][locale.languageCode]; + String get replay => localizedValues['replay'][locale.languageCode]; + String get progressNote => + localizedValues['progressNote'][locale.languageCode]; + String get searchNote => localizedValues['searchNote'][locale.languageCode]; + String get errorNoProgressNote => + localizedValues['errorNoProgressNote'][locale.languageCode]; + String get invoiceNo => localizedValues['invoiceNo:'][locale.languageCode]; + String get generalResult => + localizedValues['generalResult'][locale.languageCode]; + String get description => localizedValues['description'][locale.languageCode]; + String get value => localizedValues['value'][locale.languageCode]; + String get range => localizedValues['range'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/doctor/lab_result_widget.dart b/lib/widgets/doctor/lab_result_widget.dart index 73cdba66..5ae4f901 100644 --- a/lib/widgets/doctor/lab_result_widget.dart +++ b/lib/widgets/doctor/lab_result_widget.dart @@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; class LabResultWidget extends StatefulWidget { final List labResult; @@ -30,7 +31,7 @@ class _LabResultWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - 'General Result', + TranslationBase.of(context).generalResult, fontSize: 2.5 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, ), @@ -57,23 +58,18 @@ class _LabResultWidgetState extends State { margin: EdgeInsets.only(top: 10), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(10)), - ), child: Column( children: widget.labResult.map((result) { return Container( decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(10)), + borderRadius: BorderRadius.all(Radius.circular(10)), border: Border( - bottom: BorderSide( - color: Colors.grey, width: 0.5), - top: BorderSide( - color: Colors.grey, width: 0.5), - left: BorderSide( - color: Colors.grey, width: 0.5), - right: BorderSide( - color: Colors.grey, width: 0.5), + bottom: + BorderSide(color: Colors.grey, width: 0.5), + top: BorderSide(color: Colors.grey, width: 0.5), + left: BorderSide(color: Colors.grey, width: 0.5), + right: BorderSide(color: Colors.grey, width: 0.5), ), ), margin: EdgeInsets.only(top: 10), @@ -92,7 +88,8 @@ class _LabResultWidgetState extends State { ), child: Center( child: Texts( - 'Description', + TranslationBase.of(context) + .description, color: Colors.white, ), ), @@ -103,7 +100,9 @@ class _LabResultWidgetState extends State { child: Container( color: Hexcolor('#515B5D'), child: Center( - child: Texts('Value', color: Colors.white), + child: Texts( + TranslationBase.of(context).value, + color: Colors.white), ), height: 60), ), @@ -116,7 +115,9 @@ class _LabResultWidgetState extends State { ), ), child: Center( - child: Texts('Range', color: Colors.white), + child: Texts( + TranslationBase.of(context).range, + color: Colors.white), ), height: 60), ), @@ -143,8 +144,7 @@ class _LabResultWidgetState extends State { Expanded( child: Container( child: Center( - child: Texts( - '${result.resultValue}', + child: Texts('${result.resultValue}', color: Colors.grey[800]), ), height: 60), diff --git a/lib/widgets/doctor/my_referral_patient_widget.dart b/lib/widgets/doctor/my_referral_patient_widget.dart index f30de7cb..7d35e389 100644 --- a/lib/widgets/doctor/my_referral_patient_widget.dart +++ b/lib/widgets/doctor/my_referral_patient_widget.dart @@ -11,6 +11,7 @@ import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; class MyReferralPatientWidget extends StatefulWidget { final MyReferralPatientModel myReferralPatientModel; @@ -31,7 +32,8 @@ class _MyReferralPatientWidgetState extends State { @override void initState() { - answerController = new TextEditingController(text: widget.myReferralPatientModel.referredDoctorRemarks ?? ''); + answerController = new TextEditingController( + text: widget.myReferralPatientModel.referredDoctorRemarks ?? ''); super.initState(); } @@ -59,260 +61,285 @@ class _MyReferralPatientWidgetState extends State { Icon(_showDetails ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down), - ], ), ), !_showDetails ? Container() : AnimatedContainer( - duration: Duration(milliseconds: 200), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox(height: 5,), - Divider(color: Color(0xFF000000),height: 0.5,), - Table( - border: TableBorder.symmetric(inside: BorderSide(width: 0.5),), - children: [ - TableRow( + duration: Duration(milliseconds: 200), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 5, + ), + Divider( + color: Color(0xFF000000), + height: 0.5, + ), + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 0.5), + ), children: [ - Container( - margin: EdgeInsets.all(2.5), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - 'File No', - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - SizedBox(height: 5,), - AppText( - '${widget.myReferralPatientModel.referringDoctor}', - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) - ], + TableRow(children: [ + Container( + margin: EdgeInsets.all(2.5), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).fileNo, + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + SizedBox( + height: 5, + ), + AppText( + '${widget.myReferralPatientModel.referringDoctor}', + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], + ), ), - ), - Container( - margin: EdgeInsets.only(left: 4,top: 2.5,right: 2.5,bottom: 2.5), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - 'Referring Doctor', - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - SizedBox(height: 5,), - AppText( - widget.myReferralPatientModel - .referringClinicDescription, - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) - ], + Container( + margin: EdgeInsets.only( + left: 4, top: 2.5, right: 2.5, bottom: 2.5), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .referralDoctor, + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + SizedBox( + height: 5, + ), + AppText( + widget.myReferralPatientModel + .referringClinicDescription, + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], + ), ), - ), - ] - ), - TableRow( - children: [ - Container( - margin: EdgeInsets.all(2.5), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - 'Referring Clinic', - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - SizedBox(height: 5,), - AppText( - '${widget.myReferralPatientModel.referringClinicDescription}', - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) - ], + ]), + TableRow(children: [ + Container( + margin: EdgeInsets.all(2.5), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .referringClinic, + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + SizedBox( + height: 5, + ), + AppText( + '${widget.myReferralPatientModel.referringClinicDescription}', + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], + ), ), - ), - Container( - margin: EdgeInsets.only(left: 4,top: 2.5,right: 2.5,bottom: 2.5), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - 'Frequency', - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, + Container( + margin: EdgeInsets.only( + left: 4, top: 2.5, right: 2.5, bottom: 2.5), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).frequency, + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + SizedBox( + height: 5, + ), + AppText( + widget.myReferralPatientModel + .frequencyDescription, + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], + ), + ) + ]), + TableRow( + children: [ + Container( + margin: EdgeInsets.all(2.5), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).priority, + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + SizedBox( + height: 5, + ), + AppText( + '${widget.myReferralPatientModel.priorityDescription}', + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], ), - SizedBox(height: 5,), - AppText( - widget.myReferralPatientModel - .frequencyDescription, - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) - ], - ), - ) - ] - ), - TableRow( - children: [ - Container( - margin: EdgeInsets.all(2.5), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - 'Priority', - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, ), - SizedBox(height: 5,), - AppText( - '${widget.myReferralPatientModel.priorityDescription}', - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, + Container( + margin: EdgeInsets.only( + left: 4, + top: 2.5, + right: 2.5, + bottom: 2.5), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .maxResponseTime, + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + SizedBox( + height: 5, + ), + AppText( + Helpers.getDateFormatted(widget + .myReferralPatientModel + .mAXResponseTime), + fontSize: + 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], + ), ) ], ), - ), - Container( - margin: EdgeInsets.only(left: 4,top: 2.5,right: 2.5,bottom: 2.5), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - 'Max Response Time', - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - SizedBox(height: 5,), - AppText( - Helpers.getDateFormatted(widget - .myReferralPatientModel - .mAXResponseTime), - fontSize: - 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) - ], + ], + ), + Divider( + color: Color(0xFF000000), + height: 0.5, + ), + SizedBox( + height: 5, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .clinicDetailsandRemarks, + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + textAlign: TextAlign.start, ), - ) - ], - ), - - ], - ), - Divider(color: Color(0xFF000000),height: 0.5,), - SizedBox( - height: 5, - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - 'Clinic Details and Remarks', - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - textAlign: TextAlign.start,), - Texts( - '${widget.myReferralPatientModel.referringDoctorRemarks}', - style: "bodyText1", - readMore: true, + Texts( + '${widget.myReferralPatientModel.referringDoctorRemarks}', + style: "bodyText1", + readMore: true, + textAlign: TextAlign.start, + maxLength: 100) + ], + ), + SizedBox( + height: 5, + ), + AppText( + TranslationBase.of(context).answerSuggestions, + fontSize: 1.7 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, textAlign: TextAlign.start, - maxLength: 100) - ], - ), - SizedBox( - height: 5, - ), - AppText( - 'Answer/Suggestions', - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - textAlign: TextAlign.start, - ), - SizedBox( - height: 5, - ), - Form( - key: _formKey, - child: TextFields( - maxLines: 2, - minLines: 2, - hintText: 'Answer the patient', - fontWeight: FontWeight.normal, - initialValue: widget.myReferralPatientModel.referredDoctorRemarks ?? '', - readOnly: _isLoading, - validator: (value) { - if (value.isEmpty) - return "please enter answer"; - else - return null; - }, - ), - ), - SizedBox(height: 10.0), - SizedBox(height: 10.0), - Container( - width: double.infinity, - margin: EdgeInsets.only(left: 10,right: 10), - child: Button( - onTap: () async { - final form = _formKey.currentState; - if (form.validate()) { - setState(() { - _isLoading = true; - }); - try { - await Provider.of(context, listen: false).replay(answerController.text.toString(), widget.myReferralPatientModel); - setState(() { - _isLoading = false; - }); - DrAppToastMsg.showSuccesToast('Reply Successfully'); - - } catch (e) { - setState(() { - _isLoading = false; - }); - DrAppToastMsg.showErrorToast(e); - } - } - }, - title: 'Reply', - loading: _isLoading, + ), + SizedBox( + height: 5, + ), + Form( + key: _formKey, + child: TextFields( + maxLines: 2, + minLines: 2, + hintText: + TranslationBase.of(context).answerThePatient, + fontWeight: FontWeight.normal, + initialValue: widget.myReferralPatientModel + .referredDoctorRemarks ?? + '', + readOnly: _isLoading, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of(context) + .pleaseEnterAnswer; + else + return null; + }, + ), + ), + SizedBox(height: 10.0), + SizedBox(height: 10.0), + Container( + width: double.infinity, + margin: EdgeInsets.only(left: 10, right: 10), + child: Button( + onTap: () async { + final form = _formKey.currentState; + if (form.validate()) { + setState(() { + _isLoading = true; + }); + try { + await Provider.of( + context, + listen: false) + .replay(answerController.text.toString(), + widget.myReferralPatientModel); + setState(() { + _isLoading = false; + }); + DrAppToastMsg.showSuccesToast( + 'Reply Successfully'); + } catch (e) { + setState(() { + _isLoading = false; + }); + DrAppToastMsg.showErrorToast(e); + } + } + }, + title: TranslationBase.of(context).replay, + loading: _isLoading, + ), + ) + ], ), ) - ], - ), - ) ], ), ),