Last updated:
0 purchases
local notifier
local_notifier #
This plugin allows Flutter desktop apps to displaying local notifications.
English | 简体中文
local_notifier
Platform Support
Screenshots
Quick Start
Installation
Linux requirements
Usage
Who's using it?
Related Links
License
Platform Support #
Linux
macOS
Windows
✔️
✔️
✔️
Screenshots #
macOS
Linux
Windows
Quick Start #
Installation #
Add this to your package's pubspec.yaml file:
dependencies:
local_notifier: ^0.1.6
copied to clipboard
Or
dependencies:
local_notifier:
git:
url: https://github.com/leanflutter/local_notifier.git
ref: main
copied to clipboard
Linux requirements
libnotify
Run the following command
sudo apt-get install libnotify-dev
copied to clipboard
Usage #
// Add in main method.
await localNotifier.setup(
appName: 'local_notifier_example',
// The parameter shortcutPolicy only works on Windows
shortcutPolicy: ShortcutPolicy.requireCreate,
);
LocalNotification notification = LocalNotification(
title: "local_notifier_example",
body: "hello flutter!",
);
notification.onShow = () {
print('onShow ${notification.identifier}');
};
notification.onClose = (closeReason) {
// Only supported on windows, other platforms closeReason is always unknown.
switch (closeReason) {
case LocalNotificationCloseReason.userCanceled:
// do something
break;
case LocalNotificationCloseReason.timedOut:
// do something
break;
default:
}
print('onClose ${_exampleNotification?.identifier} - $closeReason');
};
notification.onClick = () {
print('onClick ${notification.identifier}');
};
notification?.onClickAction = (actionIndex) {
print('onClickAction ${notification?.identifier} - $actionIndex');
};
notification.show();
copied to clipboard
Please see the example app of this plugin for a full example.
Who's using it? #
Biyi (比译) - A convenient translation and dictionary app.
Related Links #
https://github.com/mohabouje/WinToast
License #
MIT
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.