File tree 5 files changed +33
-8
lines changed
5 files changed +33
-8
lines changed Original file line number Diff line number Diff line change
1
+ ## 0.1.3
2
+
3
+ * [ windows] Fix auto-create shortcut #5
4
+ * [ windows] Add closeReason in onLocalNotificationClose event #6
5
+
1
6
## 0.1.2
2
7
3
8
* Implemented ` close ` method.
Original file line number Diff line number Diff line change 45
45
46
46
``` yaml
47
47
dependencies :
48
- local_notifier : ^0.1.2
48
+ local_notifier : ^0.1.3
49
49
` ` `
50
50
51
51
或
@@ -81,8 +81,18 @@ LocalNotification notification = LocalNotification(
81
81
notification.onShow = () {
82
82
print('onShow ${notification.identifier}');
83
83
};
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');
86
96
};
87
97
notification.onClick = () {
88
98
print('onClick ${notification.identifier}');
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ Add this to your package's pubspec.yaml file:
45
45
46
46
``` yaml
47
47
dependencies :
48
- local_notifier : ^0.1.2
48
+ local_notifier : ^0.1.3
49
49
` ` `
50
50
51
51
Or
@@ -81,8 +81,18 @@ LocalNotification notification = LocalNotification(
81
81
notification.onShow = () {
82
82
print('onShow ${notification.identifier}');
83
83
};
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');
86
96
};
87
97
notification.onClick = () {
88
98
print('onClick ${notification.identifier}');
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ packages:
87
87
path: ".."
88
88
relative: true
89
89
source: path
90
- version: "0.1.2 "
90
+ version: "0.1.3 "
91
91
matcher:
92
92
dependency: transitive
93
93
description:
Original file line number Diff line number Diff line change 1
1
name : local_notifier
2
2
description : This plugin allows Flutter desktop apps to displaying local notifications.
3
- version : 0.1.2
3
+ version : 0.1.3
4
4
homepage : https://github.com/leanflutter/local_notifier
5
5
6
6
platforms :
You can’t perform that action at this time.
0 commit comments