File tree Expand file tree Collapse file tree 5 files changed +33
-8
lines changed
Expand file tree Collapse file tree 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+
16## 0.1.2
27
38* Implemented ` close ` method.
Original file line number Diff line number Diff line change 4545
4646``` yaml
4747dependencies :
48- local_notifier : ^0.1.2
48+ local_notifier : ^0.1.3
4949` ` `
5050
5151或
@@ -81,8 +81,18 @@ LocalNotification notification = LocalNotification(
8181notification.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};
8797notification.onClick = () {
8898 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:
4545
4646``` yaml
4747dependencies :
48- local_notifier : ^0.1.2
48+ local_notifier : ^0.1.3
4949` ` `
5050
5151Or
@@ -81,8 +81,18 @@ LocalNotification notification = LocalNotification(
8181notification.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};
8797notification.onClick = () {
8898 print('onClick ${notification.identifier}');
Original file line number Diff line number Diff 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:
Original file line number Diff line number Diff line change 11name : local_notifier
22description : This plugin allows Flutter desktop apps to displaying local notifications.
3- version : 0.1.2
3+ version : 0.1.3
44homepage : https://github.com/leanflutter/local_notifier
55
66platforms :
You can’t perform that action at this time.
0 commit comments