Skip to content
pubscout

latlong2

0.10.1, released 7 months ago by femtopedia.de

Lightweight Dart library for latitude/longitude calculations.

WASM-ready
$ flutter pub add latlong2
Source repository

What it does

Provides functions to compute distances, bearings and offsets between coordinates using Haversine or Vincenty algorithms. Includes utilities for path smoothing and GeoJSON conversion. All calculations are pure Dart with no platform dependencies.

AI-written summary of version 0.10.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need fast, offline distance or bearing calculations.
  • You want to smooth or equalize a series of GPS points without a map UI.

Skip it when

  • You need a full map widget or tile rendering.
  • You require real‑time location tracking or permissions handling.

Strengths

  • Zero native dependencies, works on all Dart platforms
  • Supports both fast Haversine and accurate Vincenty algorithms
  • Path smoothing and GeoJSON helpers included
  • Null‑safe and lightweight

Weaknesses

  • Does not provide location services or map widgets
  • Limited to calculation utilities, no visual components
  • No built‑in caching or networking

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
1
final distance = Distance();
final km = distance.as(LengthUnit.Kilometer,
    LatLng(52.518611, 13.408056), LatLng(51.519475, 7.46694444));

Alternatives

Packages that do the same job and could replace latlong2.

  • geolocator

    Provides location services and distance calculations with platform integration, useful if you also need GPS permissions.

Works with

Packages commonly used together with latlong2: ones it builds on, ones built on it, and its own family.