Skip to content

Commit

Permalink
[flutter_local_notifications] tweaks to id validation to used named A…
Browse files Browse the repository at this point in the history
…rgumentError constructors (#453)

* tweaks to id validation to used named ArgumentError constructors

* bump pubspec and update changelog
  • Loading branch information
MaikuB authored Jan 23, 2020
1 parent af61cb5 commit fee6ec5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions flutter_local_notifications/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# [1.1.2]
* Passing a null notification id now throws an `ArgumentError`. Thanks to PR from [talmor_guy](https://github.com/talmor-guy)
* Slight tweak to message displayed with by `ArgumentError` when notification id is not within range of a 32-bit integer

# [1.1.1]
* [Android] Added ability to specify timeout duration of notification
* [Android] Added ability to specify the notification category
Expand Down
6 changes: 3 additions & 3 deletions flutter_local_notifications/lib/src/helpers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
/// Ensures IDs are valid 32-bit integers.
void validateId(int id) {
if (id == null) {
throw ArgumentError('id must not be null');
throw ArgumentError.notNull('id');
}

if (id > 0x7FFFFFFF || id < -0x80000000) {
throw ArgumentError(
'id must fit within the size of a 32-bit integer i.e. in the range [-2^31, 2^31 - 1]');
throw ArgumentError.value(id, 'id',
'must fit within the size of a 32-bit integer i.e. in the range [-2^31, 2^31 - 1]');
}
}
2 changes: 1 addition & 1 deletion flutter_local_notifications/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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.1.1
version: 1.1.2
homepage: https://github.com/MaikuB/flutter_local_notifications/tree/master/flutter_local_notifications

dependencies:
Expand Down

0 comments on commit fee6ec5

Please sign in to comment.