forked from iampratham29/ride-sharing-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
home.dart
64 lines (53 loc) · 1.77 KB
/
home.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import 'package:flutter/material.dart';
//import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
//import 'package:provider/provider.dart';
//import 'package:uber_clone/states/app_state.dart';
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Map()
);
}
}
class Map extends StatefulWidget {
@override
_MapState createState() => _MapState();
}
class _MapState extends State<Map> {
GoogleMapController mapController;
static const _initialPosition=LatLng(12.92,77.02);
LatLng _finalPosition = _initialPosition;
final Set<Marker> _markers={};
@override
Widget build(BuildContext context) {
return Stack(
children:<Widget>[
GoogleMap(
initialCameraPosition:CameraPosition(target:_initialPosition,
zoom:10.0),
onMapCreated: onCreated,
myLocationButtonEnabled: true,
mapType: MapType.normal,
compassEnabled: true,
markers: _markers,
onCameraMove: _onCameraMove,
),
],
);
}
void onCreated(GoogleMapController controller) {
setState(() {
mapController=controller;
});
}
void _onCameraMove(CameraPosition position) {
}
}