Skip to content

Instantly share code, notes, and snippets.

@shyvum
Last active June 21, 2019 07:58
Show Gist options
  • Save shyvum/88232c297037fc9564ab27f827c3a4bc to your computer and use it in GitHub Desktop.
Save shyvum/88232c297037fc9564ab27f827c3a4bc to your computer and use it in GitHub Desktop.
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