Skip to content

Instantly share code, notes, and snippets.

@vijayinyoutube
Created January 21, 2023 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vijayinyoutube/dc972b0742bb1bf68e66484825cfb33a to your computer and use it in GitHub Desktop.
Save vijayinyoutube/dc972b0742bb1bf68e66484825cfb33a to your computer and use it in GitHub Desktop.
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