Facebook
From natural, 1 Month ago, written in Dart.
Embed
Download Paste or View Raw
Hits: 148
  1.  GestureDetector(
  2.                   onTap: () async {
  3.                     bool isServiceEnabled = await Geolocator.isLocationServiceEnabled();
  4.                     if (isServiceEnabled) {
  5.                       final GoogleMapController controller = await model.controller.future;
  6.                       controller.animateCamera(CameraUpdate.newCameraPosition(CameraPosition(
  7.                         target: model.userLocation == null
  8.                             ? LatLng(34.0059934, 71.5057068)
  9.                             : LatLng(model.userLocation!.latitude, model.userLocation!.longitude),
  10.                         zoom: 14,
  11.                       )));
  12.                     } else {
  13.                       Get.dialog(LocationDialog(
  14.                         onPressed: () async {
  15.                           await Geolocator.openLocationSettings();
  16.                           Get.back();
  17.                           await model.getCurrentLocationUpdates();
  18.                           setState(() async {
  19.                             final GoogleMapController controller = await model.controller.future;
  20.                             controller.animateCamera(CameraUpdate.newCameraPosition(CameraPosition(
  21.                               target: model.userLocation == null
  22.                                   ? LatLng(34.0059934, 71.5057068)
  23.                                   : LatLng(model.userLocation!.latitude, model.userLocation!.longitude),
  24.                               zoom: 14,
  25.                             )));
  26.                           });
  27.                         },
  28.                       ));
  29.                     }
  30.                   },
  31.                   child: const CircleAvatar(
  32.                       backgroundColor: commonColor_4,
  33.                       child: Icon(
  34.                         Icons.location_on,
  35.                         color: Colors.white,
  36.                       )),
  37.                 ),

Replies to Untitled rss

Title Name Language When
Re: Untitled natural dart 1 Month ago.