Created
July 13, 2021 05:44
-
-
Save brasizza/b64c2d4fda6096bc805b8f4fa849a39e 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:get/get.dart'; | |
import 'package:google_maps_flutter/google_maps_flutter.dart'; | |
import '../controllers/maps_controller.dart'; | |
class MapsView extends GetView<MapsController> { | |
@override | |
Widget build(BuildContext context) { | |
return Obx(() => GoogleMap( | |
initialCameraPosition: CameraPosition( | |
target: LatLng( | |
controller.userLocation.latitude, | |
controller.userLocation.longitude, | |
), | |
zoom: 14, | |
), | |
myLocationButtonEnabled: true, | |
markers: controller.markers, | |
myLocationEnabled: true, | |
onLongPress: (LatLng position) async { | |
await controller.addNewPosition(position); | |
}, | |
)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment