v0.1.1
ntfluttery
適用於 Flutter/Dart 的 ntfy.sh API 客戶端,用於取得、建立、更新和刪除通知。
2喜歡 26近 30 天下載150Pub 分數
AndroidiOSmacOSWindowsLinux
一個 Dart 庫,用於幫助從 ntfy.sh 集成自定義通知
^5.4.0^2.0.5^1.3.1^0.6.1^2.1.0^5.4.4^1.24.0以下為英文專案原文快照,最新內容請造訪 GitHub。
This plugin is focused on help with the integration of ntfy.sh it has multiple ways to access the list of messages such as a Streaming of data or even using custom credentials.
Also it provides various ways to handle the messages list.
To use this plugin, add ntfluttery as a dependency in your pubspec.yaml file.
dependencies:
ntfluttery: ^latest_version
import 'package:ntfluttery/ntfluttery.dart';
void main() {
// initialize the client
final client = NtflutteryService(
credentials:
Credentials(username: 'ntfyUser', password: 'ntfyPassword'));
// Inject a logger into each request.
client.addLogging(true);
// Fetch from the NTFY API as a STREAM
final result = await cliente
.get('https:/notification/$topic/json?poll=1');
// Received the data as a touple ready to be used.
result.$1.listen((event) {
print(event.$1);
print(event.$2);
});
}
import 'package:ntfluttery/ntfluttery.dart';
void main() {
// initialize the client
final client = NtflutteryService(
credentials:
Credentials(username: 'ntfyUser', password: 'ntfyPassword'));
// Or fetch the messages and instead of use a Streaming just use it as a simple Future value.
final latest = await cliente.getLatestMessage(
'https://notification/$topic/json?poll=1');
print('latest: $latest');
}
Contributions are welcome!
This project is licensed under the MIT License.
Thanks to Philipp C. Heckel for create this great tool.
If you have any questions or issues, please file them on issue tracker.
For further inquiries, contact me at luisalfonsocb83@gmail.com.