Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. class Peta extends StatefulWidget {
  2. _PetaState createState() => _PetaState();}
  3.  
  4. class _PetaState extends State<Peta> {
  5. Completer<GoogleMapController> _controller = Completer();
  6.  
  7. void initState() {super.initState();}
  8. void _onMapCreated(GoogleMapController controller) {_controller.complete(controller);}
  9.  
  10. Widget build(BuildContext context) {
  11. return Scaffold(
  12. appBar: AppBar(title: Text("PETA"),backgroundColor: Colors.lightGreenAccent[700],)
  13. body: Stack(children: <Widget>[_peta(context),])
  14. )
  15. }
  16.  
  17. Widget _peta(BuildContext context) {
  18. return Container(height: MediaQuery.of(context).size.height, width: MediaQuery.of(context).size.width,
  19. child: GoogleMap(onMapCreated: _onMapCreated, mapType: MapType.normal,
  20. initialCameraPosition: CameraPosition(target: LatLng(-1.265386, 116.831200), zoom: 14),
  21. markers: {marker1, marker2},
  22. )
  23. );
  24. }
  25. }
  26.  
  27. Marker marker1 = Marker(markerId: MarkerId("TOKO 1"), position: LatLng(-1.277025, 116.829049),
  28. infoWindow: InfoWindow(title: "TOKO MAKMUR"),
  29. icon: BitmapDescriptor.defaultMarkerWithHue(BitmapDescriptor.hueGreen,),
  30. onTap: () {
  31. showModalBottomSheet(
  32. context: context, /// this line is error
  33. builder: (builder){return Container(......)}
  34. );
  35. }
  36. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement