Skip to content

Instantly share code, notes, and snippets.

@Aditsyal
Last active April 11, 2019 07:43
Show Gist options
  • Save Aditsyal/59205c109ded25f043478d83ab839c0f to your computer and use it in GitHub Desktop.
Save Aditsyal/59205c109ded25f043478d83ab839c0f to your computer and use it in GitHub Desktop.
final double _zoom = 10;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Maps in Flutter'),
centerTitle: true,
),
drawer: _drawer(),
.
.
.
.
.
);
}
Widget _drawer(){
return Drawer(
elevation: 16.0,
child: Column(
children: <Widget>[
UserAccountsDrawerHeader(
accountName: Text("xyz"),
accountEmail: Text("xyz@gmail.com"),
currentAccountPicture: CircleAvatar(
backgroundColor: Colors.white,
child: Text("xyz"),
),
otherAccountsPictures: <Widget>[
CircleAvatar(
backgroundColor: Colors.white,
child: Text("abc"),
)
],
),
ListTile(
title: new Text("Places"),
leading: new Icon(Icons.flight),
),
Divider(),
ListTile(
onTap: (){
_goToNewYork();
Navigator.of(context).pop();
},
title: new Text("New York"),
trailing: new Icon(Icons.arrow_forward_ios),
),
],
),
);
}
Future<void> _goToNewYork() async {
double lat = 40.7128;
double long = -74.0060;
GoogleMapController controller = await _controller.future;
controller.animateCamera(CameraUpdate.newLatLngZoom(LatLng(lat, long), _zoom));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment