Skip to content
pubscout

open_location_code

1.0.1, released 3 years ago by fabi.online

Encode and decode Open Location Codes (Plus Codes) for latitude/longitude.

WASM-ready
$ flutter pub add open_location_code
Source repository

What it does

Provides functions to convert a latitude/longitude pair into a Plus Code and back. It also supports shortening and expanding codes relative to a reference location, all offline.

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

Use it when

  • You need a street‑address‑like code for places without traditional addresses
  • You want an offline, no‑service location encoding
  • You need to generate or parse Plus Codes in a Dart/Flutter app

Skip it when

  • You require geocoding of place names to coordinates
  • You need dynamic reference locations that change frequently

Strengths

  • Offline, no external services required
  • Simple API, no build_runner or codegen
  • Supports shortening and expanding codes

Weaknesses

  • No built‑in geocoding, so reference locations must be supplied manually
  • Limited to Plus Code format only

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
1
```dart
import 'package:open_location_code/open_location_code.dart';

final code = OpenLocationCode.encode(6.1, 36.2); // e.g., "6GCRPR6C+24"
final location = OpenLocationCode.decode(code);
print(location.latitude); // 6.1
print(location.longitude); // 36.2
```

Alternatives

Packages that do the same job and could replace open_location_code.

  • source_span

    Standard representation for source code locations, spans, and human-friendly error messages.

  • http_status_code

    A Dart library providing constants and helpers for HTTP status codes.

Works with

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