From 704d6918167d105fab0c5a1bcb8b7f944b0fdd9b Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Sun, 2 Jun 2024 17:10:08 +0300 Subject: [PATCH] ER Online Check-In contd. --- .../EROnlineCheckIn/EROnlineCheckInHome.dart | 305 ++++++++++++++++++ .../EROnlineCheckInPaymentDetails.dart | 290 +++++++++++++++++ .../fragments/home_page_fragment2.dart | 5 +- lib/pages/landing/widgets/services_view.dart | 5 +- 4 files changed, 602 insertions(+), 3 deletions(-) create mode 100644 lib/pages/ErService/EROnlineCheckIn/EROnlineCheckInHome.dart create mode 100644 lib/pages/ErService/EROnlineCheckIn/EROnlineCheckInPaymentDetails.dart diff --git a/lib/pages/ErService/EROnlineCheckIn/EROnlineCheckInHome.dart b/lib/pages/ErService/EROnlineCheckIn/EROnlineCheckInHome.dart new file mode 100644 index 00000000..0e912f41 --- /dev/null +++ b/lib/pages/ErService/EROnlineCheckIn/EROnlineCheckInHome.dart @@ -0,0 +1,305 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/pages/ErService/EROnlineCheckIn/EROnlineCheckInPaymentDetails.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/nfc/nfc_reader_sheet.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_nfc_kit/flutter_nfc_kit.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:provider/provider.dart'; + +class EROnlineCheckInHomePage extends StatefulWidget { + const EROnlineCheckInHomePage(); + + @override + State createState() => _EROnlineCheckInHomePageState(); +} + +class _EROnlineCheckInHomePageState extends State { + ProjectViewModel projectViewModel; + + bool _supportsNFC = false; + + @override + Widget build(BuildContext context) { + projectViewModel = Provider.of(context); + FlutterNfcKit.nfcAvailability.then((value) { + _supportsNFC = (value == NFCAvailability.available); + }); + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).emergency + " ${TranslationBase.of(context).checkinOptions}", + isShowDecPage: false, + showNewAppBar: true, + showNewAppBarTitle: true, + backgroundColor: Color(0xffF8F8F8), + body: SingleChildScrollView( + child: Padding( + padding: EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only(topLeft: Radius.circular(10), topRight: Radius.circular(10), bottomLeft: Radius.circular(10), bottomRight: Radius.circular(10)), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.1), + spreadRadius: 5, + blurRadius: 7, + offset: Offset(0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Icon( + Icons.check_circle, + size: 50, + color: CustomColors.green, + ), + mHeight(6), + Text( + "What is Online Check-In?", + maxLines: 1, + style: TextStyle( + fontSize: 20, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24), + ), + Text( + "online check-in lets patients fill out forms, share insurance details, and book appointments online, making their visit smoother and quicker.", + style: TextStyle(fontSize: 14, color: CustomColors.textDarkColor, letterSpacing: -1.44, height: 35 / 24), + ), + mHeight(16), + Text( + "How can i use Online Check-In?", + maxLines: 1, + style: TextStyle( + fontSize: 20, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24), + ), + Text( + "online check-in lets patients fill out forms, share insurance details, and book appointments online, making their visit smoother and quicker.", + style: TextStyle(fontSize: 14, color: CustomColors.textDarkColor, letterSpacing: -1.44, height: 35 / 24), + ), + ], + ), + ), + ), + mHeight(24), + Container( + width: double.infinity, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only(topLeft: Radius.circular(10), topRight: Radius.circular(10), bottomLeft: Radius.circular(10), bottomRight: Radius.circular(10)), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.1), + spreadRadius: 5, + blurRadius: 7, + offset: Offset(0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + width: 35, + height: 35, + decoration: BoxDecoration( + color: CustomColors.green, + borderRadius: BorderRadius.circular(50), + ), + child: Center( + child: Text( + "1", + style: TextStyle(fontSize: 22, fontWeight: FontWeight.w700, color: CustomColors.white, letterSpacing: -1.44, height: 35 / 24), + ), + ), + ), + mWidth(12), + SvgPicture.asset( + "assets/images/new/tap.svg", + width: 35, + height: 35, + ), + ], + ), + Padding( + padding: const EdgeInsets.only(left: 50, right: 50), + child: Text( + "Tap On", + maxLines: 1, + style: TextStyle( + fontSize: 20, + fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), + fontWeight: FontWeight.w700, + color: Color(0xff2B353E), + letterSpacing: -1.44, + height: 35 / 24), + ), + ), + Padding( + padding: const EdgeInsets.only(left: 50, right: 50), + child: Text( + "Tap on the check-in button within the app", + style: TextStyle(fontSize: 14, color: CustomColors.textDarkColor, letterSpacing: -1.44, height: 35 / 24), + ), + ), + mHeight(16), + Row( + children: [ + Container( + width: 35, + height: 35, + decoration: BoxDecoration( + color: CustomColors.green, + borderRadius: BorderRadius.circular(50), + ), + child: Center( + child: Text( + "2", + style: TextStyle(fontSize: 22, fontWeight: FontWeight.w700, color: CustomColors.white, letterSpacing: -1.44, height: 35 / 24), + ), + ), + ), + mWidth(12), + SvgPicture.asset( + "assets/images/new/NFC_Hold.svg", + width: 35, + height: 35, + ), + ], + ), + Padding( + padding: const EdgeInsets.only(left: 50, right: 50), + child: Text( + "Hold your phone", + maxLines: 1, + style: TextStyle( + fontSize: 20, + fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), + fontWeight: FontWeight.w700, + color: Color(0xff2B353E), + letterSpacing: -1.44, + height: 35 / 24), + ), + ), + Padding( + padding: const EdgeInsets.only(left: 50, right: 50), + child: Text( + "Hold the phone 1 to 2 cm from the NFC sign displayed on the board", + style: TextStyle(fontSize: 14, color: CustomColors.textDarkColor, letterSpacing: -1.44, height: 35 / 24), + ), + ), + mHeight(16), + Row( + children: [ + Container( + width: 35, + height: 35, + decoration: BoxDecoration( + color: CustomColors.green, + borderRadius: BorderRadius.circular(50), + ), + child: Center( + child: Text( + "3", + style: TextStyle(fontSize: 22, fontWeight: FontWeight.w700, color: CustomColors.white, letterSpacing: -1.44, height: 35 / 24), + ), + ), + ), + mWidth(12), + SvgPicture.asset( + "assets/images/new/hourglass.svg", + width: 35, + height: 35, + ), + ], + ), + Padding( + padding: const EdgeInsets.only(left: 50, right: 50), + child: Text( + "Wait your turn", + maxLines: 1, + style: TextStyle( + fontSize: 20, + fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), + fontWeight: FontWeight.w700, + color: Color(0xff2B353E), + letterSpacing: -1.44, + height: 35 / 24), + ), + ), + Padding( + padding: const EdgeInsets.only(left: 50, right: 50), + child: Text( + "Please wait in the waiting area until called by the nurse", + style: TextStyle(fontSize: 14, color: CustomColors.textDarkColor, letterSpacing: -1.44, height: 35 / 24), + ), + ), + ], + ), + ), + ), + ], + ), + ), + ), + bottomSheet: Container( + height: 80, + color: CustomColors.white, + padding: EdgeInsets.fromLTRB(12.0, 12.0, 12.0, 25.0), + child: Row( + children: [ + Expanded( + flex: 1, + child: DefaultButton( + TranslationBase.of(context).checkinOptions, + () { + if (_supportsNFC) { + Future.delayed(const Duration(milliseconds: 500), () { + showNfcReader(context, onNcfScan: (String nfcId) { + Future.delayed(const Duration(milliseconds: 100), () { + print(nfcId); + Navigator.push(context, FadePage(page: EROnlineCheckInPaymentDetails())); + }); + }, onCancel: () { + Navigator.of(context).pop(); + }); + }); + } else { + //NFCNotSupported + AppToast.showErrorToast(message: TranslationBase.of(context).NFCNotSupported); + } + }, + color: CustomColors.green, + ), + ), + mWidth(12), + Expanded( + flex: 1, + child: DefaultButton( + TranslationBase.of(context).bookAppo, + () {}, + color: CustomColors.accentColor, + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/pages/ErService/EROnlineCheckIn/EROnlineCheckInPaymentDetails.dart b/lib/pages/ErService/EROnlineCheckIn/EROnlineCheckInPaymentDetails.dart new file mode 100644 index 00000000..23f8d4c6 --- /dev/null +++ b/lib/pages/ErService/EROnlineCheckIn/EROnlineCheckInPaymentDetails.dart @@ -0,0 +1,290 @@ +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; +import 'package:diplomaticquarterapp/theme/colors.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/uitl/utils_new.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class EROnlineCheckInPaymentDetails extends StatefulWidget { + const EROnlineCheckInPaymentDetails(); + + @override + State createState() => _EROnlineCheckInPaymentDetailsState(); +} + +class _EROnlineCheckInPaymentDetailsState extends State { + ProjectViewModel projectViewModel; + + @override + void initState() { + super.initState(); + } + + @override + Widget build(BuildContext context) { + projectViewModel = Provider.of(context); + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).emergency + " ${TranslationBase.of(context).checkinOptions}", + isShowDecPage: false, + showNewAppBar: true, + showNewAppBarTitle: true, + backgroundColor: Color(0xffF8F8F8), + body: Padding( + padding: EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: double.infinity, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only(topLeft: Radius.circular(10), topRight: Radius.circular(10), bottomLeft: Radius.circular(10), bottomRight: Radius.circular(10)), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.1), + spreadRadius: 5, + blurRadius: 7, + offset: Offset(0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + TranslationBase.of(context).patientInfo, + style: TextStyle( + fontSize: 18, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24), + ), + mHeight(12), + Row( + children: [ + Text( + TranslationBase.of(context).patientName + ":", + style: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 12, + letterSpacing: -0.6, + color: CustomColors.grey, + ), + ), + mWidth(3), + Text( + projectViewModel.user.firstName + " " + projectViewModel.user.lastName, + style: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 14, + letterSpacing: -0.48, + ), + ), + ], + ), + Row( + children: [ + Text( + TranslationBase.of(context).mrn + ":", + style: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 12, + letterSpacing: -0.6, + color: CustomColors.grey, + ), + ), + mWidth(3), + Text( + projectViewModel.user.patientID.toString(), + style: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 14, + letterSpacing: -0.48, + ), + ), + ], + ), + ], + ), + ), + ), + mHeight(24), + Container( + width: double.infinity, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only(topLeft: Radius.circular(10), topRight: Radius.circular(10), bottomLeft: Radius.circular(10), bottomRight: Radius.circular(10)), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.1), + spreadRadius: 5, + blurRadius: 7, + offset: Offset(0, 3), // changes position of shadow + ), + ], + ), + child: Padding( + padding: EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "ER Visit Details", + style: TextStyle( + fontSize: 18, fontFamily: (projectViewModel.isArabic ? 'Cairo' : 'Poppins'), fontWeight: FontWeight.w700, color: Color(0xff2B353E), letterSpacing: -1.44, height: 35 / 24), + ), + mHeight(12), + Row( + children: [ + Text( + TranslationBase.of(context).hospital + ":", + style: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 12, + letterSpacing: -0.6, + color: CustomColors.grey, + ), + ), + mWidth(3), + Text( + "Olaya Hospital", + style: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 14, + letterSpacing: -0.48, + ), + ), + ], + ), + Row( + children: [ + Text( + TranslationBase.of(context).clinicName + ":", + style: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 12, + letterSpacing: -0.6, + color: CustomColors.grey, + ), + ), + mWidth(3), + Text( + "ER Clinic", + style: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 14, + letterSpacing: -0.48, + ), + ), + ], + ), + Row( + children: [ + Text( + "Time Check-In" + ":", + style: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 12, + letterSpacing: -0.6, + color: CustomColors.grey, + ), + ), + mWidth(3), + Text( + DateUtil.getMonthDayYearDateFormatted(DateTime.now()), + style: TextStyle( + fontWeight: FontWeight.w600, + fontSize: 14, + letterSpacing: -0.48, + ), + ), + ], + ), + ], + ), + ), + ) + ], + ), + ), + bottomSheet: Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only(topLeft: Radius.circular(10), topRight: Radius.circular(10), bottomLeft: Radius.circular(10), bottomRight: Radius.circular(10)), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.5), + spreadRadius: 5, + blurRadius: 7, + offset: Offset(0, 3), // changes position of shadow + ), + ], + ), + padding: EdgeInsets.only(left: 21, right: 21, top: 15, bottom: 15), + width: double.infinity, + // color: Colors.white, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + SizedBox(height: 12), + Text( + TranslationBase.of(context).YouCanPayByTheFollowingOptions, + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.w600, + color: Color(0xff2B353E), + letterSpacing: -0.64, + ), + ), + SizedBox( + width: MediaQuery.of(context).size.width * 0.75, + child: getPaymentMethods(), + ), + _amountView(TranslationBase.of(context).patientShareTotalToDo, "51.81" + " " + TranslationBase.of(context).sar, isBold: true, isTotal: true), + SizedBox(height: 12), + DefaultButton( + TranslationBase.of(context).payNow.toUpperCase(), + () {}, + color: CustomColors.green, + disabledColor: CustomColors.grey2, + ), + ], + ), + ), + ); + } + + _amountView(String title, String value, {bool isBold = false, bool isTotal = false}) { + return Padding( + padding: const EdgeInsets.only(top: 10, bottom: 10), + child: Row(children: [ + Expanded( + child: _getNormalText(title), + ), + Expanded( + child: _getNormalText(value, isBold: isBold, isTotal: isTotal), + ), + ]), + ); + } + + _getNormalText(text, {bool isBold = false, bool isTotal = false}) { + return Text( + text, + style: TextStyle( + fontSize: isBold + ? isTotal + ? 16 + : 12 + : 11, + letterSpacing: -0.5, + color: isBold ? Color(0xff2E303A) : Color(0xff575757), + fontWeight: isTotal ? FontWeight.bold : FontWeight.w600, + ), + ); + } +} diff --git a/lib/pages/landing/fragments/home_page_fragment2.dart b/lib/pages/landing/fragments/home_page_fragment2.dart index 6d013e8b..3d07a0bd 100644 --- a/lib/pages/landing/fragments/home_page_fragment2.dart +++ b/lib/pages/landing/fragments/home_page_fragment2.dart @@ -53,7 +53,10 @@ class _HomePageFragment2State extends State { hmgServices.add(new HmgServices(0, TranslationBase.of(context).book, TranslationBase.of(context).appointmentLabel, "assets/images/new/book appointment.svg", isLogin)); hmgServices.add(new HmgServices(1, TranslationBase.of(context).liveCare, TranslationBase.of(context).onlineConsulting, "assets/images/new/Live_Care.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(2, TranslationBase.of(context).emergencyTitle, TranslationBase.of(context).emergencySubtitle, "assets/images/new/emergency.svg", isLogin)); + hmgServices.add(new HmgServices(2, TranslationBase.of(context).emergency, TranslationBase.of(context).checkinOptions, "assets/images/new/emergency.svg", 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).online, TranslationBase.of(context).payment, "assets/images/new/paymentMethods.png", isLogin)); diff --git a/lib/pages/landing/widgets/services_view.dart b/lib/pages/landing/widgets/services_view.dart index 84682c64..f8db0e22 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/ChildVaccines/new/child_initial_page. 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/EROnlineCheckIn/EROnlineCheckInHome.dart'; import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; @@ -171,8 +172,8 @@ class ServicesView extends StatelessWidget { } else if (hmgServices.action == 1) { openLiveCare(context); } else if (hmgServices.action == 2) { - Navigator.push(context, FadePage(page: ErOptions(isAppbar: true))); - locator().hmgServices.logServiceName('emergency service'); + Navigator.push(context, FadePage(page: EROnlineCheckInHomePage())); + locator().hmgServices.logServiceName('ER Online CheckIn'); } else if (hmgServices.action == 3) { Navigator.push(context, FadePage(page: HomeHealthCarePage())); locator().hmgServices.logServiceName('home health care');