added parking part

pull/152/head
Fatimah.Alshammari 2 weeks ago
parent f3674ba06f
commit 62bb667cb8

@ -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/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_repo.dart';
import 'package:hmg_patient_app_new/features/todo_section/todo_section_view_model.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/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/analytics/analytics_service.dart';
import 'package:hmg_patient_app_new/services/cache_service.dart'; import 'package:hmg_patient_app_new/services/cache_service.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/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/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/presentation/medical_file/medical_file_page.dart';
import 'package:hmg_patient_app_new/services/dialog_service.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/services/navigation_service.dart';
import 'package:hmg_patient_app_new/theme/colors.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:hmg_patient_app_new/widgets/routes/custom_page_route.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.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; import '../../core/dependencies.dart' show getIt;
@ -108,27 +110,27 @@ class ServicesPage extends StatelessWidget {
true, true,
route: AppRoutes.homeHealthCarePage, route: AppRoutes.homeHealthCarePage,
), ),
HmgServicesComponentModel( // HmgServicesComponentModel(
12, // 12,
"Latest News".needTranslation, // "Latest News".needTranslation,
"".needTranslation, // "".needTranslation,
AppAssets.news, // AppAssets.news,
true, // true,
bgColor: AppColors.bgGreenColor, // bgColor: AppColors.bgGreenColor,
textColor: AppColors.blackColor, // textColor: AppColors.blackColor,
route: "https://twitter.com/HMG", // route: "https://twitter.com/HMG",
isExternalLink: true, // isExternalLink: true,
), // ),
HmgServicesComponentModel( // HmgServicesComponentModel(
12, // 12,
"Monthly Reports".needTranslation, // "Monthly Reports".needTranslation,
"".needTranslation, // "".needTranslation,
AppAssets.report_icon, // AppAssets.report_icon,
true, // true,
bgColor: AppColors.bgGreenColor, // bgColor: AppColors.bgGreenColor,
textColor: AppColors.blackColor, // textColor: AppColors.blackColor,
route: AppRoutes.monthlyReports, // route: AppRoutes.monthlyReports,
), // ),
]; ];
late final List<HmgServicesComponentModel> hmgHealthToolServices = [ late final List<HmgServicesComponentModel> hmgHealthToolServices = [
@ -169,17 +171,17 @@ class ServicesPage extends StatelessWidget {
route: AppRoutes.smartWatches, route: AppRoutes.smartWatches,
// route: AppRoutes.huaweiHealthExample, // route: AppRoutes.huaweiHealthExample,
), ),
HmgServicesComponentModel( // HmgServicesComponentModel(
12, // 12,
"Latest News".needTranslation, // "Latest News".needTranslation,
"".needTranslation, // "".needTranslation,
AppAssets.news, // AppAssets.news,
true, // true,
bgColor: AppColors.bgGreenColor, // bgColor: AppColors.bgGreenColor,
textColor: AppColors.blackColor, // textColor: AppColors.blackColor,
route: "https://twitter.com/HMG", // route: "https://twitter.com/HMG",
isExternalLink: true, // isExternalLink: true,
), // ),
HmgServicesComponentModel( HmgServicesComponentModel(
12, 12,
"Monthly Reports".needTranslation, "Monthly Reports".needTranslation,
@ -460,25 +462,42 @@ class ServicesPage extends StatelessWidget {
), ),
SizedBox(width: 16.w), SizedBox(width: 16.w),
Expanded( Expanded(
child: Container( child: InkWell(
decoration: RoundedRectangleBorder().toSmoothCornerDecoration( onTap: () {
color: AppColors.whiteColor, Navigator.push(
borderRadius: 12.h, context,
hasShadow: false, MaterialPageRoute(
), builder: (_) => ParkingPage(),
child: Padding( ),
padding: EdgeInsets.all(16.h), );
child: Row( },
children: [ child: Container(
Utils.buildSvgWithAssets( decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
icon: AppAssets.car_parking_icon, color: AppColors.whiteColor,
width: 32.w, borderRadius: 12.h,
height: 32.h, hasShadow: false,
fit: BoxFit.contain, ),
), child: Padding(
SizedBox(width: 8.w), padding: EdgeInsets.all(16.h),
"Car Parking".needTranslation.toText12(fontWeight: FontWeight.w500) 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(),
),
);
}),
), ),
), ),
), ),

@ -82,7 +82,7 @@ class _MonthlyReportsPageState extends State<MonthlyReportsPage> {
setState(() => isHealthSummaryEnabled = true); setState(() => isHealthSummaryEnabled = true);
_showSuccessSnackBar(); _showSuccessSnackBar();
} else { } else {
_showError("Failed to update".needTranslation); // _showError("Failed to update".needTranslation);
} }
} }

@ -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<ParkingPage> createState() => _ParkingPageState();
}
class _ParkingPageState extends State<ParkingPage> {
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,
),
),
),
),
),
),
],
),
);
}
}

@ -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<ParkingSlot> createState() => _ParkingSlotState();
}
class _ParkingSlotState extends State<ParkingSlot> {
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,
),
),
),
),
],
),
),
),
);
},
),
);
}
}

@ -89,7 +89,7 @@ class AppRoutes {
huaweiHealthExample: (context) => HuaweiHealthExample(), huaweiHealthExample: (context) => HuaweiHealthExample(),
// //
healthCalculatorsPage: (context) => HealthCalculatorsPage(), // healthCalculatorsPage: (context) => HealthCalculatorsPage(),
// monthlyReports: (context) => MonthlyReportsPage() // monthlyReports: (context) => MonthlyReportsPage()
monthlyReports: (context) => ChangeNotifierProvider( monthlyReports: (context) => ChangeNotifierProvider(
create: (_) => MonthlyReportsViewModel( create: (_) => MonthlyReportsViewModel(

Loading…
Cancel
Save