lop_polyutil 0.0.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 0

lop_polyutil #

LopPolyutil is an implementation of isLocationOnPath() google map PolyUtil method.

Usage #

Import package:lop_polyutil/lop_polyutil.dart and then call a static method isLocationOnPath which will return a boolean.

// import package
import 'package:lop_polyutil/lop_polyutil.dart';

// Prepare arguments to pass.
// It takes 2 @required and 1 optional arguments.

// List of LatLng
List<LatLng> paths = [];

// Coordinate you want to check if it lies within or near path.
LatLng point = LatLng(0, 3);

// radius is optional argument. By default radius is set at 200 meters.
double radius = 200;

// isLocationOnPath a Future method so we will use .then()
LopPolyutil.isLocationOnPath(path: paths, point: point, radius: radius)
    .then((result) {
      	if(result == true) {
    		// things you can do when point is within or near path goes here...
		} else {
    		// things you can do when point isn't within or near path goes here...

Author #

Ashim Upadhaya


This plugin is not supported by ios yet.

0.0.1 #

  • Initial release

0.0.2 #

  • Nothing's change.
  • Documentation added.


import 'package:flutter/material.dart';
import 'package:google_maps_flutter/google_maps_flutter.dart';
import 'package:lop_polyutil/lop_polyutil.dart';

void main() => runApp(MaterialApp(
      title: "LocationOnPath - PolyUtil",
      home: Home(),

class Home extends StatefulWidget {
  _HomeState createState() => _HomeState();

class _HomeState extends State<Home> {

  bool _result;

  void initState() {

  Future<void> initPlatformCode() async {
    List<LatLng> path =[];
    path.add(LatLng(0, 0));
    path.add(LatLng(0, 1));
    path.add(LatLng(0, 3));
    path.add(LatLng(0, 4));

    LatLng point = LatLng(30, 74);

    final result = await LopPolyutil.isLocationOnPath(path: path, point: point);
    setState(() {
      this._result = result;

  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("LocationOnPath - PolyUtil"),
      body: Container(
        child: Center(
          child: Text("isLocationOnPath ? ${this._result}"),

Use this package as a library

1. Depend on it

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

  lop_polyutil: ^0.0.2

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or 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:lop_polyutil/lop_polyutil.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.

This package is not analyzed, because it is discontinued.

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.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0