MethodChannelFlutterLocationPlus class

Default FlutterLocationPlusPlatform implementation using a MethodChannel.

Handles bidirectional communication with the native Android plugin:

  • Dart → Android: method calls (get location, start/stop live)
  • Android → Dart: liveLocation and liveLocationError callbacks pushed via MethodChannel.invokeMethod from the Java side.
Inheritance

Properties

hashCode int
The hash code for this object.
no setterinherited
liveLocationRawStream Stream<String>
Raw CSV stream consumed by FlutterLocationPlus.liveLocation. Exposed for testing; prefer the typed API in FlutterLocationPlus.
no setter
methodChannel MethodChannel
The channel name must match the one registered in FlutterLocationPlusPlugin.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getBestLocation() Future<String?>
Returns the most accurate last-known fix across all enabled providers.
override
getGpsLocation() Future<String?>
Returns the last-known fix from the GPS provider.
override
getNetworkLocation() Future<String?>
Returns the last-known fix from the Network provider.
override
getPassiveLocation() Future<String?>
Returns the last-known fix from the Passive provider.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
startLiveLocation({String provider = 'best', int intervalMs = 2000, double distanceMeters = 0}) Future<void>
Starts continuous location updates on the native side. Emits results via the liveLocation method channel callback.
override
stopLiveLocation() Future<void>
Stops the active native location listener and frees resources.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited