diff --git a/lib/src/screens/service.dart b/lib/src/screens/service.dart index f36c704..642c6f9 100644 --- a/lib/src/screens/service.dart +++ b/lib/src/screens/service.dart @@ -226,9 +226,25 @@ class _ServiceScreenState extends State { 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 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();