Distance Matrix API Call Integration

Database & APIs

I'm working on integrating the Google Maps Distance Matrix API to calculate the distance between two locations (Homeowner and Freelancer). I’ve successfully set up the API key and enabled the necessary Google services (Geocoding, Places, and Distance Matrix APIs). However, I’m stuck on calling the API and binding the data dynamically to my app.

Here’s the setup:

  • Freelancer’s location is stored in Firestore and set as the origins.

  • Homeowner’s location is stored in Firestore and set as the destinations.

What I Need Help With:

  1. How to query multiple Homeowner locations from Firestore and format them dynamically for the API call.

  2. Properly binding the Distance Matrix API response to the quest list.

  3. Filter based off a certain distance (only show up to 50 miles away)

What have you tried so far?
  • Enabled and verified the required APIs in Google Cloud Console.

  • Configured the API call in FlutterFlow using the GET method.

  • Attempted to call the API on page load but struggled to pass the formatted destinations parameter from Firestore.

Api is working, im getting the distance and time.

Did you check FlutterFlow's Documentation for this topic?
No
4
1 reply