FLUTTER ECOSYSTEM

leanflutter/local_notifier

此外掛程式允許Flutter桌面應用程式通知本機通知。

local_notifier 專案封面
Stars
84
Forks
39
最近推送(UTC)
2026年9月19日
專案狀態
未封存
LeanFlutter GitHub avatar
GITHUB Organization

LeanFlutter ↗

To make the flutter even simpler

語言C++CMakeDartSwiftCRuby

技術主題

此儲存庫發佈的套件

使用的依賴

依賴清單 4 項
  • flutter{"sdk":"flutter"}
  • uuid>=3.0.7 <5.0.0
  • flutter_test開發依賴{"sdk":"flutter"}
  • mostly_reasonable_lints開發依賴^0.1.1

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

展開 / 收合專案 README

🚀 Ship Your App Faster: Try Fastforge - The simplest way to build, package and distribute your Flutter apps.

local_notifier

pub version https://img.shields.io/discord/884679008049037342.svg https://img.shields.io/badge/dynamic/json?label=Visits%20Count&query=value&url=https://api.countapi.xyz/hit/leanflutter.local_notifier/visits

This plugin allows Flutter desktop apps to displaying local notifications.


English | 简体中文


Platform Support

Linux macOS Windows
✔️ ✔️ ✔️

Screenshots

macOS Linux Windows
https://github.com/leanflutter/local_notifier/blob/main/screenshots/macos.png?raw=true https://github.com/leanflutter/local_notifier/blob/main/screenshots/linux.png?raw=true image

Quick Start

Installation

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

dependencies:
  local_notifier: ^0.1.6

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

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

Who's using it?

Related Links

  • https://github.com/mohabouje/WinToast

License

MIT