diff --git a/lib/src/screens/service.dart b/lib/src/screens/service.dart index 6adef7b..f36c704 100644 --- a/lib/src/screens/service.dart +++ b/lib/src/screens/service.dart @@ -839,6 +839,7 @@ class _ServiceScreenState extends State { const SizedBox(height: 15), TextFormField( controller: _locationController, + readOnly: ubicacion == 'sitio' ? true : false, decoration: const InputDecoration( prefixIcon: Icon(Icons.near_me), hintText: 'Dirección', @@ -849,46 +850,46 @@ class _ServiceScreenState extends State { placeAutoComplete(modifiedValue); }, ), - SizedBox( - height: _placesList.isNotEmpty - ? 200 - : 0, // Ajusta la altura según tus necesidades - child: ListView.builder( - itemCount: _placesList.length, - itemBuilder: (context, index) { - return ListTile( - onTap: () { - final selectedAddress = - _placesList[index] - ['formatted_address']; - final selectedLatitude = - _placesList[index]['geometry'] - ['location']['lat']; - final selectedLongitude = - _placesList[index]['geometry'] - ['location']['lng']; + ubicacion == 'sitio' + ? const SizedBox.shrink() + : SizedBox( + height: _placesList.isNotEmpty ? 200 : 0, + child: ListView.builder( + itemCount: _placesList.length, + itemBuilder: (context, index) { + return ListTile( + onTap: () { + final selectedAddress = + _placesList[index] + ['formatted_address']; + final selectedLatitude = + _placesList[index]['geometry'] + ['location']['lat']; + final selectedLongitude = + _placesList[index]['geometry'] + ['location']['lng']; - _locationController.text = - selectedAddress; + _locationController.text = + selectedAddress; - final newCoordinates = LatLng( - selectedLatitude, - selectedLongitude); - googleMapController.animateCamera( - CameraUpdate.newLatLng( - newCoordinates), - ); + final newCoordinates = LatLng( + selectedLatitude, + selectedLongitude); + googleMapController.animateCamera( + CameraUpdate.newLatLng( + newCoordinates), + ); - setState(() { - _placesList = []; - }); - }, - title: Text(_placesList[index] - ['formatted_address']), - ); - }, - ), - ), + setState(() { + _placesList = []; + }); + }, + title: Text(_placesList[index] + ['formatted_address']), + ); + }, + ), + ), const SizedBox(height: 15), Row( children: [