Add a reminder to your app with flutter local notifications
If you want to add a reminder to your note app, or any other app this article will guide you in a simple way. I would like to create a simple and easy note app demo, to help you with scheduling a note with using 2 interesting flutter packages and plugins.
flutter_local_notifications
datetime_picker_formfield
datetime_picker_formfield helped me with selecting a date for my little note. So I could schedule a note reminder using flutter_local_notifications
plugin. Since the version I’m using required to schedule notifications according to a specific time zone and the existed schedule method is now deprecated, I had to use timezone
package as well. But you don’t have to add that to yaml file because flutter_local_notifications
plugin already uses that.
iOS setup
For swift add this code to your app delegate.
if #available(iOS 10.0, *) {
UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate
}
For Objective-C
if (@available(iOS 10.0, *)) {
[UNUserNotificationCenter currentNotificationCenter].delegate = (id<UNUserNotificationCenterDelegate>) self;
}
Before you do an android release build refer to the Release build configuration part from…