BASE: Update Icons & Name Of The App.
This commit is contained in:
@@ -2,7 +2,7 @@ import 'dart:convert';
|
||||
import 'package:customer/widget/osm_map/place_model.dart';
|
||||
import 'package:flutter_map/flutter_map.dart';
|
||||
import 'package:geolocator/geolocator.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get.dart' hide Trans;
|
||||
import 'package:http/http.dart' as http;
|
||||
import '../../utils/utils.dart';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
@@ -20,11 +20,15 @@ class OSMMapController extends GetxController {
|
||||
}
|
||||
|
||||
final url = Uri.parse(
|
||||
'https://nominatim.openstreetmap.org/search?q=$query&format=json&addressdetails=1&limit=10');
|
||||
'https://nominatim.openstreetmap.org/search?q=$query&format=json&addressdetails=1&limit=10',
|
||||
);
|
||||
|
||||
final response = await http.get(url, headers: {
|
||||
'User-Agent': 'FlutterMapApp/1.0 (menil.siddhiinfosoft@gmail.com)',
|
||||
});
|
||||
final response = await http.get(
|
||||
url,
|
||||
headers: {
|
||||
'User-Agent': 'FlutterMapApp/1.0 (menil.siddhiinfosoft@gmail.com)',
|
||||
},
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
final data = json.decode(response.body);
|
||||
@@ -52,11 +56,15 @@ class OSMMapController extends GetxController {
|
||||
|
||||
Future<String> _getAddressFromLatLng(LatLng coords) async {
|
||||
final url = Uri.parse(
|
||||
'https://nominatim.openstreetmap.org/reverse?lat=${coords.latitude}&lon=${coords.longitude}&format=json');
|
||||
'https://nominatim.openstreetmap.org/reverse?lat=${coords.latitude}&lon=${coords.longitude}&format=json',
|
||||
);
|
||||
|
||||
final response = await http.get(url, headers: {
|
||||
'User-Agent': 'FlutterMapApp/1.0 (menil.siddhiinfosoft@gmail.com)',
|
||||
});
|
||||
final response = await http.get(
|
||||
url,
|
||||
headers: {
|
||||
'User-Agent': 'FlutterMapApp/1.0 (menil.siddhiinfosoft@gmail.com)',
|
||||
},
|
||||
);
|
||||
|
||||
if (response.statusCode == 200) {
|
||||
final data = json.decode(response.body);
|
||||
@@ -79,10 +87,13 @@ class OSMMapController extends GetxController {
|
||||
|
||||
Future<void> getCurrentLocation() async {
|
||||
Position? location = await Utils.getCurrentLocation();
|
||||
LatLng latlng =
|
||||
LatLng(location?.latitude ?? 0.0, location?.longitude ?? 0.0);
|
||||
LatLng latlng = LatLng(
|
||||
location?.latitude ?? 0.0,
|
||||
location?.longitude ?? 0.0,
|
||||
);
|
||||
addLatLngOnly(
|
||||
LatLng(location?.latitude ?? 0.0, location?.longitude ?? 0.0));
|
||||
LatLng(location?.latitude ?? 0.0, location?.longitude ?? 0.0),
|
||||
);
|
||||
mapController.move(latlng, mapController.camera.zoom);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user