|
| 1 | +# local_notifier |
| 2 | + |
| 3 | +[![pub version][pub-image]][pub-url] [![][discord-image]][discord-url] |
| 4 | + |
| 5 | +[pub-image]: https://img.shields.io/pub/v/local_notifier.svg |
| 6 | +[pub-url]: https://pub.dev/packages/local_notifier |
| 7 | + |
| 8 | +[discord-image]: https://img.shields.io/discord/884679008049037342.svg |
| 9 | +[discord-url]: https://discord.gg/zPa6EZ2jqb |
| 10 | + |
| 11 | +这个插件允许 Flutter **桌面** 应用显示本地通知。 |
| 12 | + |
| 13 | +--- |
| 14 | + |
| 15 | +[English](./README.md) | 简体中文 |
| 16 | + |
| 17 | +--- |
| 18 | + |
| 19 | +<!-- START doctoc generated TOC please keep comment here to allow auto update --> |
| 20 | +<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> |
| 21 | + |
| 22 | +- [local_notifier](#local_notifier) |
| 23 | + - [平台支持](#平台支持) |
| 24 | + - [快速开始](#快速开始) |
| 25 | + - [安装](#安装) |
| 26 | + - [⚠️ Linux requirements](#️-linux-requirements) |
| 27 | + - [用法](#用法) |
| 28 | + - [谁在用使用它?](#谁在用使用它) |
| 29 | + - [API](#api) |
| 30 | + - [LocalNotifier](#localnotifier) |
| 31 | + - [许可证](#许可证) |
| 32 | + |
| 33 | +<!-- END doctoc generated TOC please keep comment here to allow auto update --> |
| 34 | + |
| 35 | +## 平台支持 |
| 36 | + |
| 37 | +| Linux | macOS | Windows | |
| 38 | +| :---: | :---: | :-----: | |
| 39 | +| ✔️ | ✔️ | ➖ | |
| 40 | + |
| 41 | +## 快速开始 |
| 42 | + |
| 43 | +### 安装 |
| 44 | + |
| 45 | +将此添加到你的软件包的 pubspec.yaml 文件: |
| 46 | + |
| 47 | +```yaml |
| 48 | +dependencies: |
| 49 | + local_notifier: ^0.0.1 |
| 50 | +``` |
| 51 | +
|
| 52 | +或 |
| 53 | +
|
| 54 | +```yaml |
| 55 | +dependencies: |
| 56 | + local_notifier: |
| 57 | + git: |
| 58 | + url: https://github.com/leanflutter/local_notifier.git |
| 59 | + ref: main |
| 60 | +``` |
| 61 | +
|
| 62 | +#### ⚠️ Linux requirements |
| 63 | +
|
| 64 | +- `libnotify` |
| 65 | + |
| 66 | +运行以下命令 |
| 67 | + |
| 68 | +``` |
| 69 | +sudo apt-get install libnotify-dev |
| 70 | +``` |
| 71 | +
|
| 72 | +### 用法 |
| 73 | +
|
| 74 | +```dart |
| 75 | +LocalNotification notification = LocalNotification( |
| 76 | + title: "local_notifier_example", |
| 77 | + subtitle: "subtitle", |
| 78 | + body: "hello flutter!", |
| 79 | +); |
| 80 | +await localNotifier.notify(notification); |
| 81 | +``` |
| 82 | + |
| 83 | +> 请看这个插件的示例应用,以了解完整的例子。 |
| 84 | +
|
| 85 | +## 谁在用使用它? |
| 86 | + |
| 87 | +- [Biyi (比译)](https://biyidev.com/) - 一个便捷的翻译和词典应用。 |
| 88 | + |
| 89 | +## API |
| 90 | + |
| 91 | +### LocalNotifier |
| 92 | + |
| 93 | +| Method | Description | Linux | macOS | Windows | |
| 94 | +| -------- | ----------- | ----- | ----- | ------- | |
| 95 | +| `notify` | - | ✔️ | ✔️ | ➖ | |
| 96 | + |
| 97 | +## 许可证 |
| 98 | + |
| 99 | +[MIT](./LICENSE) |
0 commit comments