Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// mobile/lib/livestream_channel.dart:20
@override
void initState() {
super.initState();
_setupChannel();
}
Future _setupChannel() async {
cancelChannel = await ApiService().listenToChannel(widget.channelId, (messages) {
setState(() {
var prevMessages = [];
if (_messages != null) {
prevMessages = _messages;
}
_messages = prevMessages + messages;
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.