local_notifier 0.1.3 copy "local_notifier: ^0.1.3" to clipboard
local_notifier: ^0.1.3 copied to clipboard

outdated

This plugin allows Flutter desktop apps to displaying local notifications.

local_notifier #

pub version

This plugin allows Flutter desktop apps to displaying local notifications.


English | 简体中文


Platform Support #

Linux macOS Windows
✔️ ✔️ ✔️

Quick Start #

Installation #

Add this to your package's pubspec.yaml file:

dependencies:
  local_notifier: ^0.1.3

Or

dependencies:
  local_notifier:
    git:
      url: https://github.com/leanflutter/local_notifier.git
      ref: main

Linux requirements

  • libnotify

Run the following command

sudo apt-get install libnotify-dev

Usage #

// Add this line in main method.
localNotifier.setAppName('example');

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();

Please see the example app of this plugin for a full example.

Who's using it? #

License #

MIT

96
likes
0
pub points
96%
popularity

Publisher

verified publisherleanflutter.dev

This plugin allows Flutter desktop apps to displaying local notifications.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, uuid

More

Packages that depend on local_notifier