Welcome back.
In this video we're going to add more extended floating action buttons to this expandable floating action
button.
And add some functionalities to those buttons.
Let's go to Expandable Fab here.
Create an extended floating action button.
Set onClick parameter.
The first extended button will upload the marker on the map to Firebase Firestore, set the expanded
to false and then call on request.
This is the onClick parameter.
Here we need to add icon default dot add content description equals to null text request.
Right now let's pass the request right as a parameter for this expandable map on request right?
Also a lambda expression taking no parameters and returning nothing.
Now let's add the functionality on request right?
Go to Uber Clone map.
Here we have an error we need to specify on request right.
So on request tried what we need to do.
Set the selected location.
Dot.
Let.
If it is not null, go and get the location of the selected marker and call add marker function that
we created before.
In the previous videos.
Call the selected marker.
Set the destination the selected location dot latitude and selected location longitude.
Okay, now let's add the other two parameters.
The Onsuccess don't do anything, you can override them later on and Onfailure don't do anything.
Let's test this floating action button.
This is our application.
The request tried.
Extended fab added.
Now let's go to here to Bolivia and set the selected location in Bolivia.
Select it and let's go to our firebase.
Let me remove those destinations.
Here we go.
We have four markers and this is the selected location.
Click on request right.
Let me check.
And here we go.
The destination is added successfully.
So congratulations guys.
The marker.
The destination is added with the name coordinates and long with lat long fields.
Here in our markers collection.
Okay so this is the functionality of adding markers on Firebase Firestore.
Now let me select this drill root.
Let me check if there is a response.
And congratulations guys.
This is the main idea behind this application.
So here we are requesting a marker destination A ride.
So every marker represent a ride.
The user the current user here is a driver.
So you can upload rides markers to Firestore.
And the driver select the nearest marker.
And the Google Maps SDK will.
And the directions API will tell him the route that he should go.