Flutter Live Location Tracker - Google map and Firebase Updated

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys in this video I'm gonna show you how to use the outdated source code from GitHub and make it work with the current version of flutter so this is the code that we have written two years ago and I have got many comments that it's not working now and I have to update it so today I'm gonna update it live in this video and you will learn how to use any source code from GitHub with the current version of flutter so if that sounds interesting please leave a like And subscribe to the channel so you won't miss such amazing videos in the future and without talking too much let's get started and see how we can do this so first thing I'm gonna clone this project by copying this and go to my folder here I'm gonna open CMD and type in and paste the link this will download the project in my local computer now I can close this and open Visual Studio code right here so once we have our project open before getting the packages I want to go to the pub speak yaml and update all the versions of the packages I will copy them one by one in Google and update the latest version okay once we have updated all the packages version I want to update the SDK version also if you have a new project which is created by the current version of flatter and dar you can simply open that project go to the pub speak yaml and copy this SDK but if you don't have you can simply come to the terminal you can simply create a test project this will create a project with a latest version of flutter and now you can simply open that project in a new window now you can come to the pub speak yaml and copy the SDK version from here to this project once this is done I think there's nothing else to change in the pub speak yaml you can simply save it to get the packages next we have to come to the Android folder we have to update the Gradle wrapper.properties version you can also take this from this newly created project because this is the latest version this is using the 7.5 version so I can simply copy the entire line and paste it right here save it next we have to go to the build.gradle and change the version of kotlin to the latest and also the Google die services and build.gradle so I can simply copy the build.gradle from this one because according to this Gradle version it gives us the build.gradle version also so I can use that right here next we have the kotlin version I can simply copy the kotlin version from here also and this Google Dash Services is not here because we have configured it with the Firebase so I can copy and paste it here and I will get the latest version which is 4.3.15 and simply change it another change here we have Maven Central instead of J Center so I can override this and nothing else to be changed we can save it and we can go to the build.gradle of app version and build.gradle of app version we have to update this Firebase Dash BOOM so I can simply paste it here go to the first link paste it it will find you the last version you can copy it and overwrite next we have to also change the compiled SDK version to the latest and targeted SDK to the latest we can save it now I guess we don't have any error in our project I think we are using Firebase also so we have to find the Google Dash services from our Firebase project I don't think that I have the Firebase project for this application till now because I've written the code two years ago and that might have been deleted so let me check if it is still there I will simply download the Google Dash Services if not then I have to create a new project and add the Google services to this project okay I have checked the Firebase console and the project is not here so I have to create a new project and configure it with this application you can simply click on this ad project and give it a name like and click continue continue you can select the default Firebase account down it will take us to this home page we can configure it with Android we have to copy our package name from the project you can simply come to the source main Android manifest copy this package name paste it and give it a name also it's optional I will give live location and click register once you have done that you can simply copy or download the Google die Services drag it into the app and also make sure to remove the one or two so now we have our Google die Services let's finish the process from here next we have already added this the rest is already configured we just needed the Google services config we could continue to console now come to build Firebase database since we were using Cloud firestore we just have to create a database start a test mode and enable it okay once it's finished then we don't have to do anything with Firebase now you can see here in Android manifest I have mentioned that you have to add your API key for Google Map let's do it I can simply go to console.cloud.google.com from Top here you can choose your project click all and find the Firebase project that you have just created I can click that and then in API Services click enable apis and services click Maps SDK for Android if you don't have it you can simply search it here and enable it once it's enabled you can simply come to this menu and go to API credentials now you can copy the key from here copy it and come to the Android manifest and paste it right here you can Simply Save the Android manifest and close it this is also you can close it you can close it and close and finally we have to open our main and I guess we are ready to run the application let's see let's run it and see if it works or we get some errors okay device is ready I will run without debugging mode okay we have some errors here as you can see there is a problem with the kotlin version it says that the location probably it's using the lower version of kotlin so for this we have to keep changing the kotlin version to something which makes it work in this case if I copy this 1.5.20 as it suggests and run the application so now this is another error that for Android 12 or higher we have to use the Android exported inside the activity and the previous error is gone because I have used this older version of kotlin and the Gradle we cannot use the very latest version because most of the packages is not still updated with the latest version of the Gradle so we can use a little bit earlier version like in this case I've used 7.2 instead of 7.3 and also here 1.7.15 I guess I used 1.7.10 instead of that just to make it work now for this error we have to go to the Android manifest and inside here we have to paste something called Android exported we can simply copy this from our new project also because this should be compatible with the Android 12 as well it needs this line we can copy it and paste it inside the activity and now we should be good we can run the project now okay you can see that application has run successfully but while asking the permission the application got crashed and this error is because we are doing some changes to the location before having the permission to do so so these two line is causing the crash on in its state because before giving the permission how can you change the setting for location I can simply comment this or put it down here after giving the permission once the permission is successful so for now I will just comment this and save it and probably this one only this time and run it again okay now the application is successfully running here while using the application we give the permission and yeah just like this we have made two years old Project work with the current version of flutter and dart so now let's test it whether it's actually working or not okay both the device is up and running now I will enable the live location in this device it gets the location and it's enabled now let me change the location and see if it affects here suppose I want to click and set here it should be updated okay it's updated now I can keep track of the location live in this device now this is the map for this device so if I put this device here and the map in the center I want to click right here set and it should take us live to that current position we have been closed I guess it is lack of memory and there's a lot of pressure right now in my laptop something is wrong I can run it again here no problem but I have to do everything very quick because laptop is already heating up I have to create a route to Let's suppose here that device this was too slow for our operation now I can click on route now I can play it 5x it's a car so if I play it here we should be getting the live update as you can see it's working and we're moving live in this device and we're getting the live updates in this device and this is how you can update the older source code from GitHub and make it work with the current version of flutter and for this live location I have some Advanced tutorial where you can pick your location from Google Map instead of typing or choosing you can check it in our Channel I will link it in the description and thank you for watching don't forget to like And subscribe and I will see you in the next video
Info
Channel: Lazy TechNo
Views: 9,396
Rating: undefined out of 5
Keywords: live location tracker, flutter, flutter live location tracking, flutter live location sharing app, flutter live location, live location tracking google maps, flutter google maps, flutter google maps and live location tracking, flutter tutorial, google maps, firebase flutter, google map sdk android, flutter google map sdk, flutter location tracking, flutter location picker, real time location tracking google maps, flutter realtime location, flutter google maps current location
Id: xglk8en3pjU
Channel Id: undefined
Length: 10min 7sec (607 seconds)
Published: Tue Jun 20 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.