onAppResumed method
App 回前台时刷新连通性并在需要时触发重连
Implementation
Future<void> onAppResumed() async {
final type = await connectivity.refresh();
ws.networkAvailable = type.isOnline;
if (type.isOnline && !ws.isConnected && !ws.isConnecting) {
ws.onNetworkRestored();
}
syncImStatus();
}