Skip to content
pubscout

geoflutterfire

3.0.3, released 5 years ago by noeatsleepteam.com

Store and query Firestore documents based on geographic location in real time.

Quiet but busy
$ flutter pub add geoflutterfire
Source repository

What it does

GeoFlutterFire is a lightweight add-on library for Cloud Firestore that lets you save geographical locations and query documents within a given radius. It uses geohashes to perform queries and returns real-time streams of document snapshots.

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

Use it when

  • You need real-time location-based queries using Firebase Firestore
  • You want to filter documents within a specific radius from a center point

Skip it when

  • You need complex range queries on multiple fields alongside geoqueries
  • You rely heavily on built-in server-side limit() or orderBy() combined with location filtering

Strengths

  • Real-time streaming of geographic query results
  • Seamless integration with cloud_firestore and support for `withConverter`
  • Supports strict mode filtering and nested location fields

Weaknesses

  • Does not support limit() or orderBy() out of the box
  • Strict mode filtering happens on the client side which may cause unnecessary document reads at large radii

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
3

Requires a Firebase project with Cloud Firestore set up.

final geo = Geoflutterfire();
final _firestore = FirebaseFirestore.instance;
GeoFirePoint center = geo.point(latitude: 12.960632, longitude: 77.641603);
var collectionReference = _firestore.collection('locations');
Stream<List<DocumentSnapshot>> stream = geo.collection(collectionRef: collectionReference).within(center: center, radius: 50, field: 'position');

Alternatives

Packages that do the same job and could replace geoflutterfire.

Works with

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