Skip to content

Instantly share code, notes, and snippets.

@jacobaraujo7
Last active May 12, 2019 22:50
Show Gist options
  • Save jacobaraujo7/c8b3076cb177e27cd869b1c1ddb042a6 to your computer and use it in GitHub Desktop.
Save jacobaraujo7/c8b3076cb177e27cd869b1c1ddb042a6 to your computer and use it in GitHub Desktop.
ValueBloc valueBloc = BlocProvider.getBloc<ValueBloc>();
...
StreamBuilder<String>(
stream: valueBloc.valueStringOut,
initialData: "",
builder: (context, snapshot) {
return Text(snapshot.data,
style: TextStyle(
color: Colors.white,
fontSize: 24,
fontWeight: FontWeight.bold,
),
);
},
),
...
StreamBuilder<double>(
stream: valueBloc.valueOut,
initialData: 0
builder: (context, snapshot) {
return Slider(
activeColor: Colors.white,
inactiveColor: Colors.white,
min: 0.0,
max: 1.0,
onChanged: valueBloc.onChangeValue,
value: snapshot.data);
},
),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment