Answers for "how to get isoCode based on location in flutter"

0

how to get isoCode based on location in flutter

Future<String> getCountryName() async {
    Position position = await Geolocator().getCurrentPosition(desiredAccuracy: LocationAccuracy.high);
    debugPrint('location: ${position.latitude}');
    final coordinates = new Coordinates(position.latitude, position.longitude);
    var addresses = await Geocoder.local.findAddressesFromCoordinates(coordinates);
    var first = addresses.first;
    return first.countryName; // this will return country name
}
Posted by: Guest on October-12-2020

Code answers related to "how to get isoCode based on location in flutter"

Code answers related to "Dart"

Browse Popular Code Answers by Language