mapa mas pequeño

This commit is contained in:
Felipe
2023-09-01 19:11:46 -05:00
parent 0d1a06bcf9
commit 3a6db40866
+31 -21
View File
@@ -599,14 +599,12 @@ class _ServiceScreenState extends State<ServiceScreen> {
child: Scaffold( child: Scaffold(
backgroundColor: const Color(0xFFD6F4FF), backgroundColor: const Color(0xFFD6F4FF),
drawer: DrawerMenu(), drawer: DrawerMenu(),
body: SingleChildScrollView( body: Column(
reverse: true,
child: Column(
children: [ children: [
Stack( Stack(
children: [ children: [
SizedBox( SizedBox(
height: MediaQuery.of(context).size.height * 0.6, height: MediaQuery.of(context).size.height * 0.5,
child: GoogleMap( child: GoogleMap(
mapType: MapType.normal, mapType: MapType.normal,
initialCameraPosition: initialCameraPosition, initialCameraPosition: initialCameraPosition,
@@ -633,8 +631,7 @@ class _ServiceScreenState extends State<ServiceScreen> {
coordinates = position.target; coordinates = position.target;
}); });
}, },
gestureRecognizers: <Factory< gestureRecognizers: <Factory<OneSequenceGestureRecognizer>>{
OneSequenceGestureRecognizer>>{
Factory<OneSequenceGestureRecognizer>( Factory<OneSequenceGestureRecognizer>(
() => EagerGestureRecognizer(), () => EagerGestureRecognizer(),
), ),
@@ -713,12 +710,14 @@ class _ServiceScreenState extends State<ServiceScreen> {
), ),
], ],
), ),
Container( Expanded(
child: SingleChildScrollView(
child: Container(
width: double.infinity, width: double.infinity,
height: MediaQuery.of(context).size.height * 0.5,
decoration: const BoxDecoration(color: Colors.white), decoration: const BoxDecoration(color: Colors.white),
child: Column( child: Column(
children: [ children: [
const SizedBox(height: 5),
SizedBox( SizedBox(
width: 320, width: 320,
child: Form( child: Form(
@@ -741,12 +740,14 @@ class _ServiceScreenState extends State<ServiceScreen> {
if (serviceType != null) { if (serviceType != null) {
setState(() { setState(() {
_serviceType = serviceType; _serviceType = serviceType;
_serviceTypeController.text = _serviceType; _serviceTypeController.text =
_serviceType;
}); });
} }
}, },
decoration: const InputDecoration( decoration: const InputDecoration(
prefixIcon: Icon(Icons.room_service_rounded), prefixIcon:
Icon(Icons.room_service_rounded),
suffixIcon: Icon(Icons.arrow_drop_down), suffixIcon: Icon(Icons.arrow_drop_down),
hintText: 'Tipo de Servicio'), hintText: 'Tipo de Servicio'),
), ),
@@ -757,7 +758,8 @@ class _ServiceScreenState extends State<ServiceScreen> {
controller: _profesionalController, controller: _profesionalController,
readOnly: true, readOnly: true,
onTap: () async { onTap: () async {
final dynamic datos = await Navigator.push( final dynamic datos =
await Navigator.push(
context, context,
CupertinoPageRoute( CupertinoPageRoute(
builder: (BuildContext context) { builder: (BuildContext context) {
@@ -802,12 +804,16 @@ class _ServiceScreenState extends State<ServiceScreen> {
_locationController.text = _locationController.text =
profesional.realAddress; profesional.realAddress;
if (professionalLatitude != null && if (professionalLatitude !=
null &&
professionalLatitude != 0 && professionalLatitude != 0 &&
professionalLongitude != null && professionalLongitude !=
null &&
professionalLongitude != 0) { professionalLongitude != 0) {
googleMapController.animateCamera( googleMapController
CameraUpdate.newCameraPosition( .animateCamera(
CameraUpdate
.newCameraPosition(
CameraPosition( CameraPosition(
target: LatLng( target: LatLng(
professionalLatitude!, professionalLatitude!,
@@ -852,7 +858,8 @@ class _ServiceScreenState extends State<ServiceScreen> {
itemBuilder: (context, index) { itemBuilder: (context, index) {
return ListTile( return ListTile(
onTap: () { onTap: () {
final selectedAddress = _placesList[index] final selectedAddress =
_placesList[index]
['formatted_address']; ['formatted_address'];
final selectedLatitude = final selectedLatitude =
_placesList[index]['geometry'] _placesList[index]['geometry']
@@ -865,9 +872,11 @@ class _ServiceScreenState extends State<ServiceScreen> {
selectedAddress; selectedAddress;
final newCoordinates = LatLng( final newCoordinates = LatLng(
selectedLatitude, selectedLongitude); selectedLatitude,
selectedLongitude);
googleMapController.animateCamera( googleMapController.animateCamera(
CameraUpdate.newLatLng(newCoordinates), CameraUpdate.newLatLng(
newCoordinates),
); );
setState(() { setState(() {
@@ -923,7 +932,8 @@ class _ServiceScreenState extends State<ServiceScreen> {
controller: TextEditingController( controller: TextEditingController(
text: _selectedDate == null text: _selectedDate == null
? '' ? ''
: formatter.format(_selectedDate!)), : formatter
.format(_selectedDate!)),
), ),
), ),
SizedBox( SizedBox(
@@ -1069,7 +1079,6 @@ class _ServiceScreenState extends State<ServiceScreen> {
), ),
), ),
), ),
const SizedBox(height: 15),
], ],
), ),
), ),
@@ -1077,9 +1086,10 @@ class _ServiceScreenState extends State<ServiceScreen> {
], ],
), ),
), ),
],
), ),
), ),
],
),
), ),
); );
} }