geo_location_finder 1.0.8

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

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

Pub

geo_location_finder #

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

Usage #


    // Get current latitude, longitude
    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.8 #

  • Updated CHANGELOG.md

1.0.7 #

  • Updated CHANGELOG.md

1.0.6 #

  • Updated CHANGELOG.md

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.8

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:geo_location_finder/geo_location_finder.dart';
  
Version Uploaded Documentation Archive
1.0.8 May 14, 2019 Go to the documentation of geo_location_finder 1.0.8 Download geo_location_finder 1.0.8 archive
1.0.7 Mar 8, 2019 Go to the documentation of geo_location_finder 1.0.7 Download geo_location_finder 1.0.7 archive
1.0.6 Mar 8, 2019 Go to the documentation of geo_location_finder 1.0.6 Download geo_location_finder 1.0.6 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]
84
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
95
Overall:
Weighted score of the above. [more]
91
Learn more about scoring.

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

  • Dart: 2.3.2
  • pana: 0.12.18
  • Flutter: 1.5.4-hotfix.2

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 have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Maintenance issues and suggestions

Support latest dependencies. (-5 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.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
Dev dependencies
flutter_test