final channel = IOWebSocketChannel.connect('ws://192.168.1.110/');
channel.sink.add('{"username":"'+userName+'","password":"'+password+'"}');
channel.stream.listen((message) {
print(message);
if(???){
Navigator.of(context).pushNamed(HomePage.tag);
}
});
用户提交表单,建立websocket连接,返回形式如下:密码错误返回:
密码正确返回:
如何做到密码正确后跳转,以及跳转后如何处理websocket信息呢?