Implement Flutter Schedule Local Push Notifications | Schedule Notification for android and iOS

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
foreign [Music] basically in the previous video which we posted a week before we discussed about how we can trigger a local push not vacation in our flood trap upon a button press event right hope you all remember that if anybody is new to this video or if anyone has missed that video I recommend you to go check the previous video first since this video is going to be a continuation of the previous one I am not going to explain the initial setup which we have already discussed so I strongly recommend you go check the previous video I will also leave the link for the video the code at the top right as well as in the description so in this video we will be focusing on how to schedule a notification say for example what we have here is a simple example of the same we have x button basically a daytime picker as you can see and right now it is 5 45 let me give it as 546 okay and if I click schedule notification I now have a notification being scheduled for 5 46 let me just wait for it and as you can see that at 5 46 we get the notification being triggered automatically so this is all about what we are about to discuss in this video therefore with the wasting time let's directly jump into the coding button start implementing this feature in a flutter app well for the daytime picker we will be making also the package which is flutter daytime picker so make sure you add this flutter daytime picker package your pop spec and of course you need to add the federal local notification package as well for regarding the local notifications after adding these two packages let's move on to the main entire file starting the main.file we need to select the time zones so import that package as t z and initialize them inside the main method all right so this is something which we need to do initially inside the main.file and after which let's move on to the my home page and here is where we will be writing the URL Logic for rendering the date and pick widget as well as the elevated button first let's have a body that is going to have a column that contains a list of children's basically two children one is going to be the daytime picker and the second is going to be the elevated button okay first starting with the date time picker it is going to be a stateful widget class as you can see and it is going to have a text button and inside the on press event we need to make use of the show date and picker method which we get as a result of the package installation you can say don't change callback function just set the schedule time as the date what we have selected from the daytime pickup okay so this is all about um the date and picker and now let's move on to the elevated button and this is elevated button what we have here and here inside this on press event of the elevated button we need to call a function called schedule notification so this is going to be a custom defined function which we'll be writing down and say the notification services.file and for this method this passes in the title body and the time to which the notification needs to be scheduled so right now this is all about the UI what we need to do inside the home page now let's try defining the schedule notification method further let's move on to the notification services.file and earlier we used to have a method also notification that will immediately trigger a notification upon the button press right now we are dealing with the scheduled notification therefore let's create a separate function called schedule notification and it is going to take the same set of parameters like the ID title payload Etc and inside which we need to make use of the Zone schedule method and pass in the same ID title body Etc in addition to that you need to pass in the daytime that is the date time which we get as a result of the date and picker class and after which finally need to add the notebooks and details of course just the same like what we used to have here in the so notifications you can also add other set of parameters and finally you need to make use of the time zones so this is going to be the schedule notification method that will help us trigger the notification upon the scheduled date time with this we complete MDR process of scheduling a notification for the given date app Let me refresh this app and let's select a particular time is 555 and we turn into 556 and trigger a scheduled notification at 5 56 we need to get us notification you see at 5 56 we get a notification being triggered automatically so this is all about how we can Implement a scheduled notification here in Africa in just few simple steps hope you guys found this tutorial useful if you do so consider subscribing and I will see you in the next one bye [Music] foreign
Info
Channel: vijaycreations
Views: 16,521
Rating: undefined out of 5
Keywords: flutter, dart, app dev, package, dart package, flutter package, tutorials, mobile app dev, appdevelopment, flutter tutorials, flutter animations, software developer, mobile application, software, android, ios, web, web design, web development, webapp, flutter web, ui, uiux, app tutorials, education, courses, youtube, youtube education, application, UIUX, notifications, flutter local notifications, push notifications, notification in flutter, flutter notifications, android notifications, Notifica
Id: T6Wg0AmIESE
Channel Id: undefined
Length: 4min 53sec (293 seconds)
Published: Sat Jan 21 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.