@ -1,8 +1,10 @@
import ' dart:async ' ;
import ' package:easy_localization/easy_localization.dart ' ;
import ' package:flutter/material.dart ' ;
import ' package:hmg_patient_app_new/core/app_export.dart ' ;
import ' package:hmg_patient_app_new/extensions/widget_extensions.dart ' ;
import ' package:hmg_patient_app_new/generated/locale_keys.g.dart ' ;
import ' package:hmg_patient_app_new/theme/colors.dart ' ;
import ' package:huawei_map/huawei_map.dart ' ;
@ -37,9 +39,9 @@ class _HMSMapState extends State<HMSMap> {
late MapType _selectedMapType ;
bool _showMapTypeSelector = false ;
static const List < _MapTypeOption > _mapTypeOptions = [
_MapTypeOption ( type: MapType . normal , label: ' Default ' , icon: Icons . map_outlined ) ,
_MapTypeOption ( type: MapType . terrain , label: ' Terrain ' , icon: Icons . terrain_outlined ) ,
final List < _MapTypeOption > _mapTypeOptions = [
_MapTypeOption ( type: MapType . normal , label: LocaleKeys . normalMapType . tr ( ) , icon: Icons . map_outlined ) ,
_MapTypeOption ( type: MapType . terrain , label: LocaleKeys . terrainMapType . tr ( ) , icon: Icons . terrain_outlined ) ,
] ;
@ override
@ -91,9 +93,9 @@ class _HMSMapState extends State<HMSMap> {
) ,
/ / ─ ─ Map - type toggle + panel ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─
Positioned (
top: 16 .h ,
right : 16. w ,
Positioned Directional (
top: 48 .h ,
end : 16. w ,
child: Column (
crossAxisAlignment: CrossAxisAlignment . end ,
children: [
@ -144,16 +146,13 @@ class _MapTypeToggleButton extends StatelessWidget {
width: 42. w ,
height: 42. h ,
decoration: BoxDecoration (
color: isActive ? AppColors . primaryRedColor : Colors. white ,
color: isActive ? AppColors . primaryRedColor : App Colors. white Color ,
borderRadius: BorderRadius . circular ( 8. r ) ,
boxShadow: const [
BoxShadow ( color: Colors . black26 , blurRadius: 6 , offset: Offset ( 0 , 2 ) ) ,
] ,
) ,
child: Icon (
Icons . layers ,
size: 22. h ,
color: isActive ? Colors. white : Colors . black87 ,
color: isActive ? AppColors. whiteColor : AppColors . blackBgColor ,
) ,
) ,
) ;
@ -180,11 +179,9 @@ class _MapTypeSelectorPanel extends StatelessWidget {
margin: EdgeInsets . only ( top: 8. h ) ,
padding: EdgeInsets . symmetric ( vertical: 8. h , horizontal: 6. w ) ,
decoration: BoxDecoration (
color: Colors. white ,
color: App Colors. white Color ,
borderRadius: BorderRadius . circular ( 12. r ) ,
boxShadow: const [
BoxShadow ( color: Colors . black26 , blurRadius: 8 , offset: Offset ( 0 , 3 ) ) ,
] ,
) ,
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
@ -233,7 +230,7 @@ class _MapTypeItem extends StatelessWidget {
Icon (
option . icon ,
size: 18. h ,
color: isSelected ? AppColors . primaryRedColor : Colors. black54 ,
color: isSelected ? AppColors . primaryRedColor : AppColors. blackBgColor ,
) ,
SizedBox ( width: 8. w ) ,
Text (
@ -241,7 +238,7 @@ class _MapTypeItem extends StatelessWidget {
style: TextStyle (
fontSize: 14. f ,
fontWeight: isSelected ? FontWeight . w600 : FontWeight . w400 ,
color: isSelected ? AppColors . primaryRedColor : Colors . black87 ,
color: isSelected ? AppColors . primaryRedColor : AppColors . blackBgColor ,
) ,
) ,
] ,