Skip to content

Instantly share code, notes, and snippets.

@fabiomsr
Created May 1, 2019 18:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fabiomsr/938cefc167a972f0e03f99194bd40d5d to your computer and use it in GitHub Desktop.
Save fabiomsr/938cefc167a972f0e03f99194bd40d5d to your computer and use it in GitHub Desktop.
class CounterText extends StatelessWidget {
final ValueListenable<int> _counter;
CounterText(this._counter);
@override
Widget build(BuildContext context) {
return ValueListenableBuilder<int>(
valueListenable: _counter,
builder: (context, value, child) {
return new Text(value.toString());
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment