Skip to content

Commit bba3ec0

Browse files
committed
v0.1.3
1 parent 35bb086 commit bba3ec0

File tree

5 files changed

+33
-8
lines changed

5 files changed

+33
-8
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.1.3
2+
3+
* [windows] Fix auto-create shortcut #5
4+
* [windows] Add closeReason in onLocalNotificationClose event #6
5+
16
## 0.1.2
27

38
* Implemented `close` method.

README-ZH.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
```yaml
4747
dependencies:
48-
local_notifier: ^0.1.2
48+
local_notifier: ^0.1.3
4949
```
5050
5151
@@ -81,8 +81,18 @@ LocalNotification notification = LocalNotification(
8181
notification.onShow = () {
8282
print('onShow ${notification.identifier}');
8383
};
84-
notification.onClose = () {
85-
print('onClose ${notification.identifier}');
84+
notification.onClose = (closeReason) {
85+
// 只支持在windows,其他平台 closeReason 始终为 unknown。
86+
switch (closeReason) {
87+
case LocalNotificationCloseReason.userCanceled:
88+
// do something
89+
break;
90+
case LocalNotificationCloseReason.timedOut:
91+
// do something
92+
break;
93+
default:
94+
}
95+
print('onClose ${_exampleNotification?.identifier} - $closeReason');
8696
};
8797
notification.onClick = () {
8898
print('onClick ${notification.identifier}');

README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Add this to your package's pubspec.yaml file:
4545

4646
```yaml
4747
dependencies:
48-
local_notifier: ^0.1.2
48+
local_notifier: ^0.1.3
4949
```
5050
5151
Or
@@ -81,8 +81,18 @@ LocalNotification notification = LocalNotification(
8181
notification.onShow = () {
8282
print('onShow ${notification.identifier}');
8383
};
84-
notification.onClose = () {
85-
print('onClose ${notification.identifier}');
84+
notification.onClose = (closeReason) {
85+
// Only supported on windows, other platforms closeReason is always unknown.
86+
switch (closeReason) {
87+
case LocalNotificationCloseReason.userCanceled:
88+
// do something
89+
break;
90+
case LocalNotificationCloseReason.timedOut:
91+
// do something
92+
break;
93+
default:
94+
}
95+
print('onClose ${_exampleNotification?.identifier} - $closeReason');
8696
};
8797
notification.onClick = () {
8898
print('onClick ${notification.identifier}');

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ packages:
8787
path: ".."
8888
relative: true
8989
source: path
90-
version: "0.1.2"
90+
version: "0.1.3"
9191
matcher:
9292
dependency: transitive
9393
description:

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: local_notifier
22
description: This plugin allows Flutter desktop apps to displaying local notifications.
3-
version: 0.1.2
3+
version: 0.1.3
44
homepage: https://github.com/leanflutter/local_notifier
55

66
platforms:

0 commit comments

Comments
 (0)