Skip to content

Commit 73d15ae

Browse files
committed
[windows] Implemented notify Method.
1 parent f6e6c0c commit 73d15ae

16 files changed

+1553
-100
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
## 0.0.1
1+
## 0.1.0
22

3-
- first release.
3+
- First release.

README-ZH.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
- [谁在用使用它?](#谁在用使用它)
2929
- [API](#api)
3030
- [LocalNotifier](#localnotifier)
31+
- [相关链接](#相关链接)
3132
- [许可证](#许可证)
3233

3334
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
@@ -36,7 +37,7 @@
3637

3738
| Linux | macOS | Windows |
3839
| :---: | :---: | :-----: |
39-
| ✔️ | ✔️ | |
40+
| ✔️ | ✔️ | ✔️ |
4041

4142
## 快速开始
4243

@@ -46,7 +47,7 @@
4647

4748
```yaml
4849
dependencies:
49-
local_notifier: ^0.0.1
50+
local_notifier: ^0.1.0
5051
```
5152
5253
@@ -90,9 +91,13 @@ await localNotifier.notify(notification);
9091

9192
### LocalNotifier
9293

93-
| Method | Description | Linux | macOS | Windows |
94-
| -------- | ----------- | ----- | ----- | ------- |
95-
| `notify` | - | ✔️ | ✔️ ||
94+
| Method | Description | Linux | macOS | Windows |
95+
| -------- | -------------------- | ----- | ----- | ------- |
96+
| `notify` | 立即向用户显示通知。 | ✔️ | ✔️ | ✔️ |
97+
98+
## 相关链接
99+
100+
- https://github.com/mohabouje/WinToast
96101

97102
## 许可证
98103

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ English | [简体中文](./README-ZH.md)
2828
- [Who's using it?](#whos-using-it)
2929
- [API](#api)
3030
- [LocalNotifier](#localnotifier)
31+
- [Related Links](#related-links)
3132
- [License](#license)
3233

3334
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
@@ -36,7 +37,7 @@ English | [简体中文](./README-ZH.md)
3637

3738
| Linux | macOS | Windows |
3839
| :---: | :---: | :-----: |
39-
| ✔️ | ✔️ | |
40+
| ✔️ | ✔️ | ✔️ |
4041

4142
## Quick Start
4243

@@ -46,7 +47,7 @@ Add this to your package's pubspec.yaml file:
4647

4748
```yaml
4849
dependencies:
49-
local_notifier: ^0.0.1
50+
local_notifier: ^0.1.0
5051
```
5152
5253
Or
@@ -90,9 +91,13 @@ await localNotifier.notify(notification);
9091

9192
### LocalNotifier
9293

93-
| Method | Description | Linux | macOS | Windows |
94-
| -------- | ----------- | ----- | ----- | ------- |
95-
| `notify` | - | ✔️ | ✔️ ||
94+
| Method | Description | Linux | macOS | Windows |
95+
| -------- | ----------------------------------------------- | ----- | ----- | ------- |
96+
| `notify` | Immediately shows the notification to the user. | ✔️ | ✔️ | ✔️ |
97+
98+
## Related Links
99+
100+
- https://github.com/mohabouje/WinToast
96101

97102
## License
98103

example/lib/pages/home.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import 'package:bot_toast/bot_toast.dart';
2-
import 'package:flutter/cupertino.dart';
31
import 'package:flutter/material.dart';
42
import 'package:preference_list/preference_list.dart';
53
import 'package:local_notifier/local_notifier.dart';
@@ -16,7 +14,7 @@ class _HomePageState extends State<HomePage> {
1614
LocalNotification notification = LocalNotification(
1715
identifier: 'identifier',
1816
title: "local_notifier_example",
19-
subtitle: "local_notifier_example",
17+
subtitle: "example",
2018
body: "hello flutter!",
2119
);
2220
await localNotifier.notify(notification);

example/pubspec.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ packages:
77
name: async
88
url: "https://pub.dartlang.org"
99
source: hosted
10-
version: "2.8.1"
10+
version: "2.8.2"
1111
boolean_selector:
1212
dependency: transitive
1313
description:
@@ -28,7 +28,7 @@ packages:
2828
name: characters
2929
url: "https://pub.dartlang.org"
3030
source: hosted
31-
version: "1.1.0"
31+
version: "1.2.0"
3232
charcode:
3333
dependency: transitive
3434
description:
@@ -87,14 +87,14 @@ packages:
8787
path: ".."
8888
relative: true
8989
source: path
90-
version: "0.0.1"
90+
version: "0.1.0"
9191
matcher:
9292
dependency: transitive
9393
description:
9494
name: matcher
9595
url: "https://pub.dartlang.org"
9696
source: hosted
97-
version: "0.12.10"
97+
version: "0.12.11"
9898
meta:
9999
dependency: transitive
100100
description:
@@ -162,7 +162,7 @@ packages:
162162
name: test_api
163163
url: "https://pub.dartlang.org"
164164
source: hosted
165-
version: "0.4.2"
165+
version: "0.4.3"
166166
typed_data:
167167
dependency: transitive
168168
description:
@@ -183,7 +183,7 @@ packages:
183183
name: vector_math
184184
url: "https://pub.dartlang.org"
185185
source: hosted
186-
version: "2.1.0"
186+
version: "2.1.1"
187187
sdks:
188-
dart: ">=2.12.0 <3.0.0"
188+
dart: ">=2.14.0 <3.0.0"
189189
flutter: ">=1.20.0"

example/windows/flutter/generated_plugin_registrant.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Generated file. Do not edit.
33
//
44

5+
// clang-format off
6+
57
#include "generated_plugin_registrant.h"
68

79
#include <local_notifier/local_notifier_plugin.h>

example/windows/flutter/generated_plugin_registrant.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
// Generated file. Do not edit.
33
//
44

5+
// clang-format off
6+
57
#ifndef GENERATED_PLUGIN_REGISTRANT_
68
#define GENERATED_PLUGIN_REGISTRANT_
79

lib/src/display.dart

Lines changed: 0 additions & 37 deletions
This file was deleted.

lib/src/local_notification.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ class LocalNotification {
44
String identifier = Uuid().v4();
55

66
/// Representing the title of the notification.
7-
String? title;
7+
String title;
88

99
/// Representing the subtitle of the notification.
1010
String? subtitle;
@@ -17,7 +17,7 @@ class LocalNotification {
1717

1818
LocalNotification({
1919
String? identifier,
20-
this.title,
20+
required this.title,
2121
this.subtitle,
2222
this.body,
2323
this.silent = false,
@@ -41,8 +41,8 @@ class LocalNotification {
4141
return {
4242
'identifier': identifier,
4343
'title': title,
44-
'subtitle': subtitle,
45-
'body': body,
44+
'subtitle': subtitle ?? '',
45+
'body': body ?? '',
4646
'silent': silent,
4747
}..removeWhere((key, value) => value == null);
4848
}

macos/local_notifier.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
Pod::Spec.new do |s|
66
s.name = 'local_notifier'
7-
s.version = '0.0.1'
7+
s.version = '0.1.0'
88
s.summary = 'A new flutter plugin project.'
99
s.description = <<-DESC
1010
A new flutter plugin project.

0 commit comments

Comments
 (0)