Skip to content

Upgrading flutter_local_notifications 19 to 20

Breaking19.5.0 → 20.1.0Breaking6Platform1New1Changed2Fixed1Other3

BreakingUpgrade verdict

6 breaking changes and a platform requirement change.

  • Windows code using the old parameter names must be updated to the new names.
  • Windows code passing details to zonedScheduleRawXml() must stop doing so.
  • Calls to these methods must now pass arguments by name instead of by position.
  • Android calls to these methods must now pass arguments by name.
Top 4 of 7 that need code or config changes

Dart SDK requirement changed in 20.0.0-dev.1: ^3.4.0 → ^3.8.0.

Flutter requirement changed in 20.0.0-dev.1: >=3.22.0 → >=3.32.0.

Breaking6
Renames the Windows details parameter to notificationDetails in show() and zonedSchedule(), and onNotificationReceived to onDidReceiveNotificationResponse in initialize().
show()zonedSchedule()initialize()detailsnotificationDetailsonNotificationReceivedonDidReceiveNotificationResponse
Removes the unused details parameter from the Windows zonedScheduleRawXml() method.
zonedScheduleRawXml()details
Converts positional parameters to named parameters in initialize(), show(), periodicallyShow(), periodicallyShowWithDuration(), cancel() and zonedSchedule() across all platforms.
initialize()show()periodicallyShow()periodicallyShowWithDuration()cancel()zonedSchedule()
Converts positional parameters to named parameters in Android startForegroundService(), deleteNotificationChannelGroup(), deleteNotificationChannel() and getActiveNotificationMessagingStyle().
startForegroundService()deleteNotificationChannelGroup()deleteNotificationChannel()getActiveNotificationMessagingStyle()
Converts positional parameters to named parameters in the Linux LinuxNotificationCustomHint() method.
LinuxNotificationCustomHint()
Converts positional parameters to named parameters in Windows showRawXml() and zonedScheduleRawXml().
showRawXml()zonedScheduleRawXml()
Platform1
Raises the minimum Flutter SDK requirement to 3.32.0 and the Dart SDK requirement to 3.8.0.

