From b64ba9211e7a7d9c4564905326b363ecde992028 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Wed, 24 May 2023 11:22:08 +0300 Subject: [PATCH] Inpatient services in dev --- .../general_instructions.dart | 2 +- lib/pages/InPatientServices/help_PRO.dart | 135 ++++++++++++++++++ .../inpatient_advance_payment.dart | 17 ++- .../InPatientServices/inpatient_home.dart | 21 ++- 4 files changed, 164 insertions(+), 11 deletions(-) create mode 100644 lib/pages/InPatientServices/help_PRO.dart diff --git a/lib/pages/InPatientServices/general_instructions.dart b/lib/pages/InPatientServices/general_instructions.dart index 88f9797d..ead96e42 100644 --- a/lib/pages/InPatientServices/general_instructions.dart +++ b/lib/pages/InPatientServices/general_instructions.dart @@ -27,7 +27,7 @@ class GeneralInstructions extends StatelessWidget { mainAxisSize: MainAxisSize.min, children: [ Padding( - padding: const EdgeInsets.all(8.0), + padding: const EdgeInsets.all(21.0), child: Text("General Instructions", overflow: TextOverflow.clip, style: TextStyle( diff --git a/lib/pages/InPatientServices/help_PRO.dart b/lib/pages/InPatientServices/help_PRO.dart new file mode 100644 index 00000000..954550ef --- /dev/null +++ b/lib/pages/InPatientServices/help_PRO.dart @@ -0,0 +1,135 @@ +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; + +class HelpPRO extends StatefulWidget { + const HelpPRO({Key key}) : super(key: key); + + @override + State createState() => _HelpPROState(); +} + +class _HelpPROState extends State { + + TextEditingController assistText = new TextEditingController(); + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + isShowDecPage: false, + showNewAppBarTitle: true, + showNewAppBar: true, + appBarTitle: "Patient Relation Officer", + body: SingleChildScrollView( + child: Container( + width: MediaQuery.of(context).size.width, + decoration: containerRadius(Colors.white, 12), + margin: EdgeInsets.all(21.0), + padding: const EdgeInsets.all(21.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "How we may assist you?", + overflow: TextOverflow.clip, + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.64, + ), + ), + mHeight(16), + inputWidget(TranslationBase.of(context).enterDetails, "", assistText), + ], + ), + ), + ), + ); + } + + Widget inputWidget(String _labelText, String _hintText, TextEditingController _controller, {String prefix, bool isEnable = true, bool hasSelection = false}) { + return Container( + padding: EdgeInsets.only(left: 16, right: 16, bottom: 15, top: 15), + alignment: Alignment.center, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white, + border: Border.all( + color: Color(0xffefefef), + width: 1, + ), + ), + child: InkWell( + onTap: hasSelection ? () {} : null, + child: Row( + children: [ + Expanded( + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + _labelText, + style: TextStyle( + fontSize: 11, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + ), + TextField( + enabled: isEnable, + scrollPadding: EdgeInsets.zero, + keyboardType: TextInputType.name, + controller: _controller, + onChanged: (value) => {}, + style: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff2B353E), + letterSpacing: -0.44, + ), + decoration: InputDecoration( + isDense: true, + hintText: _hintText, + hintStyle: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w400, + color: Color(0xff575757), + letterSpacing: -0.56, + ), + prefixIconConstraints: BoxConstraints(minWidth: 50), + prefixIcon: prefix == null + ? null + : Text( + "+" + prefix, + style: TextStyle( + fontSize: 14, + height: 21 / 14, + fontWeight: FontWeight.w500, + color: Color(0xff2E303A), + letterSpacing: -0.56, + ), + ), + contentPadding: EdgeInsets.zero, + border: InputBorder.none, + focusedBorder: InputBorder.none, + enabledBorder: InputBorder.none, + ), + ), + ], + ), + ), + if (hasSelection) Icon(Icons.keyboard_arrow_down_outlined), + ], + ), + ), + ); + } + +} diff --git a/lib/pages/InPatientServices/inpatient_advance_payment.dart b/lib/pages/InPatientServices/inpatient_advance_payment.dart index 6ab415a0..85965b73 100644 --- a/lib/pages/InPatientServices/inpatient_advance_payment.dart +++ b/lib/pages/InPatientServices/inpatient_advance_payment.dart @@ -51,13 +51,18 @@ class _InPatientAdvancePaymentState extends State with fontWeight: FontWeight.w600, letterSpacing: -0.48, ), - tabs: [Text(TranslationBase.of(context).pending), Text(TranslationBase.of(context).close)], - onTap: (index) { - if (index == 1) { - // getOBGyneOrdersList(); - } - }, + tabs: [Text(TranslationBase.of(context).pending), Text(TranslationBase.of(context).paid)], ), + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + Container(), + Container(), + ], + ), + ) ], ), ); diff --git a/lib/pages/InPatientServices/inpatient_home.dart b/lib/pages/InPatientServices/inpatient_home.dart index fbd4bc57..3e82e872 100644 --- a/lib/pages/InPatientServices/inpatient_home.dart +++ b/lib/pages/InPatientServices/inpatient_home.dart @@ -1,12 +1,14 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/InPatientServices/get_general_instructions_response_model.dart'; import 'package:diplomaticquarterapp/pages/InPatientServices/general_instructions.dart'; +import 'package:diplomaticquarterapp/pages/InPatientServices/help_PRO.dart'; import 'package:diplomaticquarterapp/pages/InPatientServices/inpatient_advance_payment.dart'; import 'package:diplomaticquarterapp/pages/InPatientServices/meal_plan.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; @@ -168,6 +170,7 @@ class InPatientServicesHome extends StatelessWidget { InkWell( onTap: () { // Navigator.push(context, FadePage(page: AdvancePaymentPage())); + receivePrescriptionAPI(context); }, child: MedicalProfileItem( title: "Receive", @@ -183,7 +186,7 @@ class InPatientServicesHome extends StatelessWidget { serviceList.add( InkWell( onTap: () { - // Navigator.push(context, FadePage(page: AdvancePaymentPage())); + Navigator.push(context, FadePage(page: HelpPRO())); }, child: MedicalProfileItem( title: "Help", @@ -199,18 +202,28 @@ class InPatientServicesHome extends StatelessWidget { return serviceList; } + void receivePrescriptionAPI(BuildContext context) { + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: TranslationBase.of(context).successSendReport, + okText: TranslationBase.of(context).ok, + cancelText: TranslationBase.of(context).cancel_nocaps, + okFunction: () { + Navigator.of(context).pop(); + }, + cancelFunction: () => {}); + dialog.showAlertDialog(context); + } + void openGeneralInstructions(BuildContext context) { ClinicListService service = new ClinicListService(); GifLoaderDialogUtils.showMyDialog(context); service.getGeneralInstructions(projectViewModel.inPatientProjectID, context).then((res) { List getGeneralInstructionsList = []; - res['generalInstructions'].forEach((v) { getGeneralInstructionsList.add(new GetGeneralInstructions.fromJson(v)); }); - GifLoaderDialogUtils.hideDialog(context); - print(res['generalInstructions']); Navigator.push(context, FadePage(page: GeneralInstructions(getGeneralInstructionsList: getGeneralInstructionsList))); }).catchError((err) {