notifier 1.0.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 89

notifier #

Update any widget, from anywhere at anytime.

Getting Started #

Inspired from Broadcast Receiver in Android.

Works for both iOS and Android.

Add the following dependency to your project's pubspec.yaml.
notifier: <latest_version>
There are two methods that make the core of Notifier.
  • notify(action, data) - Sending data for a certain action.
  • register(action, callback) - Listening to data changes for a certain action.
Steps #
  • Add NotifierProvider at root of project's Widget tree.
void main() {
      child: MyApp(),
  • Register a callback for a certain action in your Widget tree.
  Widget build(BuildContext context) {
    return Column(
      children: <Widget>[
        Text('Data from Notifier:'),
        Notifier.of(context).register<String>('action', (data) {
          return Text('${}');
  • From anywhere in your application, call the notify method.
  Widget build(BuildContext context) {
    Notifier _notifier = NotifierProvider.of(context);

    return Scaffold(
      body: Center(
          child: Text('Notify'),
          onPressed: () {
            _notifier.notify('action', 'Sending data from notfier!');

Things to be aware of! #

  • If a callback is registered on an action with a specific data type T, then passing data with data type other than T in notify method will throw error.

[0.0.1] - TODO: Add release date.

  • TODO: Describe initial release.


example #

A new Flutter project.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

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

  notifier: ^1.0.2

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:notifier/notifier.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jan 19, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4
  • Flutter: 1.12.13+hotfix.5

Health suggestions

Fix lib/notifier_provider.dart. (-0.50 points)

Analysis of lib/notifier_provider.dart reported 1 hint:

line 16 col 21: 'inheritFromWidgetOfExactType' is deprecated and shouldn't be used. Use dependOnInheritedWidgetOfExactType instead. This feature was deprecated after v1.12.1..

Maintenance issues and suggestions

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (synchronized).


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
synchronized ^1.5.3+2 1.5.3+2 2.1.1
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies