0

Imagine an app very similar to Tinder, match users with similar interests, but only in a certain radius.

I guess similar question to this, but specifically for Flutter: How to implement a tinder-like search based on distance in Android?


The most basic idea is to just save each user's lat & long in Firestore upon app start. Then query the first e.g. 10 users from db and calculate the distance between them with something like this.

Is this all I need? I suppose I won't need something big like geoflutterfire with map visualization and whatnot. All I need is the location of each user.

So my questions are:

  1. Is geolocator the best plugin for this? Or is there something specifically suited?
  2. Is this a feasible solution for a big amount of users?

I'm worried that calculating the distance in this way will become impossible, since the app will be loading for minutes.

Or maybe I have to lean into geohashing? But that would mean I have to use geoflutterfire, am I then bound by the API calls restriction of Google Maps?


Edit: Seeing this question: Flutter Firestore Geo query, it seems like Firestore may be a bad solution for this?
Am I forced to migrate to something like Back4App which has things like withinGeoBox?

enter image description here

Big_Chair
  • 2,781
  • 3
  • 31
  • 58

1 Answers1

0

it's also possible to do it with geohashing.

you can do that with https://pub.dev/packages/geohash_plus

Kyrill
  • 265
  • 1
  • 7
  • 19
  • Thank you for the video, was educational. That plugin seems a little ill-documented, so I'll look around a bit more. In this question & answer here he seems to make it work with the fluttergeofire plugin: https://stackoverflow.com/questions/73682953/flutter-firebase-get-docs-by-geohash – Big_Chair Mar 29 '23 at 08:03