From 906fd5fd6a7120086b747c8adc2ab5bf77537b71 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Tue, 23 May 2023 17:49:54 +0300 Subject: [PATCH] Inpatient services in dev --- lib/config/config.dart | 4 +- .../inpatient_advance_payment.dart | 65 +++++++++++++ .../InPatientServices/inpatient_home.dart | 77 ++++++++++++--- lib/pages/InPatientServices/meal_plan.dart | 95 +++++++++++++++++++ .../fragments/home_page_fragment2.dart | 6 +- lib/pages/landing/widgets/services_view.dart | 4 + .../medical/medical_profile_item.dart | 5 +- .../others/app_expandable_notifier.dart | 49 +++++----- pubspec.yaml | 1 + 9 files changed, 264 insertions(+), 42 deletions(-) create mode 100644 lib/pages/InPatientServices/inpatient_advance_payment.dart create mode 100644 lib/pages/InPatientServices/meal_plan.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 1c0caeb9..28d0f6bf 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -20,8 +20,8 @@ var PACKAGES_ORDERS = '/api/orders'; var PACKAGES_ORDER_HISTORY = '/api/orders/items'; var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'http://10.50.100.198:3334/'; -// var BASE_URL = 'https://uat.hmgwebservices.com/'; -var BASE_URL = 'https://hmgwebservices.com/'; + var BASE_URL = 'https://uat.hmgwebservices.com/'; +// var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; diff --git a/lib/pages/InPatientServices/inpatient_advance_payment.dart b/lib/pages/InPatientServices/inpatient_advance_payment.dart new file mode 100644 index 00000000..6ab415a0 --- /dev/null +++ b/lib/pages/InPatientServices/inpatient_advance_payment.dart @@ -0,0 +1,65 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class InPatientAdvancePayment extends StatefulWidget { + const InPatientAdvancePayment({Key key}) : super(key: key); + + @override + State createState() => _InPatientAdvancePaymentState(); +} + +class _InPatientAdvancePaymentState extends State with SingleTickerProviderStateMixin { + TabController _tabController; + ProjectViewModel projectViewModel; + + @override + void initState() { + _tabController = TabController(length: 2, vsync: this); + super.initState(); + } + + @override + Widget build(BuildContext context) { + projectViewModel = Provider.of(context); + return AppScaffold( + isShowAppBar: true, + isShowDecPage: false, + showNewAppBarTitle: true, + showNewAppBar: true, + appBarTitle: TranslationBase.of(context).advancePayment, + body: Column( + children: [ + TabBar( + controller: _tabController, + indicatorWeight: 3.0, + indicatorSize: TabBarIndicatorSize.tab, + labelColor: Color(0xff2B353E), + unselectedLabelColor: Color(0xff575757), + labelPadding: EdgeInsets.only(top: 15, bottom: 13, left: 20, right: 20), + labelStyle: TextStyle( + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + unselectedLabelStyle: TextStyle( + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'Poppins', + fontSize: 16, + fontWeight: FontWeight.w600, + letterSpacing: -0.48, + ), + tabs: [Text(TranslationBase.of(context).pending), Text(TranslationBase.of(context).close)], + onTap: (index) { + if (index == 1) { + // getOBGyneOrdersList(); + } + }, + ), + ], + ), + ); + } +} diff --git a/lib/pages/InPatientServices/inpatient_home.dart b/lib/pages/InPatientServices/inpatient_home.dart index ea5e0e1d..fbd4bc57 100644 --- a/lib/pages/InPatientServices/inpatient_home.dart +++ b/lib/pages/InPatientServices/inpatient_home.dart @@ -1,6 +1,8 @@ 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/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'; @@ -57,11 +59,11 @@ class InPatientServicesHome extends StatelessWidget { }, child: MedicalProfileItem( title: TranslationBase.of(context).admissionGeneral, - imagePath: 'assets/images/new/consent.jpg', + imagePath: 'admission.svg', subTitle: TranslationBase.of(context).consent, - isPngImage: true, width: 50.0, height: 40.0, + isInPatient: true, ), ), ); @@ -73,11 +75,11 @@ class InPatientServicesHome extends StatelessWidget { }, child: MedicalProfileItem( title: TranslationBase.of(context).generalInstructionsTitle, - imagePath: 'assets/images/new/instructions.jpg', + imagePath: 'general_instructions.svg', subTitle: TranslationBase.of(context).generalInstructionsSubTitle, - isPngImage: true, width: 50.0, height: 40.0, + isInPatient: true, ), ), ); @@ -89,11 +91,11 @@ class InPatientServicesHome extends StatelessWidget { }, child: MedicalProfileItem( title: TranslationBase.of(context).medicalInstructionsTitle, - imagePath: 'assets/images/new/medical_instructions.png', + imagePath: 'medical_instructions.svg', subTitle: TranslationBase.of(context).medicalInstructionsSubTitle, - isPngImage: true, width: 50.0, height: 40.0, + isInPatient: true, ), ), ); @@ -101,15 +103,15 @@ class InPatientServicesHome extends StatelessWidget { serviceList.add( InkWell( onTap: () { - // Navigator.push(context, FadePage(page: AdvancePaymentPage())); + Navigator.push(context, FadePage(page: MealPlanPage())); }, child: MedicalProfileItem( title: TranslationBase.of(context).mealPlanTitle, - imagePath: 'assets/images/new/meal_plan.png', + imagePath: 'meal_plan.svg', subTitle: TranslationBase.of(context).mealPlanSubTitle, - isPngImage: true, width: 50.0, height: 40.0, + isInPatient: true, ), ), ); @@ -121,11 +123,11 @@ class InPatientServicesHome extends StatelessWidget { }, child: MedicalProfileItem( title: TranslationBase.of(context).birthNotificationTitle, - imagePath: 'assets/images/new/birth.png', + imagePath: 'birth_notification.svg', subTitle: TranslationBase.of(context).birthNotificationSubTitle, - isPngImage: true, width: 50.0, height: 40.0, + isInPatient: true, ), ), ); @@ -137,14 +139,63 @@ class InPatientServicesHome extends StatelessWidget { }, child: MedicalProfileItem( title: TranslationBase.of(context).admissionNoticeTitle, - imagePath: 'assets/images/new/admission_notice.png', + imagePath: 'admission_notice.svg', subTitle: TranslationBase.of(context).admissionNoticeSubTitle, - isPngImage: true, width: 50.0, height: 40.0, + isInPatient: true, ), ), ); + + serviceList.add( + InkWell( + onTap: () { + Navigator.push(context, FadePage(page: InPatientAdvancePayment())); + }, + child: MedicalProfileItem( + title: "Advance", + imagePath: 'advance_payment.svg', + subTitle: TranslationBase.of(context).payment, + width: 50.0, + height: 40.0, + isInPatient: true, + ), + ), + ); + + serviceList.add( + InkWell( + onTap: () { + // Navigator.push(context, FadePage(page: AdvancePaymentPage())); + }, + child: MedicalProfileItem( + title: "Receive", + imagePath: 'receive_prescription.svg', + subTitle: TranslationBase.of(context).prescriptions, + width: 50.0, + height: 40.0, + isInPatient: true, + ), + ), + ); + + serviceList.add( + InkWell( + onTap: () { + // Navigator.push(context, FadePage(page: AdvancePaymentPage())); + }, + child: MedicalProfileItem( + title: "Help", + imagePath: 'help_pro.svg', + subTitle: "PRO", + width: 50.0, + height: 40.0, + isInPatient: true, + ), + ), + ); + return serviceList; } diff --git a/lib/pages/InPatientServices/meal_plan.dart b/lib/pages/InPatientServices/meal_plan.dart new file mode 100644 index 00000000..883d3c65 --- /dev/null +++ b/lib/pages/InPatientServices/meal_plan.dart @@ -0,0 +1,95 @@ +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; + +class MealPlanPage extends StatefulWidget { + const MealPlanPage({Key key}) : super(key: key); + + @override + State createState() => _MealPlanPageState(); +} + +class _MealPlanPageState extends State { + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + isShowDecPage: false, + showNewAppBarTitle: true, + showNewAppBar: true, + appBarTitle: TranslationBase.of(context).mealPlanTitle, + body: SingleChildScrollView( + child: Padding( + padding: EdgeInsets.all(21.0), + child: Column( + children: [ + Container( + decoration: containerRadius(Colors.white, 12), + child: AppExpandableNotifier( + title: "Breakfast TAT: 10:00 AM", + isTitleSingleLine: false, + widgetColor: Colors.transparent, + bodyWidget: Column( + children: [ + getDivider(), + Container( + height: 200.0, + ), + ], + ), + ), + ), + mHeight(21), + Container( + decoration: containerRadius(Colors.white, 12), + child: AppExpandableNotifier( + title: "Lunch TAT: 04:00 PM", + isTitleSingleLine: false, + widgetColor: Colors.transparent, + bodyWidget: Column( + children: [ + getDivider(), + Container( + height: 200.0, + ), + ], + ), + ), + ), + mHeight(21), + Container( + decoration: containerRadius(Colors.white, 12), + child: AppExpandableNotifier( + title: "Dinner TAT: 12:00 AM", + isTitleSingleLine: false, + widgetColor: Colors.transparent, + bodyWidget: Column( + children: [ + getDivider(), + Container( + height: 200.0, + ), + ], + ), + ), + ), + ], + ), + ), + ), + ); + } + + Widget getDivider() { + return Padding( + padding: EdgeInsets.only(left: 15, right: 15), + child: Divider( + height: 1.5, + thickness: 2.0, + color: Colors.black, + ), + ); + } +} diff --git a/lib/pages/landing/fragments/home_page_fragment2.dart b/lib/pages/landing/fragments/home_page_fragment2.dart index 487dac82..24c2c4a0 100644 --- a/lib/pages/landing/fragments/home_page_fragment2.dart +++ b/lib/pages/landing/fragments/home_page_fragment2.dart @@ -70,7 +70,7 @@ class _HomePageFragment2State extends State { // hmgServices.add(new HmgServices(2, TranslationBase.of(context).online, TranslationBase.of(context).payment, "assets/images/new/paymentMethods.png", isLogin)); hmgServices.add(new HmgServices(3, TranslationBase.of(context).hhcHome, TranslationBase.of(context).healthCare, "assets/images/new/HHC.svg", isLogin)); hmgServices.add(new HmgServices(4, TranslationBase.of(context).checkup, TranslationBase.of(context).comprehensive, "assets/images/new/comprehensive_checkup.svg", isLogin)); - hmgServices.add(new HmgServices(5, TranslationBase.of(context).emergencyTitle, TranslationBase.of(context).emergencySubtitle, "assets/images/new/emergency.svg", isLogin)); + hmgServices.add(new HmgServices(2, TranslationBase.of(context).emergencyTitle, TranslationBase.of(context).emergencySubtitle, "assets/images/new/emergency.svg", isLogin)); hmgServices.add(new HmgServices(6, TranslationBase.of(context).ereferralTitle, TranslationBase.of(context).ereferralSubtitle, "assets/images/new/E_Referral.svg", isLogin)); hmgServices.add(new HmgServices(7, "H\u2082O", TranslationBase.of(context).dailyWater, "assets/images/new/h2o.svg", isLogin)); hmgServices.add(new HmgServices(8, TranslationBase.of(context).connectTitle, TranslationBase.of(context).connectSubtitle, "assets/images/new/reach_us.svg", isLogin)); @@ -291,7 +291,7 @@ class _HomePageFragment2State extends State { child: AspectRatio( aspectRatio: 2.15, child: ServicesView( - new HmgServices(2, TranslationBase.of(context).InPatient, TranslationBase.of(context).inPatientServices, "assets/images/new/hospital.png", false), 23, true)), + new HmgServices(23, TranslationBase.of(context).InPatient, TranslationBase.of(context).inPatientServices, "assets/images/new/InPatient.svg", false), 23, true)), ), ), Expanded( @@ -299,7 +299,7 @@ class _HomePageFragment2State extends State { child: AspectRatio( aspectRatio: 1.0, child: ServicesView( - new HmgServices(2, TranslationBase.of(context).online, TranslationBase.of(context).payment, "assets/images/new/paymentMethods.png", false), 2, true)), + new HmgServices(5, TranslationBase.of(context).online, TranslationBase.of(context).payment, "assets/images/new/paymentMethods.png", false), 2, true)), ), ], ), diff --git a/lib/pages/landing/widgets/services_view.dart b/lib/pages/landing/widgets/services_view.dart index f1753f3c..9a76e331 100644 --- a/lib/pages/landing/widgets/services_view.dart +++ b/lib/pages/landing/widgets/services_view.dart @@ -21,6 +21,7 @@ import 'package:diplomaticquarterapp/pages/ContactUs/contact_us_page.dart'; import 'package:diplomaticquarterapp/pages/Covid-DriveThru/covid-drivethru-location.dart'; import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart'; import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; +import 'package:diplomaticquarterapp/pages/InPatientServices/inpatient_home.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; @@ -190,6 +191,9 @@ class ServicesView extends StatelessWidget { } else if (hmgServices.action == 8) { Navigator.push(context, FadePage(page: ContactUsPage())); locator().hmgServices.logServiceName('find us reach us'); + } else if (hmgServices.action == 23) { + Navigator.push(context, FadePage(page: InPatientServicesHome())); + locator().hmgServices.logServiceName('find us reach us'); } } diff --git a/lib/widgets/data_display/medical/medical_profile_item.dart b/lib/widgets/data_display/medical/medical_profile_item.dart index cfe7f59f..90662299 100644 --- a/lib/widgets/data_display/medical/medical_profile_item.dart +++ b/lib/widgets/data_display/medical/medical_profile_item.dart @@ -10,12 +10,13 @@ class MedicalProfileItem extends StatelessWidget { final String subTitle; final bool hasBadge = false; final bool isPngImage; + final bool isInPatient; bool isEnable; Color imgColor; final width; final height; - MedicalProfileItem({@required this.imagePath, @required this.title, @required this.subTitle, hasBadge, this.isEnable = true, this.imgColor, this.isPngImage = false, this.width, this.height}); + MedicalProfileItem({@required this.imagePath, @required this.title, @required this.subTitle, hasBadge, this.isEnable = true, this.imgColor, this.isPngImage = false, this.width, this.height, this.isInPatient = false}); @override Widget build(BuildContext context) { @@ -50,7 +51,7 @@ class MedicalProfileItem extends StatelessWidget { color: imgColor, ) : SvgPicture.asset( - "assets/images/new/services/$imagePath", + isInPatient ? "assets/images/new/inpatient/$imagePath" : "assets/images/new/services/$imagePath", height: SizeConfig.widthMultiplier * 7, width: SizeConfig.widthMultiplier * 7, color: imgColor, diff --git a/lib/widgets/others/app_expandable_notifier.dart b/lib/widgets/others/app_expandable_notifier.dart index ece72712..0c30b7cd 100644 --- a/lib/widgets/others/app_expandable_notifier.dart +++ b/lib/widgets/others/app_expandable_notifier.dart @@ -20,10 +20,12 @@ class AppExpandableNotifier extends StatefulWidget { bool expandFlag = false; bool hasCounter = false; String counter = "0"; + Color widgetColor = Colors.white; var controller = new ExpandableController(); bool isTitleSingleLine; - AppExpandableNotifier({this.headerWidget, this.bodyWidget, this.title, this.collapsed, this.isExpand = false, this.isTitleSingleLine = true, this.hasCounter = false, this.counter = "0"}); + AppExpandableNotifier( + {this.headerWidget, this.bodyWidget, this.title, this.collapsed, this.isExpand = false, this.isTitleSingleLine = true, this.hasCounter = false, this.counter = "0", this.widgetColor}); _AppExpandableNotifier createState() => _AppExpandableNotifier(); } @@ -60,7 +62,7 @@ class _AppExpandableNotifier extends State { } return ExpandableNotifier( child: Container( - color: Colors.white, + color: widget.widgetColor != null ? widget.widgetColor : Colors.white, child: Column( children: [ SizedBox( @@ -93,27 +95,30 @@ class _AppExpandableNotifier extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ if (_mainTitle.isNotEmpty && widget.isTitleSingleLine) - !widget.hasCounter ? - Text( - _mainTitle, - style: TextStyle(fontSize: 20, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.72, height: 1), - ) : Row( - children: [ - Text( - _mainTitle, - style: TextStyle(fontSize: 20, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.72, height: 1), - ), - SizedBox(width: 10.0,), - CircleAvatar( - backgroundColor: CustomColors.accentColor, - radius: 12.0, - child: Text( - widget.counter, - style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.72), + !widget.hasCounter + ? Text( + _mainTitle, + style: TextStyle(fontSize: 20, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.72, height: 1), + ) + : Row( + children: [ + Text( + _mainTitle, + style: TextStyle(fontSize: 20, fontWeight: FontWeight.w600, color: Color(0xff2E303A), letterSpacing: -0.72, height: 1), + ), + SizedBox( + width: 10.0, + ), + CircleAvatar( + backgroundColor: CustomColors.accentColor, + radius: 12.0, + child: Text( + widget.counter, + style: TextStyle(fontSize: 14, fontWeight: FontWeight.w600, color: Colors.white, letterSpacing: -0.72), + ), + ) + ], ), - ) - ], - ), if (_title.isNotEmpty && !widget.isTitleSingleLine) Text( _title, diff --git a/pubspec.yaml b/pubspec.yaml index 39370e58..7fa86972 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -253,6 +253,7 @@ flutter: - assets/payment_options/ - assets/images/new/ + - assets/images/new/inpatient/ - assets/images/new/mass/ - assets/images/new/bottom_nav/ - assets/images/new/services/