feat: add service area restriction overlay and bump version to 1.0.3+8

This commit is contained in:
Hamza-Ayed
2026-08-11 00:14:03 +03:00
parent e52afa1863
commit bb9517826e
10 changed files with 128 additions and 55 deletions
@@ -451,42 +451,87 @@ class _MapView extends StatelessWidget {
return GetBuilder<SettingController>(
builder: (s) => GetBuilder<LocationController>(
builder: (loc) => IntaleqMap(
apiKey: Env.mapSaasKey,
onMapCreated: ctrl.onMapCreated,
onStyleLoaded: ctrl.onStyleLoaded,
minMaxZoomPreference: const MinMaxZoomPreference(6, 18),
initialCameraPosition: CameraPosition(
target: (loc.myLocation.latitude == 0 ||
loc.myLocation.latitude.isNaN)
? ctrl.myLocation
: loc.myLocation,
zoom: 15,
),
mapType: s.isMapDarkMode
? IntaleqMapType.normal
: IntaleqMapType.light,
polygons: {
...ctrl.heatmapPolygons,
...ctrl.predictivePolygons,
},
markers: {
Marker(
markerId: MarkerId('MyLocation'.tr),
position: loc.myLocation,
rotation: loc.heading,
flat: true,
anchor: const Offset(0.5, 0.5),
icon: ctrl.carIcon,
)
},
myLocationButtonEnabled: false,
myLocationEnabled: false,
compassEnabled: false,
zoomControlsEnabled: false,
onCameraMove: (CameraPosition position) {
ctrl.currentCameraPosition = position;
},
builder: (loc) => Stack(
children: [
IntaleqMap(
apiKey: Env.mapSaasKey,
onMapCreated: ctrl.onMapCreated,
onStyleLoaded: ctrl.onStyleLoaded,
minMaxZoomPreference: const MinMaxZoomPreference(6, 18),
initialCameraPosition: CameraPosition(
target: (loc.myLocation.latitude == 0 ||
loc.myLocation.latitude.isNaN)
? ctrl.myLocation
: loc.myLocation,
zoom: 15,
),
mapType: s.isMapDarkMode
? IntaleqMapType.normal
: IntaleqMapType.light,
polygons: {
...ctrl.heatmapPolygons,
...ctrl.predictivePolygons,
},
markers: {
Marker(
markerId: MarkerId('MyLocation'.tr),
position: loc.myLocation,
rotation: loc.heading,
flat: true,
anchor: const Offset(0.5, 0.5),
icon: ctrl.carIcon,
)
},
myLocationButtonEnabled: false,
myLocationEnabled: false,
compassEnabled: false,
zoomControlsEnabled: false,
onCameraMove: (CameraPosition position) {
ctrl.currentCameraPosition = position;
},
),
if (loc.isOutsideServiceArea)
Positioned.fill(
child: Container(
color: Colors.black.withOpacity(0.6),
child: Center(
child: Card(
margin: const EdgeInsets.symmetric(horizontal: 24),
color: _Token.surfaceCard(context),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16)),
elevation: 10,
child: Padding(
padding: const EdgeInsets.all(24.0),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const Icon(Icons.location_off_rounded,
size: 64, color: Colors.redAccent),
const SizedBox(height: 16),
Text(
'service_unavailable_area'.tr,
textAlign: TextAlign.center,
style: const TextStyle(
fontSize: 18,
fontWeight: FontWeight.bold),
),
const SizedBox(height: 12),
Text(
'This service is not available in your current area.'
.tr,
textAlign: TextAlign.center,
style: const TextStyle(
color: Colors.grey, fontSize: 14),
),
],
),
),
),
),
),
),
],
),
),
);
@@ -59,7 +59,7 @@ class OsmMapView extends StatelessWidget {
// You can assign this controller if needed
},
),
if (!inServiceArea)
if (inServiceArea)
Positioned(
bottom: 20,
left: 20,