Skip to content

Instantly share code, notes, and snippets.

@brasizza
Created July 13, 2021 05:44
Show Gist options
  • Save brasizza/b64c2d4fda6096bc805b8f4fa849a39e to your computer and use it in GitHub Desktop.
Save brasizza/b64c2d4fda6096bc805b8f4fa849a39e to your computer and use it in GitHub Desktop.
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