Skip to content

Instantly share code, notes, and snippets.

@nparsons08 nparsons08/chat.dart Secret

Created Mar 2, 2020
Embed
What would you like to do?
// mobile/lib/chat.dart:20
@override
void initState() {
_setupChannel();
super.initState();
}
// mobile/lib/chat.dart:32
Future _setupChannel() async {
cancelChannel = await ApiService().listenToChannel(widget.account, widget.user, (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.