Skip to content

Commit

Permalink
[windows] Implemented notify Method.
Browse files Browse the repository at this point in the history
  • Loading branch information
lijy91 committed Jan 9, 2022
1 parent f6e6c0c commit 73d15ae
Show file tree
Hide file tree
Showing 16 changed files with 1,553 additions and 100 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
## 0.0.1
## 0.1.0

- first release.
- First release.
15 changes: 10 additions & 5 deletions README-ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
- [谁在用使用它?](#谁在用使用它)
- [API](#api)
- [LocalNotifier](#localnotifier)
- [相关链接](#相关链接)
- [许可证](#许可证)

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

| Linux | macOS | Windows |
| :---: | :---: | :-----: |
| ✔️ | ✔️ | |
| ✔️ | ✔️ | ✔️ |

## 快速开始

Expand All @@ -46,7 +47,7 @@

```yaml
dependencies:
local_notifier: ^0.0.1
local_notifier: ^0.1.0
```
Expand Down Expand Up @@ -90,9 +91,13 @@ await localNotifier.notify(notification);

### LocalNotifier

| Method | Description | Linux | macOS | Windows |
| -------- | ----------- | ----- | ----- | ------- |
| `notify` | - | ✔️ | ✔️ ||
| Method | Description | Linux | macOS | Windows |
| -------- | -------------------- | ----- | ----- | ------- |
| `notify` | 立即向用户显示通知。 | ✔️ | ✔️ | ✔️ |

## 相关链接

- https:/mohabouje/WinToast

## 许可证

Expand Down
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ English | [简体中文](./README-ZH.md)
- [Who's using it?](#whos-using-it)
- [API](#api)
- [LocalNotifier](#localnotifier)
- [Related Links](#related-links)
- [License](#license)

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

| Linux | macOS | Windows |
| :---: | :---: | :-----: |
| ✔️ | ✔️ | |
| ✔️ | ✔️ | ✔️ |

## Quick Start

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

```yaml
dependencies:
local_notifier: ^0.0.1
local_notifier: ^0.1.0
```
Or
Expand Down Expand Up @@ -90,9 +91,13 @@ await localNotifier.notify(notification);

### LocalNotifier

| Method | Description | Linux | macOS | Windows |
| -------- | ----------- | ----- | ----- | ------- |
| `notify` | - | ✔️ | ✔️ ||
| Method | Description | Linux | macOS | Windows |
| -------- | ----------------------------------------------- | ----- | ----- | ------- |
| `notify` | Immediately shows the notification to the user. | ✔️ | ✔️ | ✔️ |

## Related Links

- https:/mohabouje/WinToast

## License

Expand Down
4 changes: 1 addition & 3 deletions example/lib/pages/home.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'package:bot_toast/bot_toast.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:preference_list/preference_list.dart';
import 'package:local_notifier/local_notifier.dart';
Expand All @@ -16,7 +14,7 @@ class _HomePageState extends State<HomePage> {
LocalNotification notification = LocalNotification(
identifier: 'identifier',
title: "local_notifier_example",
subtitle: "local_notifier_example",
subtitle: "example",
body: "hello flutter!",
);
await localNotifier.notify(notification);
Expand Down
14 changes: 7 additions & 7 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.8.1"
version: "2.8.2"
boolean_selector:
dependency: transitive
description:
Expand All @@ -28,7 +28,7 @@ packages:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.2.0"
charcode:
dependency: transitive
description:
Expand Down Expand Up @@ -87,14 +87,14 @@ packages:
path: ".."
relative: true
source: path
version: "0.0.1"
version: "0.1.0"
matcher:
dependency: transitive
description:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.10"
version: "0.12.11"
meta:
dependency: transitive
description:
Expand Down Expand Up @@ -162,7 +162,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.4.2"
version: "0.4.3"
typed_data:
dependency: transitive
description:
Expand All @@ -183,7 +183,7 @@ packages:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
version: "2.1.1"
sdks:
dart: ">=2.12.0 <3.0.0"
dart: ">=2.14.0 <3.0.0"
flutter: ">=1.20.0"
2 changes: 2 additions & 0 deletions example/windows/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Generated file. Do not edit.
//

// clang-format off

#include "generated_plugin_registrant.h"

#include <local_notifier/local_notifier_plugin.h>
Expand Down
2 changes: 2 additions & 0 deletions example/windows/flutter/generated_plugin_registrant.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
// Generated file. Do not edit.
//

// clang-format off

#ifndef GENERATED_PLUGIN_REGISTRANT_
#define GENERATED_PLUGIN_REGISTRANT_

Expand Down
37 changes: 0 additions & 37 deletions lib/src/display.dart

This file was deleted.

8 changes: 4 additions & 4 deletions lib/src/local_notification.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class LocalNotification {
String identifier = Uuid().v4();

/// Representing the title of the notification.
String? title;
String title;

/// Representing the subtitle of the notification.
String? subtitle;
Expand All @@ -17,7 +17,7 @@ class LocalNotification {

LocalNotification({
String? identifier,
this.title,
required this.title,
this.subtitle,
this.body,
this.silent = false,
Expand All @@ -41,8 +41,8 @@ class LocalNotification {
return {
'identifier': identifier,
'title': title,
'subtitle': subtitle,
'body': body,
'subtitle': subtitle ?? '',
'body': body ?? '',
'silent': silent,
}..removeWhere((key, value) => value == null);
}
Expand Down
2 changes: 1 addition & 1 deletion macos/local_notifier.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
Pod::Spec.new do |s|
s.name = 'local_notifier'
s.version = '0.0.1'
s.version = '0.1.0'
s.summary = 'A new flutter plugin project.'
s.description = <<-DESC
A new flutter plugin project.
Expand Down
16 changes: 8 additions & 8 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ packages:
name: async
url: "https://pub.dartlang.org"
source: hosted
version: "2.6.1"
version: "2.8.2"
boolean_selector:
dependency: transitive
description:
Expand All @@ -21,14 +21,14 @@ packages:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.2.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
version: "1.3.1"
clock:
dependency: transitive
description:
Expand Down Expand Up @@ -73,14 +73,14 @@ packages:
name: matcher
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.10"
version: "0.12.11"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.dartlang.org"
source: hosted
version: "1.3.0"
version: "1.7.0"
path:
dependency: transitive
description:
Expand Down Expand Up @@ -134,7 +134,7 @@ packages:
name: test_api
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.0"
version: "0.4.3"
typed_data:
dependency: transitive
description:
Expand All @@ -155,7 +155,7 @@ packages:
name: vector_math
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.0"
version: "2.1.1"
sdks:
dart: ">=2.12.0 <3.0.0"
dart: ">=2.14.0 <3.0.0"
flutter: ">=1.20.0"
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: local_notifier
description: This plugin allows Flutter desktop apps to notify local notifications.
version: 0.0.1
version: 0.1.0
homepage: https:/leanflutter/local_notifier

environment:
Expand Down
2 changes: 2 additions & 0 deletions windows/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ project(${PROJECT_NAME} LANGUAGES CXX)
set(PLUGIN_NAME "local_notifier_plugin")

add_library(${PLUGIN_NAME} SHARED
"wintoastlib.h"
"wintoastlib.cpp"
"local_notifier_plugin.cpp"
)
apply_standard_settings(${PLUGIN_NAME})
Expand Down
Loading

0 comments on commit 73d15ae

Please sign in to comment.