Last active
June 21, 2019 07:58
-
-
Save shyvum/88232c297037fc9564ab27f827c3a4bc 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
import 'package:flutter/material.dart'; | |
import 'package:google_maps_flutter/google_maps_flutter.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatefulWidget { | |
@override | |
_MyAppState createState() => _MyAppState(); | |
} | |
class _MyAppState extends State<MyApp> { | |
GoogleMapController mapController; | |
final LatLng _center = const LatLng(20.5937, 78.9629); | |
void _onMapCreated(GoogleMapController controller) { | |
mapController = controller; | |
} | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
home: Scaffold( | |
appBar: AppBar( | |
title: Text('Google Office Locations'), | |
backgroundColor: Colors.green[700], | |
), | |
body: GoogleMap( | |
onMapCreated: _onMapCreated, | |
initialCameraPosition: CameraPosition( | |
target: _center, | |
zoom: 4, | |
), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment