Masamune logo

Masamune Location

Follow on GitHub Follow on X Follow on YouTube Maintained with Melos

GitHub Sponsor


[GitHub](https://github.com/mathrunet) | [YouTube](https://www.youtube.com/c/mathrunetchannel) | [Packages](https://pub.dev/publishers/mathru.net/packages) | [X](https://x.com/mathru) | [LinkedIn](https://www.linkedin.com/in/mathrunet/) | [mathru.net](https://mathru.net)


Masamune Location Platform Interface

Overview

masamune_location_platform_interface defines the abstract interfaces for location-related adapters in the Masamune framework. This package is primarily used by package authors implementing custom location adapters.

Note: Most developers should use masamune_location instead of this package directly.

Usage

This package is automatically included as a dependency when you use:

  • masamune_location
  • masamune_location_background
  • masamune_location_geocoding
  • masamune_location_google

For Package Authors

If you're creating a custom location adapter, extend LocationMasamuneAdapter:

import 'package:masamune_location_platform_interface/masamune_location_platform_interface.dart';

class MyCustomLocationAdapter extends LocationMasamuneAdapter {
  @override
  Future<Position> getCurrentPosition() async {
    // Implement custom location retrieval
  }

  @override
  Future<void> startListening({
    double? distanceFilter,
    Duration? timeInterval,
  }) async {
    // Implement continuous updates
  }

  // ... other methods
}

Provided Interfaces

  • LocationMasamuneAdapter - Abstract base class for location adapters
  • Position - Location data structure
  • LocationAccuracy - Accuracy level enum
  • PermissionStatus - Permission state enum

For End Users

Use concrete implementations like:

  • MobileLocationMasamuneAdapter (from masamune_location)
  • GoogleMobileLocationMasamuneAdapter (from masamune_location_google)
  • BackgroundLocationMasamuneAdapter (from masamune_location_background)

See the respective package documentation for usage examples.

GitHub Sponsors

Sponsors are always welcome. Thank you for your support!

https://github.com/sponsors/mathrunet

Libraries

masamune_location_platform_interface
Masamune plugin library for handling location information in apps.