Skip to content

Instantly share code, notes, and snippets.

@jacobaraujo7
Created May 12, 2019 20:30
Show Gist options
  • Save jacobaraujo7/2d1f31c5425855037fb8986702f69fa6 to your computer and use it in GitHub Desktop.
Save jacobaraujo7/2d1f31c5425855037fb8986702f69fa6 to your computer and use it in GitHub Desktop.
class ValueBloc extends BlocBase {
StreamController<double> _valueController = StreamController<double>();
double value = 0.0;
onChangeValue(double v) {
value = v;
_valueController.add(value);
}
//será chamado no fim da aplicação automaticamente
@override
void dispose() {
_valueController.close();
super.dispose();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment