From e347a35d108c48d2bf75e557321098872b36fe2e Mon Sep 17 00:00:00 2001 From: "taha.alam" Date: Tue, 29 Oct 2024 10:54:10 +0300 Subject: [PATCH 1/2] WD:pharmacy intervention approval ui addition --- lib/config/localized_values.dart | 7 + lib/screens/home/home_patient_card.dart | 6 +- lib/screens/home/home_screen.dart | 25 ++ .../patient_search/patient_search_header.dart | 21 +- .../PharmacyIntervention.dart | 309 ++++++++++++++++++ .../translations_delegate_base_utils.dart | 6 + 6 files changed, 369 insertions(+), 5 deletions(-) create mode 100644 lib/screens/pharmaacy_intervention/PharmacyIntervention.dart diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index c31788f9..a96a0258 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -64,6 +64,10 @@ const Map> localizedValues = { "en": "Search\nMedicines", "ar": "بحث\nعن الدواء" }, + "interventionPharmacyApproval": { + "en": "Intervention\nPharmacy Approval", + "ar": "التدخل\nموافقة الصيدلية" + }, "searchMedicine": {"en": "Search Medicines", "ar": "بحث عن الدواء"}, "myReferralPatient": {"en": "My Referral Patient", "ar": "مرضى الاحالة"}, "referPatient": {"en": "Referral Patient", "ar": "إحالة مريض"}, @@ -300,6 +304,7 @@ const Map> localizedValues = { "dateTime": {"en": "DATE / TIME:", "ar": "التاريخ / الوقت:"}, "date": {"en": "Date", "ar": "التاريخ"}, "admissionNo": {"en": "ADMISSION #: ", "ar": "قبول #:"}, + "admissionNumber": {"en": "Admission No.", "ar": "رقم القبول"}, "losNo": {"en": "LOS #:", "ar": "LOS #:"}, "area": {"en": "AREA:", "ar": "المنطقة"}, "room": {"en": "ROOM:", "ar": "الغرفة"}, @@ -1154,12 +1159,14 @@ const Map> localizedValues = { "doctorSchedule": {"en": "Doctor Schedule", "ar":"جدول الطبيب"}, "doctorRota": {"en": "Doctor Rota", "ar":"دوران الطبيب"}, "dateFrom": {"en": "Date From", "ar":"التاريخ من"}, + "dateTo": {"en": "Date To", "ar":"التاريخ إلى"}, "searchFindSchedule": {"en": "Search and find out the doctor’s schedule ", "ar":"بحث ومعرفة جدول الطبيب"}, "onePrimaryDiagnosis": {"en": "There has to be at-least 1 principal diagnosis", "ar":"يجب أن يكون هناك تشخيص رئيسي واحد على الأقل"}, "principalDiagnosisCannot": {"en": "Principal Diagnosis cannot modify once the order created", "ar":"لا يمكن تعديل التشخيص الرئيسي بمجرد إنشاء الطلب"}, "afterOrderCreation": {"en": "After order created, you cannot modify the principal diagnosis, Do you want to continue?", "ar":"بعد إنشاء الطلب، لا يمكنك تعديل التشخيص الأساسي، هل تريد المتابعة؟"}, "principalCoveredOrNot": {"en": "Principal Diagnosis is not covered for this patient", "ar":"لا يتم تغطية التشخيص الرئيسي لهذا المريض"}, "complexDiagnosis": {"en": "Complex Diagnosis", "ar":"التشخيص المعقد"}, + "pharmacyInterventionApproval": {"en": "Pharmacy Intervention Approval", "ar":"الموافقة على التدخل الصيدلي"}, diff --git a/lib/screens/home/home_patient_card.dart b/lib/screens/home/home_patient_card.dart index d2050b7e..f5c502a6 100644 --- a/lib/screens/home/home_patient_card.dart +++ b/lib/screens/home/home_patient_card.dart @@ -13,6 +13,7 @@ class HomePatientCard extends StatelessWidget { final VoidCallback? onTap; final double? iconSize; final LinearGradient? gradient; + final double? fontSize; HomePatientCard({ this.backgroundColor, @@ -24,6 +25,7 @@ class HomePatientCard extends StatelessWidget { this.onTap, this.iconSize = 30, this.gradient, + this.fontSize }); @override @@ -40,7 +42,7 @@ class HomePatientCard extends StatelessWidget { gradient: gradient, margin: EdgeInsets.all(SizeConfig.widthMultiplier! * 1.121), child: Container( - padding: EdgeInsets.all(8), + padding: EdgeInsets.only(left : 8 ), child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.start, @@ -105,7 +107,7 @@ class HomePatientCard extends StatelessWidget { letterSpacing: -0.33, fontWeight: FontWeight.w600, fontSize: - SizeConfig.getTextMultiplierBasedOnWidth(width: width) * + fontSize?? SizeConfig.getTextMultiplierBasedOnWidth(width: width) * (SizeConfig.isHeightVeryShort ? 11 : 10), ), ), diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 491efdd1..52655121 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -33,6 +33,7 @@ import 'package:flutter_svg/flutter_svg.dart'; import 'package:provider/provider.dart'; import 'package:sticky_headers/sticky_headers/widget.dart'; +import '../pharmaacy_intervention/PharmacyIntervention.dart'; import 'label.dart'; class HomeScreen extends StatefulWidget { @@ -55,6 +56,12 @@ class _HomeScreenState extends State { var clinicId; AuthenticationViewModel authenticationViewModel = AuthenticationViewModel(); int colorIndex = 0; + double width = SizeConfig.heightMultiplier! * + (SizeConfig.isHeightVeryShort + ? 16 + : SizeConfig.isHeightLarge + ? 15 + : 13); @override Widget build(BuildContext context) { @@ -473,6 +480,24 @@ class _HomeScreenState extends State { }, )); changeColorIndex(); + patientCards.add(HomePatientCard( + gradient: backgroundColors[2], + backgroundIconColor: backgroundIconColors[2], + cardIcon: DoctorApp.search_medicines, + textColor: textColors[2], + text: TranslationBase.of(context).interventionPharmacyApproval, + fontSize: SizeConfig.getTextMultiplierBasedOnWidth(width: width) * + (SizeConfig.isHeightVeryShort ? 10: 9), + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => PharmacyIntervention(), + settings: RouteSettings(name: 'PharmacyIntervention'), + )); + }, + )); + changeColorIndex(); return [...List.generate(patientCards.length, (index) => patientCards[index]).toList()]; } diff --git a/lib/screens/patients/patient_search/patient_search_header.dart b/lib/screens/patients/patient_search/patient_search_header.dart index d10a163b..a9a69a6a 100644 --- a/lib/screens/patients/patient_search/patient_search_header.dart +++ b/lib/screens/patients/patient_search/patient_search_header.dart @@ -1,10 +1,17 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; -class PatientSearchHeader extends StatelessWidget implements PreferredSizeWidget { +class PatientSearchHeader extends StatelessWidget + implements PreferredSizeWidget { final String? title; + final bool showSearchIcon; + final VoidCallback? onSearchPressed; + final double? fontSize; - const PatientSearchHeader({Key? key, this.title}) : super(key: key); + + const PatientSearchHeader( + {Key? key, this.title, this.showSearchIcon = false, this.onSearchPressed, this.fontSize}) + : super(key: key); @override Widget build(BuildContext context) { @@ -25,13 +32,21 @@ class PatientSearchHeader extends StatelessWidget implements PreferredSizeWidget Expanded( child: AppText( title!, - fontSize: 24.0, + fontSize:fontSize ?? 24.0, fontWeight: FontWeight.w700, color: Color(0xFF2B353E), fontFamily: 'Poppins', letterSpacing: -1.44, ), ), + Visibility( + visible: showSearchIcon, + child: IconButton( + icon: Icon(Icons.search), + color: Color(0xFF2B353E), //Colors.black, + onPressed: () => onSearchPressed?.call(), + ), + ), ]), ), ); diff --git a/lib/screens/pharmaacy_intervention/PharmacyIntervention.dart b/lib/screens/pharmaacy_intervention/PharmacyIntervention.dart new file mode 100644 index 00000000..917917fc --- /dev/null +++ b/lib/screens/pharmaacy_intervention/PharmacyIntervention.dart @@ -0,0 +1,309 @@ +import 'dart:ui'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/screens/patients/ReferralDischargedPatientPage.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/referral/refer_details/referred-patient-screen.dart'; +import 'package:doctor_app_flutter/utils/tab_utils.dart'; +import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; +import 'package:intl/intl.dart'; + +import '../../config/config.dart'; + +class PharmacyIntervention extends StatefulWidget { + @override + _PharmacyIntervention createState() => _PharmacyIntervention(); +} + +class _PharmacyIntervention extends State + with SingleTickerProviderStateMixin { + TabController? _tabController; + int index = 0; + List listOfPharmacyIntervention = List.empty(); + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 3, vsync: this); + _tabController!.addListener(_handleTabSelection); + } + + _handleTabSelection() { + setState(() { + index = _tabController!.index; + }); + } + + @override + void dispose() { + super.dispose(); + _tabController!.dispose(); + } + + @override + Widget build(BuildContext context) { + ProjectViewModel projectsProvider = Provider.of(context); + + return AppScaffold( + isShowAppBar: true, + appBar: PatientSearchHeader( + title: TranslationBase.of(context).pharmacyInterventionApproval, + fontSize: 18, + showSearchIcon: true, + onSearchPressed: () { + SearchDialog(); + }, + ), + appBarTitle: TranslationBase.of(context).pharmacyInterventionApproval, + body: Column( + children: [ + SizedBox( + height: 56, + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + child: Container( + decoration: TabUtils.getBoxTabsBoxDecoration( + isActive: index == 0, + isFirst: true, + projectViewModel: projectsProvider), + child: Center( + child: TabUtils.getTabText( + title: TranslationBase.of(context).pending, + isActive: index == 0)), + ), + ), + Expanded( + child: Container( + decoration: TabUtils.getBoxTabsBoxDecoration( + isActive: index == 1, + isMiddle: true, + projectViewModel: projectsProvider), + child: Center( + child: TabUtils.getTabText( + title: TranslationBase.of(context).accepted, + isActive: index == 1)), + ), + ), + Expanded( + child: Container( + decoration: TabUtils.getBoxTabsBoxDecoration( + isActive: index == 2, + isLast: true, + projectViewModel: projectsProvider), + child: Center( + child: TabUtils.getTabText( + title: TranslationBase.of(context).rejected, + isActive: index == 2), + ), + ), + ), + ], + ), + ), + Expanded( + child: ListView.builder( + itemCount: listOfPharmacyIntervention.length, + itemBuilder: (context, item) => SizedBox.shrink()), + ) + ], + )); + } + + void SearchDialog() { + showDialog( + context: context, + barrierDismissible: true, // user must tap button! + builder: (_) { + return PharmacyInterventionDialog( + onDispose: (dateFrom, dateTo, admissionNumber, patientId) {}); + }); + } +} + +class PharmacyInterventionDialog extends StatefulWidget { + final Function( + String, + String, + String, + String, + ) onDispose; + + const PharmacyInterventionDialog({super.key, required this.onDispose}); + + @override + State createState() => + _PharmacyInterventionDialogState(); +} + +class _PharmacyInterventionDialogState + extends State { + final TextEditingController admissionNumber = TextEditingController(); + + final TextEditingController patientId = TextEditingController(); + + String dateFrom = ''; + + String dateTo = ''; + + + @override + void initState() { + super.initState(); + initFromDate(); + } + + @override + Widget build(BuildContext context) { + return Dialog( + backgroundColor: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + child: Padding( + padding: const EdgeInsets.all(24), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + _titleAndTextField( + TranslationBase.of(context).admissionNumber, admissionNumber), + SizedBox(height: 4,), + + _titleAndTextField( + TranslationBase.of(context).patientID, patientId), + SizedBox(height: 4,), + + _dateSelection(TranslationBase.of(context).dateFrom, (date) { + setState(() { + dateFrom = date; + }); + }, dateFrom), + SizedBox(height: 4,), + + _dateSelection(TranslationBase.of(context).dateTo, (date) { + setState(() { + dateTo = date; + }); + }, dateTo), + SizedBox(height: 8,), + Row(children: [ + Expanded( + child: AppButton( + title: TranslationBase.of(context).search, + hasBorder: true, + borderColor: Color(0xFFB8382B), + color: AppGlobal.appRedColor, + fontColor: Colors.white, + onPressed: () async {}, + ), + ), + ]), + ], + ), + ), + ); + } + + Widget _dateSelection( + String title, Function(String) onDateSelected, String selectedDate) { + return GestureDetector( + onTap: ()=> _selectDate(onDateSelected), + child: Row( + mainAxisSize: MainAxisSize.min, + children: [ + Text(title), + Expanded( + child: ListTile( + title: Text( + selectedDate, + ), + trailing: Icon(Icons.arrow_drop_down_outlined), + ), + ) + ], + ), + ); + } + + Future _selectDate(Function(String) updateDate) async { + // if (calenderType == CalenderType.Hijri) { + // JDateModel hijriDate = JDateModel(dateTime: DateTime.now()); + // final JPickerValue? pickedH = await showGlobalDatePicker( + // context: context, + // pickerType: PickerType.JHijri, + // startDate: birthDateInHijri ?? hijriDate, + // endDate: JDateModel( + // jhijri: JHijri(fDate: hijriDate.dateTime), + // ), + // + // // firstDate: new HijriCalendar() + // // ..hYear = 1438 + // // ..hMonth = 12 + // // ..hDay = 25, + // pickerMode: DatePickerMode.day, + // ); + // if (pickedH != null && birthDateInHijri != pickedH) updateDate(pickedH); + // } else { + final DateTime? picked = await showDatePicker( + context: context, + initialDate: DateTime.now(), + firstDate: DateTime(DateTime.now().year - 150), + lastDate: DateTime(DateTime.now().year + 150), + initialEntryMode: DatePickerEntryMode.calendar, + builder: (_, child) { + return Theme( + data: ThemeData.light().copyWith( + colorScheme: ColorScheme.fromSwatch( + primarySwatch: Colors.red, + accentColor: AppGlobal.appRedColor, + ), + dialogBackgroundColor: Colors.white, + ), + child: child!, + ); + } + + ); + if (picked != null) { + + updateDate(getFormattedDate(picked)); + } + // } + } + + Widget _titleAndTextField(String title, TextEditingController controller) { + return Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.min, + children: [ + Text(title), + Expanded( + child: TextFormField( + decoration: InputDecoration( + hintText: '', + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + contentPadding: EdgeInsetsDirectional.only(start: 10.0), + ), + textAlign: TextAlign.end, + controller: controller, + ), + ) + ], + ); + } + + void initFromDate() { + var time = DateTime.now(); + dateFrom = getFormattedDate(time); + } + + String getFormattedDate(DateTime time){ + return DateFormat('MM/dd/yyyy').format(time); + } +} diff --git a/lib/utils/translations_delegate_base_utils.dart b/lib/utils/translations_delegate_base_utils.dart index e2579e3d..a6ab1858 100644 --- a/lib/utils/translations_delegate_base_utils.dart +++ b/lib/utils/translations_delegate_base_utils.dart @@ -110,6 +110,7 @@ class TranslationBase { String get searchMedicine => localizedValues['searchMedicine']![locale.languageCode]!; String get searchMedicineDashboard => localizedValues['searchMedicineDashboard']![locale.languageCode]!; + String get interventionPharmacyApproval => localizedValues['interventionPharmacyApproval']![locale.languageCode]!; String get myReferralPatient => localizedValues['myReferralPatient']![locale.languageCode]!; @@ -1454,6 +1455,7 @@ class TranslationBase { String get doctorRota => localizedValues['doctorRota']![locale.languageCode]!; String get dateFrom => localizedValues['dateFrom']![locale.languageCode]!; + String get dateTo => localizedValues['dateTo']![locale.languageCode]!; String get searchFindSchedule => localizedValues['searchFindSchedule']![locale.languageCode]!; String get onePrimaryDiagnosis => localizedValues['onePrimaryDiagnosis']![locale.languageCode]!; @@ -1463,6 +1465,10 @@ class TranslationBase { String get complexDiagnosis => localizedValues['complexDiagnosis']![locale.languageCode]!; String get updateAssessmentDetails => localizedValues['updateAssessmentDetails']![locale.languageCode]!; + String get pharmacyInterventionApproval => + localizedValues['pharmacyInterventionApproval']![locale.languageCode]!; + String get admissionNumber => + localizedValues['admissionNumber']![locale.languageCode]!; } class TranslationBaseDelegate extends LocalizationsDelegate { From 4d31e14d6e7fb6caf0911f8bb263f053483bb173 Mon Sep 17 00:00:00 2001 From: "taha.alam" Date: Tue, 24 Dec 2024 15:07:26 +0300 Subject: [PATCH 2/2] WD: nursing station added to the PharmacyIntervention.dart dialog --- lib/config/localized_values.dart | 2 + .../PharmacyIntervention.dart | 101 ++++++++---------- .../translations_delegate_base_utils.dart | 4 + 3 files changed, 52 insertions(+), 55 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index a96a0258..f7e38d5d 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1160,6 +1160,7 @@ const Map> localizedValues = { "doctorRota": {"en": "Doctor Rota", "ar":"دوران الطبيب"}, "dateFrom": {"en": "Date From", "ar":"التاريخ من"}, "dateTo": {"en": "Date To", "ar":"التاريخ إلى"}, + "nursingStation": {"en": "Nursing Station", "ar":"محطة التمريض"}, "searchFindSchedule": {"en": "Search and find out the doctor’s schedule ", "ar":"بحث ومعرفة جدول الطبيب"}, "onePrimaryDiagnosis": {"en": "There has to be at-least 1 principal diagnosis", "ar":"يجب أن يكون هناك تشخيص رئيسي واحد على الأقل"}, "principalDiagnosisCannot": {"en": "Principal Diagnosis cannot modify once the order created", "ar":"لا يمكن تعديل التشخيص الرئيسي بمجرد إنشاء الطلب"}, @@ -1167,6 +1168,7 @@ const Map> localizedValues = { "principalCoveredOrNot": {"en": "Principal Diagnosis is not covered for this patient", "ar":"لا يتم تغطية التشخيص الرئيسي لهذا المريض"}, "complexDiagnosis": {"en": "Complex Diagnosis", "ar":"التشخيص المعقد"}, "pharmacyInterventionApproval": {"en": "Pharmacy Intervention Approval", "ar":"الموافقة على التدخل الصيدلي"}, + "pharmacyApproval": {"en": "Pharmacy Approval", "ar":"موافقة الصيدلية"}, diff --git a/lib/screens/pharmaacy_intervention/PharmacyIntervention.dart b/lib/screens/pharmaacy_intervention/PharmacyIntervention.dart index 917917fc..9001080f 100644 --- a/lib/screens/pharmaacy_intervention/PharmacyIntervention.dart +++ b/lib/screens/pharmaacy_intervention/PharmacyIntervention.dart @@ -51,14 +51,14 @@ class _PharmacyIntervention extends State return AppScaffold( isShowAppBar: true, appBar: PatientSearchHeader( - title: TranslationBase.of(context).pharmacyInterventionApproval, + title: TranslationBase.of(context).pharmacyApproval, fontSize: 18, showSearchIcon: true, onSearchPressed: () { SearchDialog(); }, ), - appBarTitle: TranslationBase.of(context).pharmacyInterventionApproval, + appBarTitle: TranslationBase.of(context).pharmacyApproval, body: Column( children: [ SizedBox( @@ -144,6 +144,7 @@ class PharmacyInterventionDialog extends StatefulWidget { class _PharmacyInterventionDialogState extends State { final TextEditingController admissionNumber = TextEditingController(); + final TextEditingController nursingStation = TextEditingController(); final TextEditingController patientId = TextEditingController(); @@ -151,7 +152,6 @@ class _PharmacyInterventionDialogState String dateTo = ''; - @override void initState() { super.initState(); @@ -170,27 +170,37 @@ class _PharmacyInterventionDialogState child: Column( mainAxisSize: MainAxisSize.min, children: [ - _titleAndTextField( - TranslationBase.of(context).admissionNumber, admissionNumber), - SizedBox(height: 4,), - - _titleAndTextField( - TranslationBase.of(context).patientID, patientId), - SizedBox(height: 4,), - + _titleAndTextField(TranslationBase.of(context).nursingStation, + nursingStation, TextInputType.number), + SizedBox( + height: 4, + ), + _titleAndTextField(TranslationBase.of(context).admissionNumber, + admissionNumber, TextInputType.number), + SizedBox( + height: 4, + ), + _titleAndTextField(TranslationBase.of(context).patientID, patientId, + TextInputType.number), + SizedBox( + height: 4, + ), _dateSelection(TranslationBase.of(context).dateFrom, (date) { setState(() { dateFrom = date; }); }, dateFrom), - SizedBox(height: 4,), - + SizedBox( + height: 4, + ), _dateSelection(TranslationBase.of(context).dateTo, (date) { setState(() { dateTo = date; }); }, dateTo), - SizedBox(height: 8,), + SizedBox( + height: 8, + ), Row(children: [ Expanded( child: AppButton( @@ -212,7 +222,7 @@ class _PharmacyInterventionDialogState Widget _dateSelection( String title, Function(String) onDateSelected, String selectedDate) { return GestureDetector( - onTap: ()=> _selectDate(onDateSelected), + onTap: () => _selectDate(onDateSelected), child: Row( mainAxisSize: MainAxisSize.min, children: [ @@ -231,52 +241,32 @@ class _PharmacyInterventionDialogState } Future _selectDate(Function(String) updateDate) async { - // if (calenderType == CalenderType.Hijri) { - // JDateModel hijriDate = JDateModel(dateTime: DateTime.now()); - // final JPickerValue? pickedH = await showGlobalDatePicker( - // context: context, - // pickerType: PickerType.JHijri, - // startDate: birthDateInHijri ?? hijriDate, - // endDate: JDateModel( - // jhijri: JHijri(fDate: hijriDate.dateTime), - // ), - // - // // firstDate: new HijriCalendar() - // // ..hYear = 1438 - // // ..hMonth = 12 - // // ..hDay = 25, - // pickerMode: DatePickerMode.day, - // ); - // if (pickedH != null && birthDateInHijri != pickedH) updateDate(pickedH); - // } else { final DateTime? picked = await showDatePicker( - context: context, - initialDate: DateTime.now(), - firstDate: DateTime(DateTime.now().year - 150), - lastDate: DateTime(DateTime.now().year + 150), - initialEntryMode: DatePickerEntryMode.calendar, - builder: (_, child) { - return Theme( - data: ThemeData.light().copyWith( - colorScheme: ColorScheme.fromSwatch( - primarySwatch: Colors.red, - accentColor: AppGlobal.appRedColor, + context: context, + initialDate: DateTime.now(), + firstDate: DateTime(DateTime.now().year - 150), + lastDate: DateTime(DateTime.now().year + 150), + initialEntryMode: DatePickerEntryMode.calendar, + builder: (_, child) { + return Theme( + data: ThemeData.light().copyWith( + colorScheme: ColorScheme.fromSwatch( + primarySwatch: Colors.red, + accentColor: AppGlobal.appRedColor, + ), + dialogBackgroundColor: Colors.white, ), - dialogBackgroundColor: Colors.white, - ), - child: child!, - ); - } - - ); + child: child!, + ); + }); if (picked != null) { - updateDate(getFormattedDate(picked)); } // } } - Widget _titleAndTextField(String title, TextEditingController controller) { + Widget _titleAndTextField(String title, TextEditingController controller, + TextInputType? inputType) { return Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisSize: MainAxisSize.min, @@ -284,6 +274,7 @@ class _PharmacyInterventionDialogState Text(title), Expanded( child: TextFormField( + keyboardType: inputType, decoration: InputDecoration( hintText: '', focusedBorder: InputBorder.none, @@ -300,10 +291,10 @@ class _PharmacyInterventionDialogState void initFromDate() { var time = DateTime.now(); - dateFrom = getFormattedDate(time); + dateFrom = getFormattedDate(time); } - String getFormattedDate(DateTime time){ + String getFormattedDate(DateTime time) { return DateFormat('MM/dd/yyyy').format(time); } } diff --git a/lib/utils/translations_delegate_base_utils.dart b/lib/utils/translations_delegate_base_utils.dart index a6ab1858..9d21b156 100644 --- a/lib/utils/translations_delegate_base_utils.dart +++ b/lib/utils/translations_delegate_base_utils.dart @@ -1467,8 +1467,12 @@ class TranslationBase { localizedValues['updateAssessmentDetails']![locale.languageCode]!; String get pharmacyInterventionApproval => localizedValues['pharmacyInterventionApproval']![locale.languageCode]!; + String get pharmacyApproval => + localizedValues['pharmacyApproval']![locale.languageCode]!; String get admissionNumber => localizedValues['admissionNumber']![locale.languageCode]!; + String get nursingStation => + localizedValues['nursingStation']![locale.languageCode]!; } class TranslationBaseDelegate extends LocalizationsDelegate {