muteable_notifiers 1.0.7 copy "muteable_notifiers: ^1.0.7" to clipboard
muteable_notifiers: ^1.0.7 copied to clipboard

Implementations of ChangeNotifier and ValueNotifier that can be muted for single/multiple calls.

example/example.dart

import 'package:muteable_notifiers/muteable_notifiers.dart';

/// Extend MuteableChangeNotifier, then use `addListener` as per [ChangeNotifier].
class MyChangeNotifier extends MuteableChangeNotifier {
  String _field;
  String get field => _field;

  MyChangeNotifier(String initialValue) : _field = initialValue;

  void setField(String newValue) {
    if (newValue == _field) {
      return;
    }
    _field = newValue;
    notifyListeners();
  }
}

/// Extend MuteableValueNotifier, then use `addListener` as per [ValueNotifier].
class MyStringValueNotifier extends MuteableValueNotifier<String> {
  MyStringValueNotifier(String value) : super(value);
}
1
likes
140
pub points
30%
popularity

Publisher

unverified uploader

Implementations of ChangeNotifier and ValueNotifier that can be muted for single/multiple calls.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on muteable_notifiers