callvaluenotifier 0.0.1 copy "callvaluenotifier: ^0.0.1" to clipboard
callvaluenotifier: ^0.0.1 copied to clipboard

ValueNotifier that updates from a given callable.

callvaluenotifier #

A Flutter package to provide a ValueNotifier that knows how to refresh its value.

Example #

Future<String> getMyValue() {
  return Future.delayed(
      Duration(seconds: 2), () => 'I am the future result value');
}

final myValue = CallValueNotifier<String>('I am the default value', getMyValue);

then later

ValueListenableBuilder<String>(
    valueListenable: myValue,
    builder: (BuildContext context, String value, Widget child) {
      return Text(
        '$value',
        style: Theme.of(context).textTheme.headline4,
      );
    }),

Complete example in the example directory

1
likes
30
pub points
0%
popularity

Publisher

unverified uploader

ValueNotifier that updates from a given callable.

Repository (GitLab)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on callvaluenotifier