# geolocator_platform_interface 4.4.1

A common platform interface for the geolocator plugin.




## Installing
```
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.com
flutter pub add 'geolocator_platform_interface:4.4.1'
```
Published: 2026-10-19T15:29:08.438987Z
Expected archive SHA-256: e012af6b7e2674e7500237ab11e44ac9119e87fd0105e7bb55cde1750e8e5d80

Available in cache; verification: upstream_checksum
## Direct dependencies
- flutter: map[sdk:flutter]
- meta: ^1.9.1
- plugin_platform_interface: ^2.1.6
- vector_math: ^2.1.4

## Package README (untrusted upstream documentation)
# geolocator_platform_interface

[![pub package](https://img.shields.io/pub/v/geolocator_platform_interface.svg)](https://pub.dartlang.org/packages/geolocator_platform_interface) ![Build status](https://github.com/Baseflow/flutter-geolocator/workflows/geolocator_platform_interface/badge.svg?branch=master) [![style: flutter_lints](https://img.shields.io/badge/style-flutter_lints-40c4ff.svg)](https://pub.dev/packages/flutter_lints)

A common platform interface for the [`geolocator`][1] plugin.

This interface allows platform-specific implementations of the `geolocator`
plugin, as well as the plugin itself, to ensure they are supporting the
same interface. Have a look at the [Federated plugins](https://flutter.dev/docs/development/packages-and-plugins/developing-packages#federated-plugins) 
section of the official [Developing packages & plugins](https://flutter.dev/docs/development/packages-and-plugins/developing-packages) 
documentation for more information regarding the federated architecture concept. 

## Usage

To implement a new platform-specific implementation of `geolocator`, extend
[`GeolocatorPlatform`][2] with an implementation that performs the
platform-specific behavior, and when you register your plugin, set the default
`GeolocatorPlatform` by calling
`GeolocationPlatform.instance = MyPlatformGeolocator()`.

## Note on breaking changes

Strongly prefer non-breaking changes (such as adding a method to the interface)
over breaking changes for this package.

See https://flutter.dev/go/platform-interface-breaking-changes for a discussion
on why a less-clean interface is preferable to a breaking change.

## Issues

Please file any issues, bugs or feature requests as an issue on our [GitHub](https://github.com/Baseflow/flutter-geolocator/issues) page. Commercial support is available, you can contact us at <hello@baseflow.com>.

## Want to contribute

If you would like to contribute to the plugin (e.g. by improving the documentation, solving a bug or adding a cool new feature), please carefully review our [contribution guide](../CONTRIBUTING.md) and send us your [pull request](https://github.com/Baseflow/flutter-geolocator/pulls).

## Author

This Geolocator plugin for Flutter is developed by [Baseflow](https://baseflow.com).

[1]: ../geolocator
[2]: lib/geolocator_platform_interface.dart

## Changelog
## 4.4.1

- Corrects the documentation of `LocationAccuracyStatus` and `getLocationAccuracy()`, which said that Android always returns `LocationAccuracyStatus.unknown` and that the status only applies to iOS 14 and higher. On Android the status is `precise` or `reduced`, depending on the granted location permission. The documentation now describes the behaviour on each platform. Resolves [#1528](https://github.com/Baseflow/flutter-geolocator/issues/1528).

## 4.4.0

- Adds `verticalSpeed` and `verticalSpeedAccuracy` with corresponding `hasVerticalSpeed` and `hasVerticalSpeedAccuracy` flags to `Position`.

## 4.3.0

- Adds `hasAccuracy`, `hasAltitude`, `hasAltitudeAccuracy`, `hasHeading`, `hasHeadingAccuracy`, `hasSpeed` and `hasSpeedAccuracy` to `Position`, so a value the platform could not measure is distinguishable from the same value measured as `0.0`. The Android platform channel already omits a key when its `Location.hasX()` predicate is false; `Position.fromMap` substituted `0.0` for the missing value, and the distinction was lost. The reported numeric values are unchanged and every field defaults to `false`, so existing code is unaffected. Resolves [#1733](https://github.com/Baseflow/flutter-geolocator/issues/1733) and [#1525](https://github.com/Baseflow/flutter-geolocator/issues/1525).

## 4.2.8

- Updates dependencies to their latest versions.
- Fixes an analysis warning indicating a missing type declaration.

## 4.2.7

- Clarifies the documentation of `Position.heading` to explain that it carries the course over ground (direction of travel, from `Location.getBearing()` on Android and `CLLocation.course` on iOS), which is distinct from compass heading. The field keeps the `heading` name for backward compatibility. Resolves [#1187](https://github.com/Baseflow/flutter-geolocator/issues/1187).

## 4.2.6

- Updates documentation `isMocked` to bring it in line with the functionality. `isMocked` for iOS 15 and higher depends on the result from isSimulatedBySoftware.

## 4.2.5

- Updates dart sdk to `>3.5.0`

## 4.2.4

- Correctly handle integer-like numbers when decoding `Position` from JSON.

## 4.2.3

- Fixes several grammar mistakes in the API documentation.

## 4.2.2

- Updates the documentation of the `getServiceStatusStream` method as it nolonger throws a `UnimplementedError` on web.

## 4.2.1

- Ensures that `timestamp` is set to current date and time if platform implementations return a `null` value.

## 4.2.0

- Replaces an optional DateTime? `timestamp` in `Position` object for an NonNull DateTime `timestamp`. 

## 4.1.1

- Updates dependencies to latest versions to prevent conflicts with other packages.

## 4.1.0

- Includes `altitudeAccuracy` and `headingAccuracy` in `Position`.

## 4.0.8

- Updates documentation for `getCurrentPosition()` and `LocationAccuracy`, to clarify the behavior of location accuracy on Android devices.

## 4.0.7

- Fixed a spelling error in docs.

## 4.0.6

- Migrates to Dart SDK 2.15.0 and Flutter 2.8.0.

## 4.0.5

- Fixes repository URL of the package.

## 4.0.4

- Fixes a bug where listening to the position stream immediately after an error, results in listening to a dead stream. 

## 4.0.3

- Removes `timeInterval` from `LocationSettings` documentation.

## 4.0.2

- Added `extensions.dart` to the `exports` list.

## 4.0.1

- Adds the `LocationPermission.unableToDetermine` status used on the web platform when the permission API is not implemented by the browser.

## 4.0.0

- **breaking** Updates the plugin platform interface to use a non`-const` token. This is marked as a breaking change because it can cause an assertion failure if implementations use `implements` rather than `extends`, but hopefully there aren't any of those;
- Replaced soft-deprecated `PlatformInterface.verifyToken` method with `PlatformInterface.verify` method;
- Updated `plugin_platform_interface` dependency.


## 3.0.1

- Remove unnecessary import statements from several source files;
- Fix "forceAndroidLocationManager" for getLastKnownPosition.

## 3.0.0+1

- Removed Android specific `LocationSettings.intervalDuration` field.

## 3.0.0

- Defines the `LocationSettings` class which bundles platform specific settings when communicating with the host platform.

## 2.3.6

- Updated API documentation on `GeolocatorPlatform.getServiceStream()` method, describing it is not supported on the web platform.

## 2.3.5

- Changed the EventChannelMock and the MethodChannelMockd due to breaking changes in the platform channel test interface.

## 2.3.4

- Update the documentation of the `getCurrentPosition` method to explain why it can take several seconds to execute.

## 2.3.3

- Migrated to [flutter_lints](https://pub.dev/packages/flutter_lints) as linter rule set as it replaces the deprecated [effective_dart](https://pub.dev/packages/effective_dart) package.

## 2.3.2

- Added the possibility to pass your own purposeKey name to the requestTemporaryFullAccuracy method.

## 2.3.1

- Solves a bug which resulted in an issue when closing the position stream.

## 2.3.0

- Added the possibility to request temporary Precise Accuracy on iOS 14+ devices.

## 2.2.1

- Documentation `getLocationAccuracy()` method clarified.
- Extended the `LocationAccuracyStatus` enum with a `LocationAccuracyStatus.unknown` value, which can be used by platforms that don't support location accuracy features.

## 2.2.0

- Added the possibility to query for the LocationAccuracyStatus on devices running iOS 14.0 and higher.

## 2.1.1

- Solves a bug which resulted in an issue when closing the position stream and requesting a new one (see issue [#703](https://github.com/Baseflow/flutter-geolocator/issues/703)).

## 2.1.0

- Added the possibility to start a stream which will return an event when Location Services are manually enabled/disabled

## 2.0.2

- Added definition of the `ActivityMissingException`.

## 2.0.1

- Resolved analyzer error when using mockito (see issue [#709](https://github.com/Baseflow/flutter-geolocator/issues/709)).

## 2.0.0

- Stable release for null safety.

## 2.0.0-nullsafety.1

- Merged version 1.0.9 into null safety.

## 2.0.0-nullsafety.0

- Migrated to support null safety.

## 1.0.9

- Updated the README.md to more clearly explain the purpose of the geolocator_platform_interface package.

## 1.0.8

- Added the optional floor property to the position model and can be used by implementations to specify the floor on which the device is located (see [#562](https://github.com/Baseflow/flutter-geolocator/issues/562)).

## 1.0.7

- Solves a bug causing less accurate location fixes (see [#531](https://github.com/Baseflow/flutter-geolocator/issues/531)).

## 1.0.6+1

- Solve a bug which adds a zero timeout when no timeout is supplied (see [#564]((https://github.com/Baseflow/flutter-geolocator/issues/564))).

## 1.0.6

- Allow developers to call the `getCurrentPosition` method while already listening to a position stream (see issue [#546](https://github.com/Baseflow/flutter-geolocator/issues/546));
- Make sure the position stream is stopped correctly (see issues [#485](https://github.com/Baseflow/flutter-geolocator/issues/485) and [#541](https://github.com/Baseflow/flutter-geolocator/issues/541));
- Android: fix deprecation warning (see issue [#556](https://github.com/Baseflow/flutter-geolocator/issues/556)).

## 1.0.5

- Added more detailed documentation on the `LocationServiceDisableException` (see issue [#519](https://github.com/Baseflow/flutter-geolocator/issues/519)).

## 1.0.4

- Add the `isMocked` field to the `Position` class to indicate if the position is retrieved using the Android MockLocationProvider (see issue #498);
- Fixed typo in API documentation of LocationPermission (see issue #494)

## 1.0.3+1

- Improved LocationPermission documentation (see issue #494).

## 1.0.3

- Fixed code formatting and homepage URL

## 1.0.2

- Make sure close streams are dereferenced (solves a bug where closed stream is listened to generating an exception).

## 1.0.1

- Add support to force using the Android Location Manager instead of the Android FusedLocationProvider.

## 1.0.0

- Initial open-source release.







 
