geo_location_finder 1.0.5

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 88

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

Pub

flutter_location_plugin

Flutter plugin for getting accurate locations on the Android & iOS devices.

Usage



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

      String result;

      try {
        locationMap = await GeoLocation.getLocation;
        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;
      });
    }



1.0.5

  • Updated CHANGELOG.md

1.0.4

  • Updated README.md

1.0.3

  • Updated README.md

1.0.2

  • Updated README.md

1.0.1

  • Updated Readme.md

1.0.0

  • Update project homepage

0.0.3

  • Updated Plugin name

0.0.2

  • Renamed package to geo_location_finder

0.0.1

  • Initial Release

example/README.md


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

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

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

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

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

    @override
    void initState() {
      super.initState();
      _getLocation();
    }

    /*
    *  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 GeoLocation.getLocation;
        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;
      });
    }

    @override
    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:


dependencies:
  geo_location_finder: ^1.0.5

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


import 'package:geo_location_finder/geo_location_finder.dart';
  
Version Uploaded Documentation Archive
1.0.5 Nov 16, 2018 Go to the documentation of geo_location_finder 1.0.5 Download geo_location_finder 1.0.5 archive
1.0.4 Nov 16, 2018 Go to the documentation of geo_location_finder 1.0.4 Download geo_location_finder 1.0.4 archive
1.0.3 Nov 16, 2018 Go to the documentation of geo_location_finder 1.0.3 Download geo_location_finder 1.0.3 archive
1.0.2 Nov 1, 2018 Go to the documentation of geo_location_finder 1.0.2 Download geo_location_finder 1.0.2 archive
1.0.1 Nov 1, 2018 Go to the documentation of geo_location_finder 1.0.1 Download geo_location_finder 1.0.1 archive
1.0.0 Nov 1, 2018 Go to the documentation of geo_location_finder 1.0.0 Download geo_location_finder 1.0.0 archive
0.0.3 Nov 1, 2018 Go to the documentation of geo_location_finder 0.0.3 Download geo_location_finder 0.0.3 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
76
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
88
Learn more about scoring.

We analyzed this package on Jan 15, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.10
  • Flutter: 1.1.7

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs. (-1 points)

4 out of 4 API elements (library, class, field or method) have no adequate dartdoc content. Good documentation improves code readability and discoverability through search.

Dependencies

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.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8