GithubHelp home page GithubHelp logo

bluebubblesapp / local_notifier Goto Github PK

View Code? Open in Web Editor NEW

This project forked from leanflutter/local_notifier

0.0 0.0 1.0 242 KB

This plugin allows Flutter desktop apps to notify local notifications.

License: MIT License

Ruby 1.41% C++ 69.83% C 1.78% Dart 11.37% Swift 3.31% CMake 12.31%

local_notifier's Introduction

local_notifier

pub version

This plugin allows Flutter desktop apps to displaying local notifications.


English | 简体中文


Platform Support

Linux macOS Windows
✔️ ✔️ ✔️

Screenshots

macOS Linux Windows
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

License

MIT

local_notifier's People

Contributors

carapacik avatar jjoelj avatar lijy91 avatar

Forkers

buat-besok

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.