Fireship · @fireship
Flutter Google Maps + Firestore Geolocation - Build the next Uber?
Uploaded February 15, 2019 · Length 11:46
Summary
Build a real-time geolocation app with Flutter, Google Maps, and Firestore, similar to Uber, in under 200 lines of code.
- flutter google maps
- firestore geolocation
- real-time location tracking
- flutter app development
- google maps api
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
[Music]
- 0:06
geolocation is pretty important like
- 0:09
uber is the highest-valued private tech
- 0:10
company in the world with a valuation of
- 0:12
over 100 billion and the core feature of
- 0:14
that app is real-time geolocation in
- 0:16
today's video we'll build some of the
- 0:18
most important features that go into an
- 0:19
app like uber such as device GPS
- 0:21
tracking and real-time geolocation
- 0:23
queries to a cloud database and we'll do
- 0:25
it all in under two hundred lines of
- 0:26
code using tools like flutter Google
- 0:28
Maps and firestorm if you're new here
- 0:30
like and subscribe and I highly
- 0:31
recommend following along with the
- 0:33
source code on fire ship IO and a huge
- 0:35
shout out to darshan goda not only did
- 0:37
he write most of the code for this video
- 0:38
but he's also the author of the geo
- 0:40
flutter fire library that powers the geo
- 0:42
queries that you'll see in this video
- 0:44
let's start by taking a closer look at
- 0:46
the app you'll notice it's a full-screen
- 0:48
google map and then we have a slider
- 0:50
down here in the left corner and a
- 0:51
button in the right corner in flutter we
- 0:53
can arrange this layout very simply in a
- 0:55
stack when we move the slider to the
- 0:57
right it will zoom out the camera and
- 0:58
also increase the range of our geo query
- 1:00
so the app allows you to find all of the
- 1:02
safe points within a certain radius of a
- 1:04
center point and more often than not
- 1:06
that center point will be the actual
- 1:07
users device location via GPS and the
- 1:10
button down here on the right allows us
- 1:11
to add a new geo point to firestore
- 1:13
based on the device's current location
- 1:15
but the really awesome thing is that we
- 1:17
can update the markers on the map by
- 1:19
reacting to events in the database so
- 1:21
you can see as this blue dot moves and
- 1:23
we add additional geo points they show
- 1:24
up on the map instantly that means you
- 1:26
could have multiple users listening to
- 1:28
the same stream of geo location data and
- 1:30
they would all get the same results in
- 1:31
the UI similar to that ubirr app how
- 1:33
everybody can see the same drivers
- 1:34
moving around in real time now let's go
- 1:36
ahead and get started
- 1:37
the first thing you'll need to do is
- 1:38
have flood or fire installed you can
- 1:41
refer to the official documentation
- 1:42
where I cover all the steps in the
- 1:44
Google OAuth Water video when you create
- 1:46
a firebase project it also gives you a
- 1:48
GCP project where you can obtain a
- 1:50
Google Maps API key once you have the
- 1:53
API enabled go ahead and copy that API
- 1:55
key and then we'll bring it into our
- 1:56
flutter project now let's take a look at
- 1:58
our dependencies we have firebase core


