Google Places AutoComplete Flutter Places & Location Api | Flutter Google Maps Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome back so now let's go ahead and create another method above the widget Bill widget bill in here and above that in here we're gonna simply see a white and we're gonna give the name as on modify so create that method in here and take those bridges down now in here we're gonna simply just set the if condition and we will check that specific token for session and here we will say if token for session if that equals to no only in that case what we will do we'll press in here take this down we're gonna call upon the system so it's a startup widget it's an engine just change result dynamically now in here we're about to go and create a uid it's going to Simply generate a unique ID for us then we will just assign that unique ID that in here towards the token 4 session now in here above we will say where uuid in this specific variable we will assign you you ID as you guys can see the suggestion and write it and semicolon now let's go down and we will use that in here right in this state we're gonna say token for session and now we will just assign the uid to the version 4. it's going to create a unique ID for us and then we just assign that specific unique array toward this token for session okay it's going to be right inside that then right after that we're going to simply just call upon in here the specific method we just created right in the previous video by the name Max again so copy that from here and paste down in here click on that in here and also we'll just pass the object controller okay that one copy it from here as I told you already right in the previous video whenever the user will put something right in here in the storage bar for replace it's gonna then just assign that specific data toward this controller it is going to write inside that then right in here with an execution we're going to call upon that in here so controller with a DOT tax and write it n semicolon now right after that we're going to simply just call upon the init state in here and what I'll do in here where can I just scroll up on the controller object in here then we say dot add list now we're gonna add the listener to that and write it in semicolon so we just register our Atlas now add to this specific controller object which you can simply just listen towards that specific event or Stat that will change so if the user will enter something right in here as I told you already it's going to be right inside the object controller and we just listen to that and right afterwards you can just take this down from here and we're gonna call upon the method on modify in here and write it and semicolon so we are done with that now we will just scroll down first in here we will put comma and in here we will just add the expanded widget from now on we'll just move that we will edit in a while now take this down in here we'll say child and we'll say list View we're gonna go with the dot Builder there we go the suggestion it's going to take the item Builder we will just edit in a while now take these batch down and in here first you will just add the item count okay in which we will have all of the lists that we created right in the previous video for the prices okay and we just check by the name it was list four places okay yep there one we just assigned that specific array to this list or places we're going to copy that from here and we're gonna just go all the way down right in here so right in the atom count we will just have that in here and we're gonna go with the total length of it so in here we'll say dot length and right after that we'll say item Builder and now in here contacts we're going to have a specific index for all the places that will be right inside the list now right after that what I'll do in here called the braces and take this down from here and here we will simply just return the widget by the name list tile okay in here now take this down it's going to take the on tap event okay what I'll do now first in here semicolon and back again in here and this specific event going to be as in Chronos so in here as seen just write it okay it's going to feature the best so whenever let's assume that when the user search for the specific address write it here so there will be kind of suggestion for all these specific places towards Jack the user will enter right in here and right after that I will just convert that specific address towards the location we're gonna simply just convert it towards the latitude and longitude we're gonna simply get that so forth that specific purpose what I'll do right in here we'll see a list okay and I have already teach you guys that how you guys can just convert the latitude and longitude towards the address and also the rewards and you guys can see the directory right in the previous videos we just did that okay so what I'll do in here I'll go towards that specific directory open that we're gonna simply just get down since we are getting the location so what I'll do in here is going to be like that okay we're gonna simply just get the location from the address and the address will be the text that the user will enter right in the search bar in here so like that okay and then we will simply just get that specific location which will be the latitude and longitude like that let's go back again in here already we write list and with it let's go ahead and here we'll say location and with it now we'll give it a name as a location okay name in here is sensor feature based and it's asynchronous so what I'll do in here we'll say Avid it will avat until the the actual the account so what I'll do right after that will say location from address okay and in here as I told you already it is going to be the text that the user will enter and all of that specific text that is usable enter it's going to be right inside the control and then it's going to be right inside the list four places okay so in here what I'll do I'll say a list four places as you guys can see with a specific and Dax okay and also it will content the description so in here we're gonna say description only just fine and write it and semicolon to understand this better let's assume that you guys will have a list for places and right inside that each and every place will have a property by the name description it will rewrite that now whenever it will get that so you will just paint in here the latitude and longitude so in here we'll say locations okay that name in which we just assign that okay so with the help of that we're going to Simply get the latitude and longitude so in here it will say locations dot last dot longitude and right after that let's copy that for time saving and in here paste it instead of longitude will say longitude will be here and above in here there will be attitude latitude and longitude all just fine now also we're gonna show the title for that so what I'll do below down in here is a title and we'll have a text widget okay and in here we will say and here we will see a list for places and with a specific index with a specific description in here so we'll say description in here it's gonna get the title then so all of the work has been completed now we'll just how to load the app and just see we got error let me just check in here we're gonna import a library right above you will just it's automatically import it okay that one we will just remove that from here and all is just fine now back down how to load the app all is just found okay it's how to load in the app or drill on now what I'll do just come here and search for specific area and also we will just open the Run okay and here I'll just get this down I'll search for New York you guys can see the suggestion right in here I just type new let me just get this down okay so that you guys can see it clearly I just type new and you guys can see this again down below okay now I'll put it all of the alphabets for the New York okay you guys can see the suggestion it's working totally fine that's how you guys can give the places API through Google Maps search now I'll just open the Run get this and you guys can see in here okay all of you working let me just go right at the top so I search for the New York and you guys can see right inside that prediction okay we have that specific description for the new work NY USA okay that's why I was telling you that there will be that specific description and we have that in here as I told you already that description for the at least four places and also I have already told you about the prediction towards the list for places where in the previous video let me just show you there we go okay you guys can use a prediction and I have already explained this in detail what in the previous video that there will be prediction for all of the list of places and you guys already noticed that in here okay prediction and if we go down you guys can see all of the detail right in here and you guys can see when I type in their new also the issues are suggestion for the Nepal New Zealand and you guys can see that right in here those specific prediction with a specific description okay prediction and description now if I will click let me just get this down a little if I will click any of the address in here it will show the location for example the latitude and longitude and we simply just print that right in here let me just show you one more time where it gone there you go okay latitude and longitude you just print that now if I tap any of the address in here it will show us the latitude and longitude for that specific address okay so I'm gonna simply just click upon that New York and you guys can see that in here okay there we go with the latitude and longitude it's working totally fine I just click upon the New York State okay and you guys can see that in here New York and while let me just skip this down okay I just click upon that and you guys can see that in here the latitude and longitude it's working totally fine and if I just search for any specific area and here we will just remove that and if I search for any specific area let's say Pakistan and you guys can see the suggestion in here now open the Run go down all the way okay now I'll just click upon that let me just see Azad Jung and Kashmir open the Run get down and click upon that and you guys will notice the latitude and longitude for that specific address click upon that there we go and you guys can see the latitude and longitude it's working totally fine that's how you guys can give the places API through Google Maps search and also we successfully just convert that from the address towards the location and you guys can see the latitude and longitude right in here and all of the work has been completed successfully so basically that's it for this video right from the next video we will work further so see you then
Info
Channel: Muhammad Ali's Coding Cafe
Views: 2,332
Rating: undefined out of 5
Keywords: google map api flutter, google map, flutter google maps, flutter google maps api, flutter google places, flutter google places autocomplete, flutter google places api, flutter google places autocomplete example, flutter google places package, google geocoding api, google geocode, google geocoding api key, flutter geocoding example, flutter reverse geocoding, flutter directions api, how to add google map my location, how to add google map in flutter app, google maps api
Id: jZiUHJgFuG0
Channel Id: undefined
Length: 17min 13sec (1033 seconds)
Published: Wed Aug 30 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.