Upgrading flutter_local_notifications 0.5 to 0.6
Breaking0.5.2 → 0.6.1Breaking3New1Fixed1Other2
BreakingUpgrade verdict
3 breaking changes.
In plain terms
- Methods that returned a bare Future now return Future<void>, which can break code that relied on the old return type.
- Android builds now use a newer Gradle plugin version.
- Android notifications now remember the icon by name rather than by number, so scheduled notifications keep showing the right icon after an app update.
Must act 3 items need code or config changes
What you must change
Breaking3
Changes plugin methods to return
Future<void> instead of Future per Dart guidelines.FutureFuture<void>Updates the Android Gradle plugin to 3.3.2.
Stores the small icon drawable name instead of its resource ID so scheduled notifications survive app updates that change resource IDs.
initializeAPI changes
Generated by DepDelta from published Dart source. Not mixed with prose notes.
- removed:
typedef Future<dynamic> DidReceiveLocalNotificationCallback( int id, String title, String body, String payload) - removed:
typedef Future<dynamic> SelectNotificationCallback(String payload) - changed:
method FlutterLocalNotificationsPlugin.cancel(int id): Future → method FlutterLocalNotificationsPlugin.cancel(int id): Future<void> - changed:
method FlutterLocalNotificationsPlugin.cancelAll(): Future → method FlutterLocalNotificationsPlugin.cancelAll(): Future<void> - changed:
method FlutterLocalNotificationsPlugin.periodicallyShow(int id, String title, String body, RepeatInterval repeatInterval, NotificationDetails notificationDetails, {String payload}): Future → method FlutterLocalNotificationsPlugin.periodicallyShow(int id, String title, String body, RepeatInterval repeatInterval, NotificationDetails notificationDetails, {String payload}): Future<void> - changed:
method FlutterLocalNotificationsPlugin.schedule(int id, String title, String body, DateTime scheduledDate, NotificationDetails notificationDetails, {String payload}): Future → method FlutterLocalNotificationsPlugin.schedule(int id, String title, String body, DateTime scheduledDate, NotificationDetails notificationDetails, {String payload}): Future<void> - changed:
method FlutterLocalNotificationsPlugin.show(int id, String title, String body, NotificationDetails notificationDetails, {String payload}): Future → method FlutterLocalNotificationsPlugin.show(int id, String title, String body, NotificationDetails notificationDetails, {String payload}): Future<void> - changed:
method FlutterLocalNotificationsPlugin.showDailyAtTime(int id, String title, String body, Time notificationTime, NotificationDetails notificationDetails, {String payload}): Future → method FlutterLocalNotificationsPlugin.showDailyAtTime(int id, String title, String body, Time notificationTime, NotificationDetails notificationDetails, {String payload}): Future<void> - changed:
method FlutterLocalNotificationsPlugin.showWeeklyAtDayAndTime(int id, String title, String body, Day day, Time notificationTime, NotificationDetails notificationDetails, {String payload}): Future → method FlutterLocalNotificationsPlugin.showWeeklyAtDayAndTime(int id, String title, String body, Day day, Time notificationTime, NotificationDetails notificationDetails, {String payload}): Future<void> - added:
class PendingNotificationRequest - added:
ctor PendingNotificationRequest( this.id, this.title, this.body, this.payload) - added:
field PendingNotificationRequest.body: final String - added:
field PendingNotificationRequest.id: final int - added:
field PendingNotificationRequest.payload: final String - added:
field PendingNotificationRequest.title: final String - added:
method FlutterLocalNotificationsPlugin.pendingNotificationRequests(): Future<List<PendingNotificationRequest>> - added:
typedef DidReceiveLocalNotificationCallback = Future<dynamic> Function( int id, String title, String body, String payload) - added:
typedef SelectNotificationCallback = Future<dynamic> Function(String payload)