The name 'LocationAccuracy' is defined in the libraries 'package:geolocation/geolocation.dart', 'package:geolocator/geolocator.dart' and 'package:location_platform_interface/location_platform_interface.dart (via package:location/location.dart)'.
Try using 'as prefix' for one of the import directives, or hiding the name from all but one of the imports.dartambiguous_import
This message is because there's a LocationAccuracy
defined in more than one library. So you need define from which library you are getting this LocationAccuracy. So you need specify a prefix after the import like this:
import 'package:geolocation/geolocation.dart' as geo; // or whatever name you want
import 'package:geolocator/geolocator.dart' as geolocator; // or whatever name you want
And then you can refer to the specific LocationAccuracy
you want to use in this way:
geo.LocationAccuracy
or
geolocator.LocationAccuracy
You can also use the second suggestion of hiding LocationAccuracy by adding this after importing 'package:geolocator/geolocator.dart' like this:
import 'package:geolocator/geolocator.dart' hide LocationAccuracy;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With