Good evening, I have two problems:
1) My List View is displayed above the background_gradient, and I want it to "hide" behind:
As can be seen in the photo, the long description, the bar with buttons, maps I have them inside a ListView and I would like it to hide behind the background above.
Code:
class lista_negocio_detalle extends StatefulWidget {
final Negocio value;
lista_negocio_detalle({Key key, this.value}) : super(key: key);
@override
_lista_negocio_detalle createState() => _lista_negocio_detalle();
}
class _lista_negocio_detalle extends State<lista_negocio_detalle> {
GoogleMapController myController;
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color(0xFFFAFAFA),
body: Stack(children: <Widget>[
gradiente_fondo(widget.value.title),
imagen_negocio(widget.value.imageUrl),
ListView(
children: <Widget>[
descripcion_detalle(widget.value.description),
fila_botones(widget.value.celular,widget.value.facebook,widget.value.x,widget.value.y),
map(widget.value.x, widget.value.y),
],
),
]));
}
}
2) The second problem is that I can't find in the GoogleMaps documentation how to put (icon or whatever) the location that I gave it for the focus. That is, I have the coordinates but I don't know how to show them with an icon.
Code:
child: GoogleMap(
onMapCreated: (controller) {
setState(() {
myController = controller;
});
},
myLocationEnabled: true,
scrollGesturesEnabled: false,
mapType: MapType.normal,
compassEnabled: false,
trackCameraPosition: true,
initialCameraPosition: CameraPosition(
tilt: (25.0),
zoom: 15.9,
target: LatLng(double.parse(x), double.parse(y)),
),
),
If you want it to hide, then change the order of the Stack
But be careful, it will not be displayed because it will have other widgets on top.
About your other question, here is the example to put Markers:
https://github.com/flutter/plugins/blob/master/packages/google_maps_flutter/example/lib/place_marker.dart