Viewing version 4.4.1. Open the latest package page.

geolocator_platform_interface

4.4.1

A common platform interface for the geolocator plugin.

Download archive

Readme

geolocator_platform_interface

pub package Build status style: flutter_lints

A common platform interface for the geolocator 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 section of the official Developing packages & plugins documentation for more information regarding the federated architecture concept.

Usage

To implement a new platform-specific implementation of geolocator, extend GeolocatorPlatform 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 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 and send us your pull request.

Author

This Geolocator plugin for Flutter is developed by Baseflow.

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.

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 and #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.

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

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).

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).

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).

1.0.7

  • Solves a bug causing less accurate location fixes (see #531).

1.0.6+1

  • Solve a bug which adds a zero timeout when no timeout is supplied (see #564).

1.0.6

  • Allow developers to call the getCurrentPosition method while already listening to a position stream (see issue #546);
  • Make sure the position stream is stopped correctly (see issues #485 and #541);
  • Android: fix deprecation warning (see issue #556).

1.0.5

  • Added more detailed documentation on the LocationServiceDisableException (see issue #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.

Installing

export PUB_HOSTED_URL=https://pub.mirror.p-hatan.com
flutter pub add 'geolocator_platform_interface:4.4.1'
pubspec.yaml
name: geolocator_platform_interface
description: A common platform interface for the geolocator plugin.
repository: https://github.com/baseflow/flutter-geolocator/tree/main/geolocator_platform_interface
# NOTE: We strongly prefer non-breaking changes, even at the expense of a
# less-clean API. See https://flutter.dev/go/platform-interface-breaking-changes
version: 4.4.1


dependencies:
  flutter:
    sdk: flutter
  
  plugin_platform_interface: ^2.1.6
  vector_math: ^2.1.4
  meta: ^1.9.1

dev_dependencies:
  async: ^2.11.0
  flutter_test:
    sdk: flutter
  flutter_lints: ^6.0.0
  mockito: ^5.4.2

environment:
  sdk: ^3.5.0
  flutter: ">=2.8.0"

Version history

VersionPublishedArchiveSHA-256
1.0.0On demandDownloadd9b63760…dcafa6
1.0.0+1On demandDownloada5a92ed4…22656b
1.0.1On demandDownloadc5049ec1…e582c4
1.0.2On demandDownload8bd9a245…6ec21a
1.0.3On demandDownload700f2fcb…7306c6
1.0.3+1On demandDownload08cfe66e…16e188
1.0.4On demandDownloada0428927…a392b6
1.0.5On demandDownload6feb904f…45d220
1.0.6On demandDownload44a09c34…9e50c5
1.0.6+1On demandDownloaded94f6cf…2a1d69
1.0.7On demandDownloade29a5266…87d711
1.0.8On demandDownload6ae9cab6…795460
1.0.9On demandDownloadaa11c4cb…a8f3fa
2.0.0-nullsafety.0On demandDownload668123a9…ff281b
2.0.0-nullsafety.1On demandDownload454be22d…1b8747
2.0.0On demandDownload3ad65ab0…f55300
2.0.1On demandDownload7e27852b…d5676e
2.0.2On demandDownloaddc81e40c…2bbcf6
2.1.0On demandDownload0cc550d1…c7f124
2.1.1On demandDownload5a33e10c…70ee42
2.2.0On demandDownload7025cfdc…03ca03
2.2.1On demandDownloade0f990b4…325087
2.3.0On demandDownload676a9d86…685b62
2.3.1On demandDownload0e0a5b8b…27e694
2.3.2On demandDownload92435fd5…1de916
2.3.4On demandDownload527ec252…3e415d
2.3.5On demandDownload3036bf45…eaf105
2.3.6On demandDownload9d6f34a8…0336d4
3.0.0On demandDownload7cae512f…9eb5b5
3.0.0+1On demandDownload561432ae…63b07d
3.0.1On demandDownloadc4bd5560…6cebae
4.0.0On demandDownload5154fd51…046b42
4.0.1On demandDownloadaea90b11…d72e6a
4.0.2On demandDownloadd07d618d…b67efe
4.0.3On demandDownload3452012e…a3f32e
4.0.4On demandDownloadd37246d5…6f9ba4
4.0.5On demandDownloadc228ba43…25f43d
4.0.6On demandDownload8c10ba5c…54388d
4.0.7On demandDownloadaf4d6923…ce6386
4.0.8On demandDownloadb2a0c09d…9a682f
4.1.0On demandDownloadb8cc1d3b…658535
4.1.1On demandDownloadb7aca62a…c46a25
4.2.0On demandDownload6c8d494d…a2468a
4.2.1On demandDownload3b95ecdc…ff4508
4.2.2On demandDownload009a21c4…03fab9
4.2.3On demandDownloadc6005787…502603
4.2.4On demandDownload386ce3d9…ace012
4.2.5On demandDownload722db30c…bc188f
4.2.6On demandDownload30cb64f0…56fe67
4.2.7On demandDownloaddde05dae…8e13a7
4.2.8On demandDownloadcdb082e4…d7aee2
4.3.0On demandDownload94db8255…86198d
4.4.0On demandDownloadb640b6b6…ca77fc
4.4.1Cached · Upstream SHA-256 matchedDownloade012af6b…8e5d80

Dependencies

flutter { "sdk": "flutter" }

meta "^1.9.1"

plugin_platform_interface "^2.1.6"

vector_math "^2.1.4"