flutter_location_plugin 0.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 30

flutter_location_plugin #

A new Flutter location plugin.

Getting Started #

For help getting started with Flutter, view our online documentation.

For help on editing plugin code, view the documentation.

0.0.1 #

  • TODO: Describe initial release.


import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:flutter_location_plugin/flutter_location_plugin.dart';

void main() => runApp(new MyApp());

class MyApp extends StatefulWidget {
  _MyAppState createState() => new _MyAppState();

class _MyAppState extends State<MyApp> {
  String _result = 'Unknown';

  void initState() {

  *  Method :- _getLocation
  *  Return Type : void
  *  Parameters :
  * This method will invoke Location Plugin and will give a Map Object in response.
  * */

  Future<void> _getLocation() async
    Map<dynamic, dynamic> locationMap;

    String result;

    try {
      locationMap = await FlutterLocationPlugin.getLocation;
      print("Message From main.dart - Got Response $locationMap");
      var status = locationMap["status"];
      if((status is String && status == "true") || (status is bool) && status) {

        var lat = locationMap["latitude"];
        var lng = locationMap["longitude"];

        if(lat is String) {
          result = "Location: ($lat, $lng)";
        } else {
          // lat and lng are not string, you need to check the data type and use accordingly.
          // it might possible that else will be called in Android as we are getting double from it.
          result = "Location: ($lat, $lng)";

      } else {
        result = locationMap["message"];

    } on PlatformException {

      result = 'Failed to get location';

    if (!mounted) return;

    setState(() {
      _result = result;

  Widget build(BuildContext context) {
    return new MaterialApp(
      debugShowCheckedModeBanner: false,
      home: new Scaffold(
        appBar: new AppBar(
          title: const Text('Plugin location app'),
        body: new Center(
          child: new Text('$_result'),

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  flutter_location_plugin: ^0.0.1

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:flutter_location_plugin/flutter_location_plugin.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jul 2, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.9+1
  • Flutter: 1.17.3

Analysis suggestions

Package does not support Flutter platform linux

Because of import path [package:flutter_location_plugin/flutter_location_plugin.dart]

Package does not support Flutter platform macos

Because of import path [package:flutter_location_plugin/flutter_location_plugin.dart]

Package does not support Flutter platform web

Because of import path [package:flutter_location_plugin/flutter_location_plugin.dart]

Package does not support Flutter platform windows

Because of import path [package:flutter_location_plugin/flutter_location_plugin.dart]

Package not compatible with SDK dart

because of import path [flutter_location_plugin]

Health suggestions

Format lib/flutter_location_plugin.dart.

Run flutter format to format lib/flutter_location_plugin.dart.

Format lib/generated/i18n.dart.

Run flutter format to format lib/generated/i18n.dart.

Maintenance issues and suggestions

Homepage URL doesn't exist. (-20 points)

At the time of the analysis the homepage field https://www.flutterdevs.com was unreachable.

Documentation URL doesn't exist. (-10 points)

At the time of the analysis the documentation field https://docs.flutterdevs.com/flutter_location was unreachable.

Package is getting outdated. (-67.12 points)

The package was last published 87 weeks ago.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8 1.2.0
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8