Created
January 21, 2023 14:40
-
-
Save vijayinyoutube/dc972b0742bb1bf68e66484825cfb33a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Future<void> repeatNotofication() async { | |
var androidChannelSpecifications = AndroidNotificationDetails( | |
"CHANNEL_ID 2", | |
"CHANNEL_NAME 2", | |
"CHANNEL_DESCRIPTION 2", | |
importance: Importance.max, | |
priority: Priority.high, | |
); | |
var iosChannelSpecifications = IOSNotificationDetails(); | |
var platfromChannelSpecifications = NotificationDetails( | |
android: androidChannelSpecifications, iOS: iosChannelSpecifications); | |
await flutterLocalNotificationsPlugin.periodicallyShow(1, "Notification", | |
"Bill paid", RepeatInterval.daily, platfromChannelSpecifications, | |
payload: "Test Payload"); | |
} | |
Future<void> showDailyAtTime() async { | |
var time = Time(20, 51, 0); | |
var androidChannelSpecifications = AndroidNotificationDetails( | |
"CHANNEL_ID 3", | |
"CHANNEL_NAME 3", | |
"CHANNEL_DESCRIPTION 3", | |
importance: Importance.max, | |
priority: Priority.high, | |
); | |
var iosChannelSpecifications = IOSNotificationDetails(); | |
var platfromChannelSpecifications = NotificationDetails( | |
android: androidChannelSpecifications, iOS: iosChannelSpecifications); | |
await flutterLocalNotificationsPlugin.showDailyAtTime( | |
0, "Notification", "Bill paid", time, platfromChannelSpecifications, | |
payload: "Test Payload"); | |
} | |
Future<void> showWeeklyAtTime() async { | |
var time = Time(20, 51, 0); | |
var androidChannelSpecifications = AndroidNotificationDetails( | |
"CHANNEL_ID 3", | |
"CHANNEL_NAME 3", | |
"CHANNEL_DESCRIPTION 3", | |
importance: Importance.max, | |
priority: Priority.high, | |
); | |
var iosChannelSpecifications = IOSNotificationDetails(); | |
var platfromChannelSpecifications = NotificationDetails( | |
android: androidChannelSpecifications, iOS: iosChannelSpecifications); | |
await flutterLocalNotificationsPlugin.showWeeklyAtDayAndTime( | |
0, | |
"Notification", | |
"Bill paid", | |
Day.monday, | |
time, | |
platfromChannelSpecifications, | |
payload: "Test Payload"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment