flutter_location_plus 1.0.2 copy "flutter_location_plus: ^1.0.2" to clipboard
flutter_location_plus: ^1.0.2 copied to clipboard

PlatformAndroid

Native Android location plugin — GPS, Network & Passive providers. No Google Play Services. Replaces nativecode_location.

1.0.2 #

Git path update.

1.0.1 #

Git path update.

1.0.0 #

This package supersedes nativecode_location (pub.flutter-io.cn). It is a full rewrite with a typed API, live streaming, and automatic permission handling.

Migration from nativecode_location #

# Before
dependencies:
  nativecode_location: ^0.0.1

# After
dependencies:
  flutter_location_plus: ^1.0.0
// Before
final NativecodeLocation plugin = NativecodeLocation();
final String? raw = await plugin.getNativeCodeLocation(); // "lat,lng,provider"

// After
final FlutterLocationPlus location = FlutterLocationPlus();
final String? raw = await location.getBestLocation();
final LocationData? fix = raw != null ? LocationData.tryParse(raw) : null;

Added #

  • LocationData typed model with lat, lng, provider, accuracy, speed, and time.
  • getBestLocation() — picks the most accurate fix across all enabled providers.
  • getGpsLocation(), getNetworkLocation(), getPassiveLocation() — provider-specific one-shot fetches.
  • liveLocation() — returns a Stream<LocationData> for continuous updates.
  • stopLiveLocation() — removes the native listener and stops battery drain.
  • ActivityAware support — runtime permissions requested automatically (Android 6+).
  • liveLocationError channel callback surfaces provider-disabled errors to the Dart stream.

Changed #

  • Package renamed from nativecode_location to flutter_location_plus.
  • Method channel renamed from nativecode_location to flutter_location_plus.
  • Main class renamed from NativecodeLocation to FlutterLocationPlus.
  • Returns "null,null,null" instead of "0.0,0.0,null" when no fix is available.
  • Updated Android Gradle Plugin to 8.7.0, compileSdk to 36, minSdkVersion to 21.
  • Java source/target compatibility updated to Java 17.
  • plugin_platform_interface updated to ^2.1.8.
  • flutter_lints updated to ^4.0.0.

Fixed #

  • Removed duplicate requestLocationUpdates calls on activity re-attach.
  • Removed deprecated onStatusChanged, onProviderEnabled, onProviderDisabled overrides.

0.0.1 #

  • Initial release as nativecode_location: one-shot location fetch from native Android GPS, Network, and Passive providers.
1
likes
160
points
114
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Native Android location plugin — GPS, Network & Passive providers. No Google Play Services. Replaces nativecode_location.

Repository (GitHub)
View/report issues

Topics

#location #gps #android #geolocation #native

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on flutter_location_plus

Packages that implement flutter_location_plus