Flutter LatLong

A Flutter package for getting location and location distance and more using latitude and longitude.

pub package

Installation

flutter pub add flutter_latlong

or

dependencies:
  flutter_latlong: ^1.0.3

Usage

Distance


    import 'package:flutter_latlong/flutter_latlong.dart';
    final Distance distance = new Distance();
    
    final num? km = distance.as(LengthUnit.Kilometer, LatLng(24.012856, 89.259056), LatLng(23.810331, 90.412521));

    final num? meter = distance(
      LatLng(24.012856, 89.259056),
      LatLng(23.810331, 90.412521)
    );

Path

    import 'package:flutter_latlong/flutter_latlong.dart';
    // zigzag is a list of coordinates
    final Path path = new Path.from(zigzag);
    
    // Result is below
    final Path steps = path.equalize(8,smoothPath: true);