import 'package:flutter/material.dart'; import 'package:hmg_patient_app_new/core/app_assets.dart'; import 'package:hmg_patient_app_new/core/app_export.dart'; import 'package:hmg_patient_app_new/core/utils/utils.dart'; import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; import 'package:hmg_patient_app_new/features/hmg_services/models/ui_models/hmg_services_component_model.dart'; import 'package:hmg_patient_app_new/presentation/hmg_services/services_view.dart'; import 'package:hmg_patient_app_new/theme/colors.dart'; import 'package:hmg_patient_app_new/widgets/appbar/collapsing_list_view.dart'; class ServicesPage extends StatelessWidget { ServicesPage({super.key}); final List hmgServices = [ HmgServicesComponentModel( 11, "E Referral Services".needTranslation, "".needTranslation, AppAssets.eReferral, true, bgColor: Colors.orange, textColor: AppColors.blackColor, route: AppRoutes.eReferralPage, ), HmgServicesComponentModel( 5, "Comprehensive Checkup".needTranslation, "".needTranslation, AppAssets.comprehensiveCheckup, true, bgColor: AppColors.bgGreenColor, textColor: AppColors.blackColor, route: AppRoutes.comprehensiveCheckupPage, ), HmgServicesComponentModel( 3, "Home Health Care".needTranslation, "".needTranslation, AppAssets.emergency_services_icon, true, bgColor: AppColors.bgGreenColor, textColor: AppColors.blackColor, route: AppRoutes.homeHealthCarePage, ), HmgServicesComponentModel( 11, "Virtual Tour".needTranslation, "".needTranslation, AppAssets.my_address, true, bgColor: Colors.orange, textColor: AppColors.blackColor, route: null, onTap: () { Utils.openWebView( url: 'https://hmgwebservices.com/vt_mobile/html/index.html', ); }, ), HmgServicesComponentModel( 12, "Health Calculators".needTranslation, "".needTranslation, AppAssets.calendar, true, bgColor: Colors.blueAccent, textColor: AppColors.blackColor, route: AppRoutes.healthCalculatorsPage, ) ]; @override Widget build(BuildContext context) { return CollapsingListView( title: "Explore Services".needTranslation, isLeading: Navigator.canPop(context), child: Padding( padding: EdgeInsets.symmetric(horizontal: 24.h), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ "Medical & Care Services".needTranslation.toText18(isBold: true), SizedBox(height: 20.h), Padding( padding: EdgeInsets.only(left: 16.w, right: 16.w, top: 0), child: GridView.builder( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( crossAxisCount: 3, // 4 icons per row crossAxisSpacing: 24.w, mainAxisSpacing: 0.h, childAspectRatio: 0.85, ), physics: NeverScrollableScrollPhysics(), shrinkWrap: true, itemCount: hmgServices.length, padding: EdgeInsets.zero, itemBuilder: (BuildContext context, int index) { return ServiceGridViewItem(hmgServices[index], index, false); }, ), ) ], ), ), ); } }