Flutter Location

Alternatives To Flutter Location
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Plugins16,7861,556615a month ago58June 06, 20221bsd-3-clauseDart
Plugins for Flutter maintained by the Flutter team
Flutter Desktop Embedding7,07862 months ago10August 18, 20223apache-2.0C++
Experimental plugins for Flutter for Desktop
Flutter Ui Nice3,388
a year ago7Dart
More than 130+ pages in this beautiful app and more than 45 developers has contributed to it.
Figmatocode2,870
a month ago23gpl-3.0TypeScript
Generate responsive pages and apps on HTML, Tailwind, Flutter and SwiftUI.
Sqflite2,58779913911 days ago125September 19, 2022142bsd-2-clauseDart
SQLite flutter plugin
Flutter_inappwebview2,4461463 days ago51May 05, 2022685apache-2.0Dart
A Flutter plugin that allows you to add an inline webview, to use a headless webview, and to open an in-app browser window.
Flutter Study2,254
3 years ago5
Flutter Study
Flutter_local_notifications2,166108526 days ago221September 23, 202244bsd-3-clauseDart
A Flutter plugin for displaying local notifications on Android, iOS, macOS and Linux
Cloudbase Framework1,876216 months ago130August 23, 202237otherJavaScript
腾讯云开发云原生一体化部署工具 🚀 CloudBase Framework:一键部署,不限框架语言,云端一体化开发,基于Serverless 架构。A front-end and back-end integrated deployment tool. One-click deploy to serverless architecture. https://docs.cloudbase.net/framework/index
Flutter Intellij1,859
a day ago517bsd-3-clauseJava
Flutter Plugin for IntelliJ
Alternatives To Flutter Location
Select To Compare


Alternative Project Comparisons
Readme

Flutter Location Plugin

A Flutter plugin to provide native location.

WARN: This plugin was written in swift/kotlin to be able to use it, you should have created the project with:

    flutter create -i swift -a kotlin project_name

Getting Started

For help getting started with Flutter, view our online documentation. For help on editing plugin code, view the documentation.

Add the dependency to your pubspec.yaml file.

dependencies:
  flutter_location: ^0.0.4

For iOS device, add these in lines in the Info.plist file:

<key>NSLocationWhenInUseUsageDescription</key>
<string>This message will be display to the user</string>

For android device, add these in lines in the AndroidManifest.xml file:

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

Then import the plugin in your code:

import 'package:flutter_location/flutter_location.dart'; // Plugin
import 'package:flutter_location/permission.dart'; // Return type
import 'package:flutter_location/location.dart'; // Return type

Look into the example for utilisation:

Location _location;
Location _currentLocation;
 @override
  void initState() {
    super.initState();
    initLocation();
  }

  Future<Permission> initPermission() async {
    Permission permission;
    bool isDetermined = false;
    await FlutterLocation.requestPermission;
    while (!isDetermined) {
      permission = await FlutterLocation.permission;
      if (permission == Permission.NOT_DETERMINED) {
        await Future.delayed(_waitForUser);
      } else {
        isDetermined = true;
      }
    }
    return permission;
  }

  void initLocation() async {
    Permission permission;
    permission = await initPermission();
    Location location;
    if (permission == Permission.AUTHORIZED) {
      location = await FlutterLocation.location;
      FlutterLocation.onLocationChanged.listen(
        (location) {
          setState(() => this._currentLocation = location);
        },
      );
    }
    setState(() {
      this._permission = permission;
      this._location = location;
    });
  }

For more examples check out:

API

Methods Description
Future permission Get the level of permission the user has granted to the app (NOT_DETERMINED, DENIED, AUTHORIZED).
Future location Get the location of the user.
Stream onLocationChanged Get the stream of the user's location.
Future requestPermission Show pop-up to the user to accept or decline permission authorizations. true if the pop-up was shown false if not (only will request once to show the popup)

Model

Permission:

  • NOT_DETERMINED: Permission not specified
  • DENIED: The user rejected the authorization
  • AUTHORIZED: The user granted permission to use location

Location {

  • double latitude
  • double longitude
  • double accuracy, // in iOS horizontal accuracy
  • double altitude
  • double speed
Popular Plugin Projects
Popular Flutter Projects
Popular Libraries Categories

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Plugin
Kotlin
Flutter
Location
Permissions