listen 1.0.0-beta.1 copy "listen: ^1.0.0-beta.1" to clipboard
listen: ^1.0.0-beta.1 copied to clipboard

unlisted

A package to notify state changes to interested listeners in pure Dart.

example/lib/main.dart

// Copyright 2013 The Flutter Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

// ignore_for_file: avoid_print

import 'package:listen/listen.dart';

void main() {
  final counter = ValueNotifier<int>(0);

  counter.addListener(() {
    print('Counter changed to: ${counter.value}');
  });

  counter.value = 1; // Prints: Counter changed to: 1
  counter.value = 2; // Prints: Counter changed to: 2

  counter.dispose();
}
4
likes
0
points
468
downloads

Publisher

verified publisherflutter.dev

Weekly Downloads

A package to notify state changes to interested listeners in pure Dart.

Repository (GitHub)
View/report issues

Topics

#state-management #listenable

License

unknown (license)

Dependencies

meta

More

Packages that depend on listen