busca la ciudad

This commit is contained in:
Felipe
2023-10-26 11:11:23 -05:00
parent e8f2a4a6c2
commit 9cab5a908d
+19 -3
View File
@@ -226,9 +226,25 @@ class _ServiceScreenState extends State<ServiceScreen> {
if (_coordsOfCity == '0.0,0.0') {
AuthenticationRepository.instance
.getCoordsOfCity(uid.toString())
.then((String s) => setState(() {
_coordsOfCity = s;
}));
.then((String s) {
setState(() {
_coordsOfCity = s;
});
if (_coordsOfCity != '0.0,0.0') {
List<String> coords = _coordsOfCity.split(',');
double lat = double.parse(coords[0]);
double lng = double.parse(coords[1]);
// Asegúrate de que googleMapController esté disponible y no sea nulo
googleMapController.moveCamera(
CameraUpdate.newLatLngZoom(
LatLng(lat, lng),
14.4746, // Puedes ajustar el nivel de zoom según tus necesidades
),
);
}
});
}
_saveToken();