-
-
Save Aditsyal/59205c109ded25f043478d83ab839c0f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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