location2 6.0.4 copy "location2: ^6.0.4" to clipboard
location2: ^6.0.4 copied to clipboard

This library aims at providing you a simple way to get the user location without thinking about permission.

Flutter Location

A simple way to get the user location without thinking about permission.

Melos docs.page

DocumentationGitHubWeb Demo

About #

This library was update from Lyokones's location. It aims at providing you a simple way to get the user location without thinking about permission. It's also configurable so you can easily get better performance or better battery.

It currently supports Android, iOS, macOS and Web. Support for remaining platforms is incoming.

Features #

  • 👨‍💻️ Easy to use
  • 🛰 Handles requesting permission and enabling GPS automatically for you
  • 🔋 Highly configurable so you get the best performance / battery ratio for your usecase
  • 🔍 Supports both with and without Google Play Services for Android phones without them
  • 🏃‍♂️ Supports background location updates
  • ⭐️ Flutter Favorite

How to use? #

Go to the documentation to install Location!

Then, to get the location of your user you can simply do:

to pubspec.yaml add below

dependencies: 
 location2: ^6.0.2

in your class

import 'package:location2/location2.dart';


setLocationSettings(
        rationaleMessageForGPSRequest:
            '....',
        rationaleMessageForPermissionRequest:
            '....',
        askForPermission: true);
final location = await getLocation(); //catch exception
print("Location: ${location.latitude}, ${location.longitude}");
3
likes
130
pub points
69%
popularity

Publisher

unverified uploader

This library aims at providing you a simple way to get the user location without thinking about permission.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, location2_android, location2_ios, location2_macos, location2_platform_interface, location2_web

More

Packages that depend on location2