geo_location_finder 1.0.2

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

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.

example/README.md

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

import 'package:flutter/services.dart'; import 'package:geo_location_finder/flutter_location_plugin.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.2

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/flutter_location_plugin.dart';
import 'package:geo_location_finder/generated/i18n.dart';
  
Version Uploaded Documentation 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]
42
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
71
Learn more about scoring.

We analyzed this package on Nov 14, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.6
  • Flutter: 0.11.3

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

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
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8