Created
June 18, 2019 03:50
-
-
Save ricardoogliari/6422a3211d8e875dd6e3b210bcc85a0a 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/services.dart'; | |
import 'package:google_maps_flutter/google_maps_flutter.dart'; | |
import 'package:firebase_auth/firebase_auth.dart'; | |
import 'package:flutter/material.dart'; | |
import 'dart:async'; | |
import 'HomeScreenPage.dart'; | |
import 'package:location/location.dart' as LocationMgr; | |
class HomeScreenState extends State<HomeScreenPage> { | |
static const platformChannelGeolocator = const MethodChannel('geolocator'); | |
... | |
Future tapInMap(LatLng latLng) async { | |
if (readingLocationOfCourse) { | |
try { | |
final String result = await platformChannelGeolocator.invokeMethod( | |
'geolocator', <String, dynamic>{ | |
'latitude': latLng.latitude, | |
'longitude': latLng.longitude | |
}); | |
print('Geolocator is $result.'); | |
} on PlatformException catch (e) { | |
print('Geolocator with problem: ${e.message}.'); | |
} | |
} | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment