flutter_location_plus 1.0.2
flutter_location_plus: ^1.0.2 copied to clipboard
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 #
LocationDatatyped model withlat,lng,provider,accuracy,speed, andtime.getBestLocation()— picks the most accurate fix across all enabled providers.getGpsLocation(),getNetworkLocation(),getPassiveLocation()— provider-specific one-shot fetches.liveLocation()— returns aStream<LocationData>for continuous updates.stopLiveLocation()— removes the native listener and stops battery drain.ActivityAwaresupport — runtime permissions requested automatically (Android 6+).liveLocationErrorchannel callback surfaces provider-disabled errors to the Dart stream.
Changed #
- Package renamed from
nativecode_locationtoflutter_location_plus. - Method channel renamed from
nativecode_locationtoflutter_location_plus. - Main class renamed from
NativecodeLocationtoFlutterLocationPlus. - Returns
"null,null,null"instead of"0.0,0.0,null"when no fix is available. - Updated Android Gradle Plugin to 8.7.0,
compileSdkto 36,minSdkVersionto 21. - Java source/target compatibility updated to Java 17.
plugin_platform_interfaceupdated to ^2.1.8.flutter_lintsupdated to ^4.0.0.
Fixed #
- Removed duplicate
requestLocationUpdatescalls on activity re-attach. - Removed deprecated
onStatusChanged,onProviderEnabled,onProviderDisabledoverrides.
0.0.1 #
- Initial release as
nativecode_location: one-shot location fetch from native Android GPS, Network, and Passive providers.