Generated by DepDelta from published Dart source. Not mixed with prose notes.

  • changed: ctor AndroidNotificationChannelGroup( this.id, this.name, { this.description, }) → ctor AndroidNotificationChannelGroup(this.id, this.name, {this.description})
  • changed: ctor DefaultStyleInformation( this.htmlFormatContent, this.htmlFormatTitle, ) → ctor DefaultStyleInformation(this.htmlFormatContent, this.htmlFormatTitle)
  • changed: ctor NotificationsEnabledOptions({ required this.isEnabled, required this.isSoundEnabled, required this.isAlertEnabled, required this.isBadgeEnabled, required this.isProvisionalEnabled, required this.isCriticalEnabled, required this.isProvidesAppNotificationSettingsEnabled, }) → ctor NotificationsEnabledOptions({ required this.isEnabled, required this.isSoundEnabled, required this.isAlertEnabled, required this.isBadgeEnabled, required this.isProvisionalEnabled, required this.isCriticalEnabled, required this.isProvidesAppNotificationSettingsEnabled, this.isCarPlayEnabled = …, })
  • changed: field DarwinNotificationAction.type: final _DarwinNotificationActionType → field DarwinNotificationAction.type: final DarwinNotificationActionType
  • changed: method AndroidFlutterLocalNotificationsPlugin.cancel(int id, {String? tag}): Future<void> → method AndroidFlutterLocalNotificationsPlugin.cancel({required int id, String? tag}): Future<void>
  • changed: method AndroidFlutterLocalNotificationsPlugin.createNotificationChannel( AndroidNotificationChannel notificationChannel): Future<void> → method AndroidFlutterLocalNotificationsPlugin.createNotificationChannel( AndroidNotificationChannel notificationChannel, ): Future<void>
  • changed: method AndroidFlutterLocalNotificationsPlugin.createNotificationChannelGroup( AndroidNotificationChannelGroup notificationChannelGroup): Future<void> → method AndroidFlutterLocalNotificationsPlugin.createNotificationChannelGroup( AndroidNotificationChannelGroup notificationChannelGroup, ): Future<void>
  • changed: method AndroidFlutterLocalNotificationsPlugin.deleteNotificationChannel(String channelId): Future<void> → method AndroidFlutterLocalNotificationsPlugin.deleteNotificationChannel({required String channelId}): Future<void>
  • changed: method AndroidFlutterLocalNotificationsPlugin.deleteNotificationChannelGroup(String groupId): Future<void> → method AndroidFlutterLocalNotificationsPlugin.deleteNotificationChannelGroup({required String groupId}): Future<void>
  • changed: method AndroidFlutterLocalNotificationsPlugin.getActiveNotificationMessagingStyle( int id, { String? tag, }): Future<MessagingStyleInformation?> → method AndroidFlutterLocalNotificationsPlugin.getActiveNotificationMessagingStyle({ required int id, String? tag, }): Future<MessagingStyleInformation?>
  • changed: method AndroidFlutterLocalNotificationsPlugin.initialize( AndroidInitializationSettings initializationSettings, { DidReceiveNotificationResponseCallback? onDidReceiveNotificationResponse, DidReceiveBackgroundNotificationResponseCallback? onDidReceiveBackgroundNotificationResponse, }): Future<bool> → method AndroidFlutterLocalNotificationsPlugin.initialize({ required AndroidInitializationSettings settings, DidReceiveNotificationResponseCallback? onDidReceiveNotificationResponse, DidReceiveBackgroundNotificationResponseCallback? onDidReceiveBackgroundNotificationResponse, }): Future<bool>
  • changed: method AndroidFlutterLocalNotificationsPlugin.periodicallyShow( int id, String? title, String? body, RepeatInterval repeatInterval, { AndroidNotificationDetails? notificationDetails, String? payload, AndroidScheduleMode scheduleMode = …, }): Future<void> → method AndroidFlutterLocalNotificationsPlugin.periodicallyShow({ required int id, String? title, String? body, required RepeatInterval repeatInterval, AndroidNotificationDetails? notificationDetails, String? payload, AndroidScheduleMode scheduleMode = …, }): Future<void>
  • changed: method AndroidFlutterLocalNotificationsPlugin.periodicallyShowWithDuration( int id, String? title, String? body, Duration repeatDurationInterval, { AndroidNotificationDetails? notificationDetails, String? payload, AndroidScheduleMode scheduleMode = …, }): Future<void> → method AndroidFlutterLocalNotificationsPlugin.periodicallyShowWithDuration({ required int id, String? title, String? body, required Duration repeatDurationInterval, AndroidNotificationDetails? notificationDetails, String? payload, AndroidScheduleMode scheduleMode = …, }): Future<void>
  • changed: method AndroidFlutterLocalNotificationsPlugin.show( int id, String? title, String? body, { AndroidNotificationDetails? notificationDetails, String? payload, }): Future<void> → method AndroidFlutterLocalNotificationsPlugin.show({ required int id, String? title, String? body, AndroidNotificationDetails? notificationDetails, String? payload, }): Future<void>
  • changed: method AndroidFlutterLocalNotificationsPlugin.startForegroundService(int id, String? title, String? body, {AndroidNotificationDetails? notificationDetails, String? payload, AndroidServiceStartType startType = …, Set<AndroidServiceForegroundType>? foregroundServiceTypes}): Future<void> → method AndroidFlutterLocalNotificationsPlugin.startForegroundService({ required int id, String? title, String? body, AndroidNotificationDetails? notificationDetails, String? payload, AndroidServiceStartType startType = …, Set<AndroidServiceForegroundType>? foregroundServiceTypes, }): Future<void>
  • changed: method AndroidFlutterLocalNotificationsPlugin.zonedSchedule( int id, String? title, String? body, TZDateTime scheduledDate, AndroidNotificationDetails? notificationDetails, { required AndroidScheduleMode scheduleMode, String? payload, DateTimeComponents? matchDateTimeComponents, }): Future<void> → method AndroidFlutterLocalNotificationsPlugin.zonedSchedule({ required int id, String? title, String? body, required TZDateTime scheduledDate, AndroidNotificationDetails? notificationDetails, required AndroidScheduleMode scheduleMode, String? payload, DateTimeComponents? matchDateTimeComponents, }): Future<void>
  • changed: method FlutterLocalNotificationsPlugin.cancel(int id, {String? tag}): Future<void> → method FlutterLocalNotificationsPlugin.cancel({required int id, String? tag}): Future<void>
  • changed: method FlutterLocalNotificationsPlugin.initialize( InitializationSettings initializationSettings, { DidReceiveNotificationResponseCallback? onDidReceiveNotificationResponse, DidReceiveBackgroundNotificationResponseCallback? onDidReceiveBackgroundNotificationResponse, }): Future<bool?> → method FlutterLocalNotificationsPlugin.initialize({ required InitializationSettings settings, DidReceiveNotificationResponseCallback? onDidReceiveNotificationResponse, DidReceiveBackgroundNotificationResponseCallback? onDidReceiveBackgroundNotificationResponse, }): Future<bool?>
  • changed: method FlutterLocalNotificationsPlugin.periodicallyShow( int id, String? title, String? body, RepeatInterval repeatInterval, NotificationDetails notificationDetails, { required AndroidScheduleMode androidScheduleMode, String? payload, }): Future<void> → method FlutterLocalNotificationsPlugin.periodicallyShow({ required int id, required RepeatInterval repeatInterval, required NotificationDetails notificationDetails, required AndroidScheduleMode androidScheduleMode, String? title, String? body, String? payload, }): Future<void>
  • changed: method FlutterLocalNotificationsPlugin.periodicallyShowWithDuration( int id, String? title, String? body, Duration repeatDurationInterval, NotificationDetails notificationDetails, { AndroidScheduleMode androidScheduleMode = …, String? payload, }): Future<void> → method FlutterLocalNotificationsPlugin.periodicallyShowWithDuration({ required int id, required Duration repeatDurationInterval, required NotificationDetails notificationDetails, String? title, String? body, AndroidScheduleMode androidScheduleMode = …, String? payload, }): Future<void>
  • changed: method FlutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation< T extends FlutterLocalNotificationsPlatform>(): T? → method FlutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation< T extends FlutterLocalNotificationsPlatform >(): T?
  • changed: method FlutterLocalNotificationsPlugin.show( int id, String? title, String? body, NotificationDetails? notificationDetails, { String? payload, }): Future<void> → method FlutterLocalNotificationsPlugin.show({ required int id, String? title, String? body, NotificationDetails? notificationDetails, String? payload, }): Future<void>
  • changed: method FlutterLocalNotificationsPlugin.zonedSchedule( int id, String? title, String? body, TZDateTime scheduledDate, NotificationDetails notificationDetails, { required AndroidScheduleMode androidScheduleMode, String? payload, DateTimeComponents? matchDateTimeComponents, }): Future<void> → method FlutterLocalNotificationsPlugin.zonedSchedule({ required int id, required TZDateTime scheduledDate, required NotificationDetails notificationDetails, required AndroidScheduleMode androidScheduleMode, String? title, String? body, String? payload, DateTimeComponents? matchDateTimeComponents, }): Future<void>
  • changed: method IOSFlutterLocalNotificationsPlugin.initialize( DarwinInitializationSettings initializationSettings, { DidReceiveNotificationResponseCallback? onDidReceiveNotificationResponse, DidReceiveBackgroundNotificationResponseCallback? onDidReceiveBackgroundNotificationResponse, }): Future<bool?> → method IOSFlutterLocalNotificationsPlugin.initialize({ required DarwinInitializationSettings settings, DidReceiveNotificationResponseCallback? onDidReceiveNotificationResponse, DidReceiveBackgroundNotificationResponseCallback? onDidReceiveBackgroundNotificationResponse, }): Future<bool?>
  • changed: method IOSFlutterLocalNotificationsPlugin.periodicallyShow( int id, String? title, String? body, RepeatInterval repeatInterval, { DarwinNotificationDetails? notificationDetails, String? payload, }): Future<void> → method IOSFlutterLocalNotificationsPlugin.periodicallyShow({ required int id, String? title, String? body, required RepeatInterval repeatInterval, DarwinNotificationDetails? notificationDetails, String? payload, }): Future<void>
  • changed: method IOSFlutterLocalNotificationsPlugin.periodicallyShowWithDuration( int id, String? title, String? body, Duration repeatDurationInterval, { DarwinNotificationDetails? notificationDetails, String? payload, }): Future<void> → method IOSFlutterLocalNotificationsPlugin.periodicallyShowWithDuration({ required int id, String? title, String? body, required Duration repeatDurationInterval, DarwinNotificationDetails? notificationDetails, String? payload, }): Future<void>
  • changed: method IOSFlutterLocalNotificationsPlugin.requestPermissions({ bool sound = …, bool alert = …, bool badge = …, bool provisional = …, bool critical = …, bool providesAppNotificationSettings = …, }): Future<bool?> → method IOSFlutterLocalNotificationsPlugin.requestPermissions({ bool sound = …, bool alert = …, bool badge = …, bool provisional = …, bool critical = …, bool carPlay = …, bool providesAppNotificationSettings = …, }): Future<bool?>
  • changed: method IOSFlutterLocalNotificationsPlugin.show( int id, String? title, String? body, { DarwinNotificationDetails? notificationDetails, String? payload, }): Future<void> → method IOSFlutterLocalNotificationsPlugin.show({ required int id, String? title, String? body, DarwinNotificationDetails? notificationDetails, String? payload, }): Future<void>
  • changed: method IOSFlutterLocalNotificationsPlugin.zonedSchedule( int id, String? title, String? body, TZDateTime scheduledDate, DarwinNotificationDetails? notificationDetails, { String? payload, DateTimeComponents? matchDateTimeComponents, }): Future<void> → method IOSFlutterLocalNotificationsPlugin.zonedSchedule({ required int id, String? title, String? body, required TZDateTime scheduledDate, DarwinNotificationDetails? notificationDetails, String? payload, DateTimeComponents? matchDateTimeComponents, }): Future<void>
  • changed: method MacOSFlutterLocalNotificationsPlugin.initialize( DarwinInitializationSettings initializationSettings, { DidReceiveNotificationResponseCallback? onDidReceiveNotificationResponse, }): Future<bool?> → method MacOSFlutterLocalNotificationsPlugin.initialize({ required DarwinInitializationSettings settings, DidReceiveNotificationResponseCallback? onDidReceiveNotificationResponse, }): Future<bool?>
  • changed: method MacOSFlutterLocalNotificationsPlugin.periodicallyShow( int id, String? title, String? body, RepeatInterval repeatInterval, { DarwinNotificationDetails? notificationDetails, String? payload, }): Future<void> → method MacOSFlutterLocalNotificationsPlugin.periodicallyShow({ required int id, String? title, String? body, required RepeatInterval repeatInterval, DarwinNotificationDetails? notificationDetails, String? payload, }): Future<void>
  • changed: method MacOSFlutterLocalNotificationsPlugin.periodicallyShowWithDuration( int id, String? title, String? body, Duration repeatDurationInterval, { DarwinNotificationDetails? notificationDetails, String? payload, }): Future<void> → method MacOSFlutterLocalNotificationsPlugin.periodicallyShowWithDuration({ required int id, String? title, String? body, required Duration repeatDurationInterval, DarwinNotificationDetails? notificationDetails, String? payload, }): Future<void>
  • changed: method MacOSFlutterLocalNotificationsPlugin.show( int id, String? title, String? body, { DarwinNotificationDetails? notificationDetails, String? payload, }): Future<void> → method MacOSFlutterLocalNotificationsPlugin.show({ required int id, String? title, String? body, DarwinNotificationDetails? notificationDetails, String? payload, }): Future<void>
  • changed: method MacOSFlutterLocalNotificationsPlugin.zonedSchedule( int id, String? title, String? body, TZDateTime scheduledDate, DarwinNotificationDetails? notificationDetails, { String? payload, DateTimeComponents? matchDateTimeComponents, }): Future<void> → method MacOSFlutterLocalNotificationsPlugin.zonedSchedule({ required int id, String? title, String? body, required TZDateTime scheduledDate, DarwinNotificationDetails? notificationDetails, String? payload, DateTimeComponents? matchDateTimeComponents, }): Future<void>
  • changed: typedef DidReceiveLocalNotificationCallback = void Function( int id, String? title, String? body, String? payload) → typedef DidReceiveLocalNotificationCallback = void Function(int id, String? title, String? body, String? payload)
  • added: class AndroidIcon<T>: abstract
  • added: class IOSInitializationSettings extends DarwinInitializationSettings
  • added: ctor IOSInitializationSettings({ super.requestAlertPermission = …, super.requestSoundPermission = …, super.requestBadgePermission = …, super.requestProvisionalPermission = …, super.requestCriticalPermission = …, super.requestProvidesAppNotificationSettings = …, this.requestCarPlayPermission = …, super.defaultPresentAlert = …, super.defaultPresentSound = …, super.defaultPresentBadge = …, super.def…
  • added: field IOSInitializationSettings.requestCarPlayPermission: final bool
  • added: field NotificationsEnabledOptions.isCarPlayEnabled: final bool
  • added: get AndroidIcon.data: T
  • added: get AndroidIcon.source: AndroidIconSource