value_broadcast 1.0.4 copy "value_broadcast: ^1.0.4" to clipboard
value_broadcast: ^1.0.4 copied to clipboard

Analog for the Flutter's listenable (valueNotifier) in pure Dart used for console applications without flutter desktop embedding.

example/example.dart

import 'package:value_broadcast/value_broadcast.dart';

void main(){
  final ValueBroadcast<int> valueBroadcast = ValueBroadcast(1)..addListener(switchIndex);
  valueBroadcast.value = 1; //Will not trigger listeners
  valueBroadcast.value = 3;
  valueBroadcast.value = 2;
  valueBroadcast.value = 1;
  valueBroadcast.dispose();
}

void switchIndex(final int index) => print("Switching index to $index");
0
likes
30
pub points
0%
popularity

Publisher

verified publisherdarkandjeweled.com

Analog for the Flutter's listenable (valueNotifier) in pure Dart used for console applications without flutter desktop embedding.

Homepage
Repository (GitHub)
View/report issues

License

MIT (LICENSE)

More

Packages that depend on value_broadcast