LocationPlatform class abstract

The only thing that touches the OS. GeolocatorLocationPlatform in production, InMemoryLocationPlatform in tests.

Implementations return failures instead of throwing where they can; the caller still guards every call and bounds it with a timeout.

Implementers

Constructors

LocationPlatform()

Properties

hashCode → int
The hash code for this object.
no setterinherited
isSupported → bool
false on web and desktop, where every call returns notApplicable.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

attach(int generation, Map<String, Object?> settings) → Future<void>
Called once per Dart isolate before anything else. A new generation tells the native side a hot restart happened: drop every listener and pending callback from the previous isolate.
checkConfiguration() → Future<ConfigurationCheck>
checkPermission() → Future<LocationAccess>
clearStored() → Future<void>
configure(Map<String, Object?> settings) → Future<void>
Pushes changed settings (store throttling, global filters).
currentPosition({required LocationAccuracy accuracy, required Duration timeout, Duration? maxAge}) → Future<PlatformFix>
One fix. Reuses a native fix younger than maxAge. Answers within timeout with a fix or a timeout/noFix failure.
diagnostics() → Future<Map<String, Object?>>
Raw facts for diagnose().
dispose() → Future<void>
Stops native work started by this isolate.
isOnline() → Future<bool?>
true/false when the platform can tell (validated network), null when it can't (Android without ACCESS_NETWORK_STATE).
isServiceEnabled() → Future<bool>
lastKnown() → Future<PlatformLastKnown>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
openAppSettings() → Future<bool>
openLocationSettings() → Future<bool>
positionStream(StreamRequest request) → Stream<PositionEvent>
Native fixes for request. Listening starts the platform request; cancelling stops it.
requestPrecise({String? purposeKey}) → Future<LocationAccess>
Asks for precise location: Android re-request, iOS temporary full accuracy with purposeKey. Returns the access afterwards.
resolvePlayServices() → Future<bool>
Android: shows Google's "update Google Play services" dialog. Returns whether Play services is usable afterwards. false elsewhere.
resolveServices(LocationAccuracy accuracy) → Future<ServicesResolution>
statusStream() → Stream<LocationStatus>
storeAddress(Position position, Map<String, Object?> addressMap) → Future<void>
Attaches addressMap to the stored last known position if it is still position.
toString() → String
A string representation of this object.
inherited
updateStreamRequest(StreamRequest request) → Future<void>
Changes the running stream's request without re-subscribing.

Operators

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