Skip to content
pubscout

geoflutterfire_plus

0.0.34, released 11 months ago by kosukesaigusa.com

Store and query Cloud Firestore documents based on geographic locations.

WASM-ready
$ flutter pub add geoflutterfire_plus
Source repository

What it does

geoflutterfire_plus allows Flutter apps to query geographic data saved in Cloud Firestore by using Geohashes. It provides tools to save geographic points, fetch locations within a radius, and subscribe to real-time location query streams.

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

Use it when

  • You need to query Cloud Firestore documents within a specific geographic radius in real-time
  • You want to store location points along with their geohash strings in Firestore

Skip it when

  • You require built-in limit or orderBy queries directly on the geo query (limit and orderBy are currently not supported due to geohash algorithm and Firestore limitations)
  • You are not using Cloud Firestore as your backend

Strengths

  • Enables radius-based location queries on Cloud Firestore
  • Supports real-time streams of location query results via rxdart
  • Works well with typed data using withConverter

Weaknesses

  • Does not support limit and orderBy queries out of the box
  • Requires proper Firestore composite indexes for custom query conditions

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
2

Requires cloud_firestore configured in your Flutter project.

final GeoFirePoint center = GeoFirePoint(const GeoPoint(35.681236, 139.767125));
final Stream<List<DocumentSnapshot<Map<String, dynamic>>>> stream = GeoCollectionReference<Map<String, dynamic>>(FirebaseFirestore.instance.collection('locations')).subscribeWithin(
  center: center,
  radiusInKm: 50,
  field: 'geo',
  geopointFrom: (data) => (data['geo'] as Map<String, dynamic>)['geopoint'] as GeoPoint,
);

Alternatives

Packages that do the same job and could replace geoflutterfire_plus.

Works with

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