forceClient.onConnecting.listen((e) {
if (e.type=="connected") {
...
} else if (e.type=="disconnected") {
...
}
});
The forceClient can return a Future that completes when the connection is complete. I'd like to try to avoid checking types against strings if possible. Hard to spellcheck and refactor and statically analyze.
Check the WebSocket class for some inspiration on how to deal with a connection that completes and disconnects.
How about, instead of:
The forceClient can return a Future that completes when the connection is complete. I'd like to try to avoid checking types against strings if possible. Hard to spellcheck and refactor and statically analyze.
Check the WebSocket class for some inspiration on how to deal with a connection that completes and disconnects.