diff --git a/README.md b/README.md index 8194fd66a..c4b2915ba 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,20 @@ -# flutter_local_notifications -A Flutter plugin for displaying local notifications on Android and iOS. The repository consists of the following folders +# Flutter Local Notifications plugin + +This repository consists hosts the following packages + +- `flutter_local_notifications`: code for the cross-platform facing plugin used to display local notifications within Flutter applications +- `flutter_local_notifications_platform_interface`: the code for the common platform interface + +These can be found in the corresponding directories within the same name. Most developers are like here as they are looking to use the `flutter_local_notifications` plugin. There is a readme file within each directory with more information. + +## Issues + +If you run into bugs, please raise them on the GitHub repository. Please do not email them to me as GitHub is the appropriate place for them and allows for members of the community to answer questions, particularly if I miss the email. It would also be much appreciated if they could be limited to actual bugs or feature requests. If you're looking at how you could use the plugin to do a particular kind of notification, check the example app provides detailed code samples for each supported feature. Also try to check the README first in case you have missed something e.g. platform-specific setup. + +## Contributions + +Contributions are welcome by submitting a PR for to be reviewed. If it's to add new features, appreciate it if you could try to maintain the architecture or try to improve on it. If you are looking to add platform-specific functionality do not add this to the cross-platform facing API (i.e. the [`FlutterLocalNotificationsPlugin`](https://pub.dev/documentation/flutter_local_notifications/latest/flutter_local_notifications/FlutterLocalNotificationsPlugin-class.html) class. The recommended approaches in this scenario are: + +1. see if it can be passed as platform-specific configuration or +2. add methods to the platform-specific implementations. For example, on iOS there is an [`IOSFlutterLocalNotificationsPlugin`](https://pub.dev/documentation/flutter_local_notifications/latest/flutter_local_notifications/IOSFlutterLocalNotificationsPlugin-class.html) class. You may notice there's a [`requestPermissions()`](https://pub.dev/documentation/flutter_local_notifications/latest/flutter_local_notifications/IOSFlutterLocalNotificationsPlugin/requestPermissions.html) method that only exists there -- flutter_local_notifications: code for the plugin -- flutter_local_notifications_platform_interface: the code for common platform interface diff --git a/flutter_local_notifications/CHANGELOG.md b/flutter_local_notifications/CHANGELOG.md index babe76017..41f73e886 100644 --- a/flutter_local_notifications/CHANGELOG.md +++ b/flutter_local_notifications/CHANGELOG.md @@ -1,7 +1,15 @@ +# [1.2.0+1] + +* The static `values` properties for the `Day` and `Importance` classes now return `List` and `List` respectively instead of being dynamic +* Added more public API documentation +* Updated readme to move issues and contributions section to the readme within the repository +* Added screenshots to readme +* Updated how breaking changes are highlighted in changelog to all the letters aren't capitalised + # [1.2.0] * Added the `resolvePlatformSpecificImplementation()` method to the `FlutterLocalNotificationsPlugin` class. This can be used to resolve the underlying platform implementation in order to access platform-specific APIs. -* **BREAKING CHANGE* the static `instance` properties in the `IOSFlutterLocalNotificationsPlugin` and `AndroidFlutterLocalNotificationsPlugin` classes have been removed due to addition of the `resolvePlatformSpecificImplementation()` +* **Breaking change** the static `instance` properties in the `IOSFlutterLocalNotificationsPlugin` and `AndroidFlutterLocalNotificationsPlugin` classes have been removed due to addition of the `resolvePlatformSpecificImplementation()` * Updated readme to remove use of `new` keyword in code snippets * Bumped e2e dependency * Bumped example app dependencies @@ -59,15 +67,15 @@ # [1.1.0] -* **BREAKING CHANGE** Updated plugin to make use of `flutter_local_notifications_platform_interface` version 1.0.1. This allows for platform-specific implementations of the platform interface to now be accessible. Note that the plugin will check which platform the plugin is running on. +* **Breaking change** Updated plugin to make use of `flutter_local_notifications_platform_interface` version 1.0.1. This allows for platform-specific implementations of the platform interface to now be accessible. Note that the plugin will check which platform the plugin is running on. *Note*: this may have inadvertently broke some tests for users as the plugin now checks which platform the plugin is executing code on and would throw an `UnimplementedError` since neither iOS or Android can be detected. Another issue is that `NotificationAppLaunchDetails` was no longer exposed via the main plugin. Please upgrade to 1.1.3 to have both of these issues fixed -* **BREAKING CHANGE** Plugin callbacks are no longer publicly accessible -* **BREAKING CHANGE** [iOS] Local notifications that launched the app should now only be processed by the plugin if they were created by the plugin. -* **BREAKING CHANGE** `MethodChannel` argument has been removed from the named constructor that was visible for testing purposes +* **Breaking change** Plugin callbacks are no longer publicly accessible +* **Breaking change** [iOS] Local notifications that launched the app should now only be processed by the plugin if they were created by the plugin. +* **Breaking change** `MethodChannel` argument has been removed from the named constructor that was visible for testing purposes # [1.0.0] -* **BREAKING CHANGE** [iOS] Added checks to ensure callbacks are only invoked for notifications originating from the plugin to improve compatibility with other notification plugins. +* **Breaking change** [iOS] Added checks to ensure callbacks are only invoked for notifications originating from the plugin to improve compatibility with other notification plugins. * [Android] Bump Gradle plugin to 3.5.3 # [0.9.1+3] @@ -95,10 +103,10 @@ * [Android] Add ability to customise visibility of a notification on the lockscreen. Thanks to PR by [gianlucaparadise](https://github.com/gianlucaparadise) * [Android] Bumped compile and target SDK to 29 -* **BREAKING CHANGE** [iOS] Plugin no longer registers as a `UNUserNotificationCenterDelegate`. This is to enable compatibility with other plugins that display notifications. Developers must now do this themselves. Refer to the updated iOS integration section for more info on this +* **Breaking change** [iOS] Plugin no longer registers as a `UNUserNotificationCenterDelegate`. This is to enable compatibility with other plugins that display notifications. Developers must now do this themselves. Refer to the updated iOS integration section for more info on this * Updated info about configuring Proguard configuration rules and included a file that could be used for reference in the example app * Removed dependency on the `meta` package -* **BREAKING CHANGE** Now requires Flutter SDK 1.10.0 or greater +* **Breaking change** Now requires Flutter SDK 1.10.0 or greater * Migrate the plugin to the pubspec platforms manifest # [0.8.4+3] @@ -144,8 +152,8 @@ # [0.8.0] * Added an optional parameter named `androidAllowWhileIdle` to `schedule` method. This will allow notifications to still display at the specified time when the Android device is in an low-power idle mode. -* **BREAKING CHANGE** Bump minimum Flutter version to 1.5.0 -* **BREAKING CHANGE** Update Flutter dependencies +* **Breaking change** Bump minimum Flutter version to 1.5.0 +* **Breaking change** Update Flutter dependencies # [0.7.1+3] @@ -166,7 +174,7 @@ # [0.7.0] -* **BREAKING CHANGE** [Android] Updated to Gradle 5.1.1 and Android Gradle plugin has been updated to 3.4.0 (aligns with Android Studio 3.4 release). Example app has also been updated to Gradle 5.1.1. Apps will need to update to use the plugin. Please see [here](https://developer.android.com/studio/releases/gradle-plugin) for more information if you need help on updating +* **Breaking change** [Android] Updated to Gradle 5.1.1 and Android Gradle plugin has been updated to 3.4.0 (aligns with Android Studio 3.4 release). Example app has also been updated to Gradle 5.1.1. Apps will need to update to use the plugin. Please see [here](https://developer.android.com/studio/releases/gradle-plugin) for more information if you need help on updating * [Android] Add ability to specify the LED colour of the notification. Updated example app to show this can be done. Note that for Android 8.0+ (i.e. API 26+) that this is tied to the notification channel @@ -180,8 +188,8 @@ # [0.6.0] -* **BREAKING CHANGE** [Android] Updated Gradle plugin to 3.3.2 -* **BREAKING CHANGE** [Android] Changed to store the name of drawable specified as the small icon to be used for Android notifications instead of the resource ID. This should fix the scenario where an app could be updated and the resource IDs got change and cause scheduled notifications to not appear. Believe this fix should retroactively apply for notifications scheduled with an icon specified but won't apply to those that were scheduled to use the default icon specified via the `initialize` method. This is due to the fact the name of the default icon wasn't being cached in previous ones but this has now changed so it's cached in shared preferences from this version onwards +* **Breaking change** [Android] Updated Gradle plugin to 3.3.2 +* **Breaking change** [Android] Changed to store the name of drawable specified as the small icon to be used for Android notifications instead of the resource ID. This should fix the scenario where an app could be updated and the resource IDs got change and cause scheduled notifications to not appear. Believe this fix should retroactively apply for notifications scheduled with an icon specified but won't apply to those that were scheduled to use the default icon specified via the `initialize` method. This is due to the fact the name of the default icon wasn't being cached in previous ones but this has now changed so it's cached in shared preferences from this version onwards # [0.5.2] @@ -203,7 +211,7 @@ # [0.5.0] -* **BREAKING CHANGE** Migrated to use AndroidX as the Android support libraries are deprecated. There shouldn't be any functional changes. Developers may require migrating their apps to support this following [this guide](https://developer.android.com/jetpack/androidx/migrate). This addresses issue [162](https://github.com/MaikuB/flutter_local_notifications/issues/162). Thanks to [Jeff Scaturro](https://github.com/JeffScaturro) for submitting the PR for this work. Note that if you don't want to migrate your app to use AndroidX yet then you may need to pin dependencies to a specific version +* **Breaking change** Migrated to use AndroidX as the Android support libraries are deprecated. There shouldn't be any functional changes. Developers may require migrating their apps to support this following [this guide](https://developer.android.com/jetpack/androidx/migrate). This addresses issue [162](https://github.com/MaikuB/flutter_local_notifications/issues/162). Thanks to [Jeff Scaturro](https://github.com/JeffScaturro) for submitting the PR for this work. Note that if you don't want to migrate your app to use AndroidX yet then you may need to pin dependencies to a specific version # [0.4.5] @@ -215,11 +223,11 @@ # [0.4.4+1] -* **BREAKING CHANGE** Fix naming of `onDidReceiveLocalNotification` property in the `IOSInitializationSettings` class (was previously named `onDidReceiveLocalNotificationCallback` by accident) +* **Breaking change** Fix naming of `onDidReceiveLocalNotification` property in the `IOSInitializationSettings` class (was previously named `onDidReceiveLocalNotificationCallback` by accident) # [0.4.4] -* **BREAKING CHANGE** removed `registerUNNotificationCenterDelegate` argument for the `IOSInitializationSettings` class as it wasn't actually used. +* **Breaking change** removed `registerUNNotificationCenterDelegate` argument for the `IOSInitializationSettings` class as it wasn't actually used. * Plugin can now handle `didReceiveLocalNotification` delegate method in iOS and allow developers to handle the associated callback in Flutter. Added a `onDidReceiveLocalNotificationCallback` argument to the `IOSInitializationSettings` class to enable this and updated the sample code to demonstrate the usage. This should resolve issue [14](https://github.com/MaikuB/flutter_local_notifications/issues/14). # [0.4.3] @@ -234,16 +242,16 @@ # [0.4.2] -* **BREAKING CHANGE** Fix issue [127](https://github.com/MaikuB/flutter_local_notifications/issues/127) by changing plugin to Android Support Library version 27.1.1, compile and target SDK version to 27 due to issues Flutter has with API 28. +* **Breaking change** Fix issue [127](https://github.com/MaikuB/flutter_local_notifications/issues/127) by changing plugin to Android Support Library version 27.1.1, compile and target SDK version to 27 due to issues Flutter has with API 28. # [0.4.1+1] * Remove unused code in example app # [0.4.1] -* **BREAKING CHANGE** renamed the `selectNotification` callback exposed by the `initialize` function to `onSelectNotification` -* **BREAKING CHANGE** renamed the `MessageHandler` typedef to `SelectNotificationCallback` -* **BREAKING CHANGE** updated plugin to Android Support Library version 28.0, compile and target SDK version to 28 +* **Breaking change** renamed the `selectNotification` callback exposed by the `initialize` function to `onSelectNotification` +* **Breaking change** renamed the `MessageHandler` typedef to `SelectNotificationCallback` +* **Breaking change** updated plugin to Android Support Library version 28.0, compile and target SDK version to 28 * Address issue [115](https://github.com/MaikuB/flutter_local_notifications/issues/115) by adding validation to the notification ID values. This ensure they're within the range of a 32-bit integer as notification IDs on Android need to be within that range. Note that an `ArgumentError` is thrown when a value is out of range. * Updated the Android Integration section around registering receivers via the Android manifest as per the suggestion in [116](https://github.com/MaikuB/flutter_local_notifications/issues/116) * Updated version of the http dependency for used by the example app @@ -277,7 +285,7 @@ ## [0.3.4] -* [Android] Fix issue [71](https://github.com/MaikuB/flutter_local_notifications/issues/71) where the wrong time on when the notification occurred is being displayed. **BREAKING CHANGE** this involves changing it the receiver for displaying a scheduled notification will only build the notification prior to displaying it. There is a fix applied to existing scheduled notifications in this release that will be eventually be removed as going forward all scheduled notifications will work as just described +* [Android] Fix issue [71](https://github.com/MaikuB/flutter_local_notifications/issues/71) where the wrong time on when the notification occurred is being displayed. **Breaking change** this involves changing it the receiver for displaying a scheduled notification will only build the notification prior to displaying it. There is a fix applied to existing scheduled notifications in this release that will be eventually be removed as going forward all scheduled notifications will work as just described * [Android] Fix an issue with serialising and deserialising the notifications so that additional style types (big picture and inbox) would be recognised. This affected scheduled notifications where upon rebooting the device, the plugin would need to reschedule the notifications using information saved in shared preferences. ## [0.3.3] @@ -398,8 +406,8 @@ ## [0.0.9] -* [iOS] Enable ability to customise the sound for notifications (**IMPORTANT** requires testing on older iOS versions < 10) -* [iOS] Can now specify default presentation options (**BREAKING CHANGE** named parameters for iOS initialisation have changed) that can also be overridden at the notification level). +* [iOS] Enable ability to customise the sound for notifications (**Important** requires testing on older iOS versions < 10) +* [iOS] Can now specify default presentation options (**Breaking change** named parameters for iOS initialisation have changed) that can also be overridden at the notification level). * [iOS] Fixes for reading in specified options ## [0.0.8] diff --git a/flutter_local_notifications/README.md b/flutter_local_notifications/README.md index 37e797fae..afc264163 100644 --- a/flutter_local_notifications/README.md +++ b/flutter_local_notifications/README.md @@ -49,6 +49,14 @@ Note that this plugin aims to provide abstractions for all platforms as opposed * iOS has a limit on how many pending notifications it allows. This is a limit imposed by iOS where it will only keep 64 notifications that will fire the soonest * *Known issue*: There is a known issue with handling daylight savings for scheduled notifications. This functionality may be deprecated to be replaced by another that only deals with elapsed time since epoch instead of a date. +## Screenshots + +| Android | iOS | +| ------------- | ------------- | +| | | + + + ## Acknowledgements * [Javier Lecuona](https://github.com/javiercbk) for submitting the PR that added the ability to have notifications shown daily @@ -57,12 +65,6 @@ Note that this plugin aims to provide abstractions for all platforms as opposed * [Zhang Jing](https://github.com/byrdkm17) for adding 'ticker' support for Android notifications * ...and everyone else for their contributions. They are greatly appreciated -## Raising issues and contributions - -If you run into issues, please raise them on the GitHub repository. Please do not email them to me as GitHub is the appropriate place for them and allows for members of the community to answer questions, particularly if I miss the email. It would also be much appreciated if they could be limited to actual bugs or feature requests. If you're looking at how you could use the plugin to do a particular kind of notification, check the example app provides detailed code samples for each supported feature. Also try to check the README first in case you have missed something e.g. platform-specific setup. - -Contributions are welcome by submitting a PR for me to review. If it's to add new features, appreciate it if you could try to maintain the architecture or try to improve on it. However, do note that I will not take PRs that add methods at the Dart level that don't work on all platforms. However, platform-specific configuration through the use parameters are fine as that's approach being taken via this plugin. - ## Getting Started The GitHub repository has an example app that should demonstrate of all the supported features of the plugin. Please check the example for more detailed code samples. If you only copy and paste the Dart code then this will not work as there's setup required for each platform. Pub also generates API docs for the latest version [here](https://pub.dartlang.org/documentation/flutter_local_notifications/latest/). Besides referring to the example app and getting started section, please ensure that you have performed the steps in the integration guide for each platform further below. diff --git a/flutter_local_notifications/lib/src/platform_specifics/android/enums.dart b/flutter_local_notifications/lib/src/platform_specifics/android/enums.dart index 7b6a0b270..65ad3ebca 100644 --- a/flutter_local_notifications/lib/src/platform_specifics/android/enums.dart +++ b/flutter_local_notifications/lib/src/platform_specifics/android/enums.dart @@ -32,7 +32,9 @@ class Importance { static const High = Importance(4); static const Max = Importance(5); - static get values => [Unspecified, None, Min, Low, Default, High, Max]; + /// All the possible values for the [Importance] enumeration. + static List get values => + [Unspecified, None, Min, Low, Default, High, Max]; final int value; diff --git a/flutter_local_notifications/lib/src/platform_specifics/android/initialization_settings.dart b/flutter_local_notifications/lib/src/platform_specifics/android/initialization_settings.dart index 63f28726d..e8c0e556c 100644 --- a/flutter_local_notifications/lib/src/platform_specifics/android/initialization_settings.dart +++ b/flutter_local_notifications/lib/src/platform_specifics/android/initialization_settings.dart @@ -5,6 +5,9 @@ class AndroidInitializationSettings { const AndroidInitializationSettings(this.defaultIcon); + /// Create a [Map] object that describes the [AndroidInitializationSettings] object. + /// + /// Mainly for internal use to send the data over a platform channel. Map toMap() { return {'defaultIcon': this.defaultIcon}; } diff --git a/flutter_local_notifications/lib/src/platform_specifics/android/message.dart b/flutter_local_notifications/lib/src/platform_specifics/android/message.dart index 72ce60a4a..3bc9f120b 100644 --- a/flutter_local_notifications/lib/src/platform_specifics/android/message.dart +++ b/flutter_local_notifications/lib/src/platform_specifics/android/message.dart @@ -30,6 +30,9 @@ class Message { 'Must provide both dataMimeType and dataUri together or not at all.'); } + /// Create a [Map] object that describes the [Message] object. + /// + /// Mainly for internal use to send the data over a platform channel. Map toMap() { return { 'text': text, diff --git a/flutter_local_notifications/lib/src/platform_specifics/android/notification_details.dart b/flutter_local_notifications/lib/src/platform_specifics/android/notification_details.dart index 1218f5dda..df63a9c2b 100644 --- a/flutter_local_notifications/lib/src/platform_specifics/android/notification_details.dart +++ b/flutter_local_notifications/lib/src/platform_specifics/android/notification_details.dart @@ -183,6 +183,9 @@ class AndroidNotificationDetails { this.timeoutAfter, this.category}); + /// Create a [Map] object that describes the [AndroidNotificationDetails] object. + /// + /// Mainly for internal use to send the data over a platform channel. Map toMap() { return { 'icon': icon, diff --git a/flutter_local_notifications/lib/src/platform_specifics/android/person.dart b/flutter_local_notifications/lib/src/platform_specifics/android/person.dart index 823c584a8..788296817 100644 --- a/flutter_local_notifications/lib/src/platform_specifics/android/person.dart +++ b/flutter_local_notifications/lib/src/platform_specifics/android/person.dart @@ -32,6 +32,9 @@ class Person { this.name, this.uri}); + /// Create a [Map] object that describes the [Person] object. + /// + /// Mainly for internal use to send the data over a platform channel. Map toMap() { return { 'bot': bot, diff --git a/flutter_local_notifications/lib/src/platform_specifics/android/styles/big_picture_style_information.dart b/flutter_local_notifications/lib/src/platform_specifics/android/styles/big_picture_style_information.dart index c2a19b3e5..7772d5958 100644 --- a/flutter_local_notifications/lib/src/platform_specifics/android/styles/big_picture_style_information.dart +++ b/flutter_local_notifications/lib/src/platform_specifics/android/styles/big_picture_style_information.dart @@ -46,6 +46,9 @@ class BigPictureStyleInformation extends DefaultStyleInformation { this.hideExpandedLargeIcon = false}) : super(htmlFormatContent, htmlFormatTitle); + /// Create a [Map] object that describes the [BigPictureStyleInformation] object. + /// + /// Mainly for internal use to send the data over a platform channel. @override Map toMap() { var styleJson = super.toMap(); diff --git a/flutter_local_notifications/lib/src/platform_specifics/android/styles/big_text_style_information.dart b/flutter_local_notifications/lib/src/platform_specifics/android/styles/big_text_style_information.dart index 523f672ad..2d434ec9f 100644 --- a/flutter_local_notifications/lib/src/platform_specifics/android/styles/big_text_style_information.dart +++ b/flutter_local_notifications/lib/src/platform_specifics/android/styles/big_text_style_information.dart @@ -30,6 +30,10 @@ class BigTextStyleInformation extends DefaultStyleInformation { bool htmlFormatTitle = false}) : super(htmlFormatContent, htmlFormatTitle); + /// Create a [Map] object that describes the [BigTextStyleInformation] object. + /// + /// Mainly for internal use to send the data over a platform channel. + @override Map toMap() { var styleJson = super.toMap(); diff --git a/flutter_local_notifications/lib/src/platform_specifics/android/styles/default_style_information.dart b/flutter_local_notifications/lib/src/platform_specifics/android/styles/default_style_information.dart index a1573337a..22775d88e 100644 --- a/flutter_local_notifications/lib/src/platform_specifics/android/styles/default_style_information.dart +++ b/flutter_local_notifications/lib/src/platform_specifics/android/styles/default_style_information.dart @@ -11,6 +11,9 @@ class DefaultStyleInformation extends StyleInformation { DefaultStyleInformation(this.htmlFormatContent, this.htmlFormatTitle) : super(); + /// Create a [Map] object that describes the [DefaultStyleInformation] object. + /// + /// Mainly for internal use to send the data over a platform channel. Map toMap() { return { 'htmlFormatContent': htmlFormatContent, diff --git a/flutter_local_notifications/lib/src/platform_specifics/android/styles/inbox_style_information.dart b/flutter_local_notifications/lib/src/platform_specifics/android/styles/inbox_style_information.dart index c347644bb..db2e1df26 100644 --- a/flutter_local_notifications/lib/src/platform_specifics/android/styles/inbox_style_information.dart +++ b/flutter_local_notifications/lib/src/platform_specifics/android/styles/inbox_style_information.dart @@ -30,9 +30,12 @@ class InboxStyleInformation extends DefaultStyleInformation { bool htmlFormatTitle = false}) : super(htmlFormatContent, htmlFormatTitle); + /// Create a [Map] object that describes the [InboxStyleInformation] object. + /// + /// Mainly for internal use to send the data over a platform channel. + @override Map toMap() { var styleJson = super.toMap(); - var bigTextStyleJson = { 'contentTitle': contentTitle, 'htmlFormatContentTitle': htmlFormatContentTitle, diff --git a/flutter_local_notifications/lib/src/platform_specifics/android/styles/messaging_style_information.dart b/flutter_local_notifications/lib/src/platform_specifics/android/styles/messaging_style_information.dart index cb1585e43..9f05717c0 100644 --- a/flutter_local_notifications/lib/src/platform_specifics/android/styles/messaging_style_information.dart +++ b/flutter_local_notifications/lib/src/platform_specifics/android/styles/messaging_style_information.dart @@ -26,6 +26,10 @@ class MessagingStyleInformation extends DefaultStyleInformation { assert(this.person?.name != null, 'Must provide the details of the person'); } + /// Create a [Map] object that describes the [MessagingStyleInformation] object. + /// + /// Mainly for internal use to send the data over a platform channel. + @override Map toMap() { var styleJson = super.toMap(); styleJson['person'] = person.toMap(); diff --git a/flutter_local_notifications/lib/src/platform_specifics/ios/initialization_settings.dart b/flutter_local_notifications/lib/src/platform_specifics/ios/initialization_settings.dart index ac15fb066..79576ec73 100644 --- a/flutter_local_notifications/lib/src/platform_specifics/ios/initialization_settings.dart +++ b/flutter_local_notifications/lib/src/platform_specifics/ios/initialization_settings.dart @@ -50,6 +50,9 @@ class IOSInitializationSettings { this.defaultPresentBadge = true, this.onDidReceiveLocalNotification}); + /// Create a [Map] object that describes the [IOSInitializationSettings] object. + /// + /// Mainly for internal use to send the data over a platform channel. Map toMap() { return { 'requestAlertPermission': requestAlertPermission, diff --git a/flutter_local_notifications/lib/src/platform_specifics/ios/notification_details.dart b/flutter_local_notifications/lib/src/platform_specifics/ios/notification_details.dart index c36335b3b..40ab1ce9b 100644 --- a/flutter_local_notifications/lib/src/platform_specifics/ios/notification_details.dart +++ b/flutter_local_notifications/lib/src/platform_specifics/ios/notification_details.dart @@ -33,6 +33,9 @@ class IOSNotificationDetails { this.sound, this.badgeNumber}); + /// Create a [Map] object that describes the [IOSNotificationDetails] object. + /// + /// Mainly for internal use to send the data over a platform channel. Map toMap() { return { 'presentAlert': presentAlert, diff --git a/flutter_local_notifications/lib/src/types.dart b/flutter_local_notifications/lib/src/types.dart index e1e3789bc..c3e673c99 100644 --- a/flutter_local_notifications/lib/src/types.dart +++ b/flutter_local_notifications/lib/src/types.dart @@ -8,7 +8,8 @@ class Day { static const Friday = Day(6); static const Saturday = Day(7); - static get values => + /// All the possible values for the [Day] enumeration. + static List get values => [Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday]; final int value; @@ -39,6 +40,9 @@ class Time { assert(this.second >= 0 && this.second < 60); } + /// Create a [Map] object that describes the [Time] object. + /// + /// Mainly for internal use to send the data over a platform channel. Map toMap() { return { 'hour': hour, diff --git a/flutter_local_notifications/pubspec.yaml b/flutter_local_notifications/pubspec.yaml index 5fccf6d00..3877307d1 100644 --- a/flutter_local_notifications/pubspec.yaml +++ b/flutter_local_notifications/pubspec.yaml @@ -1,6 +1,6 @@ name: flutter_local_notifications description: A cross platform plugin for displaying and scheduling local notifications for Flutter applications with the ability to customise for each platform. -version: 1.2.0 +version: 1.2.0+1 homepage: https://github.com/MaikuB/flutter_local_notifications/tree/master/flutter_local_notifications dependencies: diff --git a/images/android_notification.png b/images/android_notification.png new file mode 100644 index 000000000..f720663da Binary files /dev/null and b/images/android_notification.png differ diff --git a/images/ios_notification.png b/images/ios_notification.png new file mode 100644 index 000000000..f072eadf7 Binary files /dev/null and b/images/ios_notification.png differ