geo_location_finder 1.0.4

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

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

For help on editing plugin code, view the 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;
      });
    }



0.0.1 #

  • TODO: Describe 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.4

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.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]
86
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]
92
Learn more about scoring.

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

  • Dart: 2.3.0
  • pana: 0.12.15
  • Flutter: 1.5.8

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 suggestions

Homepage URL is insecure. (-5 points)

Update the homepage field and use a secure (https) URL.

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