All Projects → netyouli → Flutter-NotificationCenter

netyouli / Flutter-NotificationCenter

Licence: MIT license
A lightweight, easy-to-use notification component library that corresponds to Dart supports post notification listening for notifications and notification removal

Programming Languages

dart
5743 projects

Flutter-NotificationCenter

Pub support License MIT

A lightweight, easy-to-use notification component library that corresponds to Dart supports post notification listening for notifications and notification removal

Content

Installation

dependencies:
  notification_center: x.x.x  #latest version

Getting started

Add notification_center.dart to your js file.

import 'package:notification_center/notification_center.dart'

Add observer notification:

 NotificationCenter.addObserver(this, 'NotificationName', (param) {
    ....
 });

Post notification:

NotificationCenter.post('NotificationName', 'param value');

Remove specified observer notification:

NotificationCenter.removeObserver(this);

Remove all observer notification:

NotificationCenter.removeObserver(this, 'NotificationName');

API

Method Type Optional Description
post(string, any) function true post notification
addObserver(object, string, function) function true observer notification
removeObserver(object, string) function true remove observer notification

Contribution

Issues are welcome. Please add a screenshot of bug and code snippet. Quickest way to solve issue is to reproduce it on one of the examples.

Pull requests are welcome. If you want to change API or making something big better to create issue and discuss it first.


MIT Licensed

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].