From 62bb667cb8edf7acec48982eaa021400bab47655 Mon Sep 17 00:00:00 2001 From: "Fatimah.Alshammari" Date: Wed, 31 Dec 2025 11:38:51 +0300 Subject: [PATCH] added parking part --- lib/core/dependencies.dart | 2 +- .../hmg_services/services_page.dart | 121 ++++++++------- .../monthly_reports/monthly_reports_page.dart | 2 +- lib/presentation/parking/paking_page.dart | 118 +++++++++++++++ lib/presentation/parking/parking_slot.dart | 142 ++++++++++++++++++ lib/routes/app_routes.dart | 2 +- 6 files changed, 333 insertions(+), 54 deletions(-) create mode 100644 lib/presentation/parking/paking_page.dart create mode 100644 lib/presentation/parking/parking_slot.dart diff --git a/lib/core/dependencies.dart b/lib/core/dependencies.dart index 2f45f37..555ce29 100644 --- a/lib/core/dependencies.dart +++ b/lib/core/dependencies.dart @@ -48,7 +48,7 @@ import 'package:hmg_patient_app_new/features/symptoms_checker/symptoms_checker_r import 'package:hmg_patient_app_new/features/symptoms_checker/symptoms_checker_view_model.dart'; import 'package:hmg_patient_app_new/features/todo_section/todo_section_repo.dart'; import 'package:hmg_patient_app_new/features/todo_section/todo_section_view_model.dart'; -import 'package:hmg_patient_app_new/presentation/health_calculators/health_calculator_view_model.dart'; +// import 'package:hmg_patient_app_new/presentation/health_calculators/health_calculator_view_model.dart'; import 'package:hmg_patient_app_new/presentation/monthly_reports/monthly_reports_page.dart'; import 'package:hmg_patient_app_new/services/analytics/analytics_service.dart'; import 'package:hmg_patient_app_new/services/cache_service.dart'; diff --git a/lib/presentation/hmg_services/services_page.dart b/lib/presentation/hmg_services/services_page.dart index bfd9f30..7ae7916 100644 --- a/lib/presentation/hmg_services/services_page.dart +++ b/lib/presentation/hmg_services/services_page.dart @@ -21,6 +21,7 @@ import 'package:hmg_patient_app_new/presentation/hmg_services/services_view.dart import 'package:hmg_patient_app_new/presentation/home/data/landing_page_data.dart'; import 'package:hmg_patient_app_new/presentation/home/widgets/large_service_card.dart'; import 'package:hmg_patient_app_new/presentation/medical_file/medical_file_page.dart'; + import 'package:hmg_patient_app_new/services/dialog_service.dart'; import 'package:hmg_patient_app_new/services/navigation_service.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; @@ -31,6 +32,7 @@ import 'package:hmg_patient_app_new/widgets/loader/bottomsheet_loader.dart'; import 'package:hmg_patient_app_new/widgets/routes/custom_page_route.dart'; import 'package:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; +import 'package:hmg_patient_app_new/presentation/parking/paking_page.dart'; import '../../core/dependencies.dart' show getIt; @@ -108,27 +110,27 @@ class ServicesPage extends StatelessWidget { true, route: AppRoutes.homeHealthCarePage, ), - HmgServicesComponentModel( - 12, - "Latest News".needTranslation, - "".needTranslation, - AppAssets.news, - true, - bgColor: AppColors.bgGreenColor, - textColor: AppColors.blackColor, - route: "https://twitter.com/HMG", - isExternalLink: true, - ), - HmgServicesComponentModel( - 12, - "Monthly Reports".needTranslation, - "".needTranslation, - AppAssets.report_icon, - true, - bgColor: AppColors.bgGreenColor, - textColor: AppColors.blackColor, - route: AppRoutes.monthlyReports, - ), + // HmgServicesComponentModel( + // 12, + // "Latest News".needTranslation, + // "".needTranslation, + // AppAssets.news, + // true, + // bgColor: AppColors.bgGreenColor, + // textColor: AppColors.blackColor, + // route: "https://twitter.com/HMG", + // isExternalLink: true, + // ), + // HmgServicesComponentModel( + // 12, + // "Monthly Reports".needTranslation, + // "".needTranslation, + // AppAssets.report_icon, + // true, + // bgColor: AppColors.bgGreenColor, + // textColor: AppColors.blackColor, + // route: AppRoutes.monthlyReports, + // ), ]; late final List hmgHealthToolServices = [ @@ -169,17 +171,17 @@ class ServicesPage extends StatelessWidget { route: AppRoutes.smartWatches, // route: AppRoutes.huaweiHealthExample, ), - HmgServicesComponentModel( - 12, - "Latest News".needTranslation, - "".needTranslation, - AppAssets.news, - true, - bgColor: AppColors.bgGreenColor, - textColor: AppColors.blackColor, - route: "https://twitter.com/HMG", - isExternalLink: true, - ), + // HmgServicesComponentModel( + // 12, + // "Latest News".needTranslation, + // "".needTranslation, + // AppAssets.news, + // true, + // bgColor: AppColors.bgGreenColor, + // textColor: AppColors.blackColor, + // route: "https://twitter.com/HMG", + // isExternalLink: true, + // ), HmgServicesComponentModel( 12, "Monthly Reports".needTranslation, @@ -460,25 +462,42 @@ class ServicesPage extends StatelessWidget { ), SizedBox(width: 16.w), Expanded( - child: Container( - decoration: RoundedRectangleBorder().toSmoothCornerDecoration( - color: AppColors.whiteColor, - borderRadius: 12.h, - hasShadow: false, - ), - child: Padding( - padding: EdgeInsets.all(16.h), - child: Row( - children: [ - Utils.buildSvgWithAssets( - icon: AppAssets.car_parking_icon, - width: 32.w, - height: 32.h, - fit: BoxFit.contain, - ), - SizedBox(width: 8.w), - "Car Parking".needTranslation.toText12(fontWeight: FontWeight.w500) - ], + child: InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (_) => ParkingPage(), + ), + ); + }, + child: Container( + decoration: RoundedRectangleBorder().toSmoothCornerDecoration( + color: AppColors.whiteColor, + borderRadius: 12.h, + hasShadow: false, + ), + child: Padding( + padding: EdgeInsets.all(16.h), + child: Row( + children: [ + Utils.buildSvgWithAssets( + icon: AppAssets.car_parking_icon, + width: 32.w, + height: 32.h, + fit: BoxFit.contain, + ), + SizedBox(width: 8.w), + "Car Parking".needTranslation.toText12(fontWeight: FontWeight.w500) + ], + ).onPress(() { + Navigator.push( + context, + MaterialPageRoute( + builder: (_) => ParkingPage(), + ), + ); + }), ), ), ), diff --git a/lib/presentation/monthly_reports/monthly_reports_page.dart b/lib/presentation/monthly_reports/monthly_reports_page.dart index 78c3f30..d1a4d0c 100644 --- a/lib/presentation/monthly_reports/monthly_reports_page.dart +++ b/lib/presentation/monthly_reports/monthly_reports_page.dart @@ -82,7 +82,7 @@ class _MonthlyReportsPageState extends State { setState(() => isHealthSummaryEnabled = true); _showSuccessSnackBar(); } else { - _showError("Failed to update".needTranslation); + // _showError("Failed to update".needTranslation); } } diff --git a/lib/presentation/parking/paking_page.dart b/lib/presentation/parking/paking_page.dart new file mode 100644 index 0000000..ce9b6ab --- /dev/null +++ b/lib/presentation/parking/paking_page.dart @@ -0,0 +1,118 @@ + + +import 'package:flutter/material.dart'; +import 'package:hmg_patient_app_new/core/app_export.dart'; +import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; +import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; +import 'package:hmg_patient_app_new/presentation/parking/parking_slot.dart'; +import 'package:mobile_scanner/mobile_scanner.dart'; + +import '../../theme/colors.dart'; +import '../../widgets/appbar/app_bar_widget.dart'; +import '../../widgets/routes/custom_page_route.dart'; + +class ParkingPage extends StatefulWidget { + const ParkingPage({super.key}); + + @override + State createState() => _ParkingPageState(); +} + +class _ParkingPageState extends State { + String? scannedCode; + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.scaffoldBgColor, + appBar: CustomAppBar( + onBackPressed: () => Navigator.of(context).pop(), + onLanguageChanged: (_) {}, + hideLogoAndLang: true, + ), + body: Column( + children: [ + Expanded( + child: SingleChildScrollView( + padding: const EdgeInsets.symmetric(horizontal: 16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text("Parking".needTranslation, + style: TextStyle( + color: AppColors.textColor, + fontSize: 27.f, + fontWeight: FontWeight.w600)), + Container( + decoration: RoundedRectangleBorder() + .toSmoothCornerDecoration( + color: AppColors.whiteColor, + borderRadius: 24.r, + hasShadow: true, + ), + // margin: EdgeInsets.all(10), + child: Padding( + padding: EdgeInsets.all(16.h), + child: Text( + "Dr. Sulaiman Al Habib hospital are conduction a test for the emerging corona" + " virus and issuing travel certificates 24/7 in a short time and with high accuracy." + " Those wishing to benefit from this service can visit one of Dr. Sulaiman Al Habib branches " + "to conduct a corona test within few minutes. Dr. Sulaiman Al Habib hospital are conduction" + " a test for the emerging corona virus and issuing travel certificates 24/7 in a short time and with high accuracy. " + "Those wishing to benefit from this service can visit one of Dr. Sulaiman Al Habib branches to conduct a corona test within few minutes.", + style: TextStyle( + color: AppColors.textColor, + fontSize: 12, height: 1.4, fontWeight: FontWeight.w500), + ), + ), + ).paddingOnly( top: 16, bottom: 16), + + ], + ), + ), + ), + + /// Bottom button + Container + ( + decoration: RoundedRectangleBorder() + .toSmoothCornerDecoration( + color: AppColors.whiteColor, + borderRadius: 24.r, + hasShadow: true, + ), + child: Padding( + padding: EdgeInsets.all(24.h), + child: SizedBox( + width: double.infinity, + height: 56, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: AppColors.primaryRedColor, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + ), + onPressed: () { + Navigator.of(context).push( + CustomPageRoute( + page: ParkingSlot(), + ) ); + }, + child: Text( + "Read Barcodes", + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + color: Colors.white, + ), + ), + ), + ), + ), + ), + ], + ), + ); + } +} diff --git a/lib/presentation/parking/parking_slot.dart b/lib/presentation/parking/parking_slot.dart new file mode 100644 index 0000000..094dcb7 --- /dev/null +++ b/lib/presentation/parking/parking_slot.dart @@ -0,0 +1,142 @@ + + + + +import 'package:flutter/material.dart'; +import 'package:hmg_patient_app_new/core/app_export.dart'; +import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; +import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; +import 'package:mobile_scanner/mobile_scanner.dart'; + +import '../../theme/colors.dart'; +import '../../widgets/appbar/app_bar_widget.dart'; +import '../../widgets/chip/app_custom_chip_widget.dart'; + +class ParkingSlot extends StatefulWidget { + const ParkingSlot({super.key}); + + @override + State createState() => _ParkingSlotState(); +} + +class _ParkingSlotState extends State { + String? scannedCode; + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.scaffoldBgColor, + appBar: CustomAppBar( + onBackPressed: () => Navigator.of(context).pop(), + onLanguageChanged: (_) {}, + hideLogoAndLang: true, + ), + body: LayoutBuilder( + builder: (context, constraints) { + final maxW = constraints.maxWidth; + final contentW = maxW > 600 ? 600.0 : maxW; // حد أقصى للتابلت + + return Align( + alignment: Alignment.topCenter, + child: SizedBox( + width: contentW, + child: Padding( + padding: EdgeInsets.all(16.h), + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Container( + width: double.infinity, + decoration: RoundedRectangleBorder().toSmoothCornerDecoration( + color: AppColors.whiteColor, + borderRadius: 24.r, + hasShadow: true, + ), + child: Padding( + padding: EdgeInsets.all(16.h), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + "Parking Slot Details", + style: TextStyle( + fontSize: 16.f, + fontWeight: FontWeight.w600, + color: AppColors.textColor, + ), + ), + SizedBox(height: 16.h), + Wrap( + spacing: 4, + runSpacing: 4, + children: [ + AppCustomChipWidget(labelText: "Slot: B-24".needTranslation), + AppCustomChipWidget(labelText: "Basement: Zone B".needTranslation), + AppCustomChipWidget(labelText: "Date: 16 Dec 2025".needTranslation), + AppCustomChipWidget(labelText: "Parked Since: 10:32 AM".needTranslation), + ], + ), + ], + ), + ), + ), + + SizedBox(height: 24.h), + + SizedBox( + width: double.infinity, + height: 48.h, + child: ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: AppColors.primaryRedColor, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + ), + onPressed: () {}, + child: Text( + "Get Direction", + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + color: Colors.white, + ), + ), + ), + ), + + const Spacer(), + SizedBox( + width: double.infinity, + height: 48.h, + child: OutlinedButton( + style: OutlinedButton.styleFrom( + side: BorderSide(color: AppColors.primaryRedColor), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(10), + ), + ), + onPressed: () { + // Reset direction logic + }, + child: Text( + "Reset Direction", + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w600, + color: AppColors.primaryRedColor, + ), + ), + ), + ), + ], + ), + ), + ), + ); + }, + ), + + ); + } +} diff --git a/lib/routes/app_routes.dart b/lib/routes/app_routes.dart index 970d2b9..db38e78 100644 --- a/lib/routes/app_routes.dart +++ b/lib/routes/app_routes.dart @@ -89,7 +89,7 @@ class AppRoutes { huaweiHealthExample: (context) => HuaweiHealthExample(), // - healthCalculatorsPage: (context) => HealthCalculatorsPage(), + // healthCalculatorsPage: (context) => HealthCalculatorsPage(), // monthlyReports: (context) => MonthlyReportsPage() monthlyReports: (context) => ChangeNotifierProvider( create: (_) => MonthlyReportsViewModel(