refactor: migrate amount fields to decimal and implement location service restriction for unsupported regions
This commit is contained in:
@@ -11,6 +11,7 @@ import 'package:permission_handler/permission_handler.dart' as ph;
|
||||
import 'package:socket_io_client/socket_io_client.dart' as IO;
|
||||
import 'package:siro_driver/constant/table_names.dart';
|
||||
import 'package:trip_overlay_plugin/trip_overlay_plugin.dart';
|
||||
import '../../constant/country_polygons.dart';
|
||||
import '../../constant/box_name.dart';
|
||||
import '../../constant/links.dart';
|
||||
import '../../main.dart';
|
||||
@@ -559,7 +560,11 @@ class LocationController extends GetxController with WidgetsBindingObserver {
|
||||
final now = DateTime.now();
|
||||
final pos = LatLng(loc.latitude!, loc.longitude!);
|
||||
|
||||
myLocation = pos;
|
||||
if (!CountryPolygons.isServiceSupported(pos)) {
|
||||
myLocation = const LatLng(31.9539, 35.9106);
|
||||
} else {
|
||||
myLocation = pos;
|
||||
}
|
||||
speed = loc.speed ?? 0.0;
|
||||
heading = loc.heading ?? 0.0;
|
||||
|
||||
@@ -863,7 +868,12 @@ class LocationController extends GetxController with WidgetsBindingObserver {
|
||||
if (locData != null &&
|
||||
locData.latitude != null &&
|
||||
locData.longitude != null) {
|
||||
myLocation = LatLng(locData.latitude!, locData.longitude!);
|
||||
final rawPos = LatLng(locData.latitude!, locData.longitude!);
|
||||
if (!CountryPolygons.isServiceSupported(rawPos)) {
|
||||
myLocation = const LatLng(31.9539, 35.9106);
|
||||
} else {
|
||||
myLocation = rawPos;
|
||||
}
|
||||
heading = locData.heading ?? 0.0;
|
||||
speed = locData.speed ?? 0.0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user