Skip to content

Instantly share code, notes, and snippets.

@fvisticot
Created December 1, 2018 09:13
Show Gist options
  • Save fvisticot/3a77ed847d6ddfcaadb68120cb12daea to your computer and use it in GitHub Desktop.
Save fvisticot/3a77ed847d6ddfcaadb68120cb12daea to your computer and use it in GitHub Desktop.
Debug Google Maps View in ListView
import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
class SettingsPage extends StatefulWidget {
@override
createState() => SettingsPageState();
}
class SettingsPageState extends State<SettingsPage> {
GoogleMapController _mapController;
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Settings'),
),
body: ListView(
children: [
SizedBox(
height: 250,
child: GoogleMap(
options: GoogleMapOptions(
mapType: MapType.hybrid,
zoomGesturesEnabled: true,
rotateGesturesEnabled: true,
scrollGesturesEnabled: true,
tiltGesturesEnabled: true,
),
onMapCreated: (GoogleMapController controller) {
_mapController = controller;
_mapController.animateCamera(
CameraUpdate.newCameraPosition(
CameraPosition(
target: LatLng(44.659, -1.156), zoom: 17.0),
),
);
_mapController.addMarker(
MarkerOptions(
position: LatLng(44.659, -1.156),
infoWindowText: InfoWindowText("Title", "Content"),
icon: BitmapDescriptor.fromAsset(
'images/icon.png',
),
),
);
},
),
),
],
));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment