Chat message sending and receiving

This commit is contained in:
2024-11-17 21:30:02 +08:00
parent 285bb42b09
commit 2065350698
9 changed files with 200 additions and 55 deletions

View File

@ -28,15 +28,15 @@ class SnNetworkProvider {
SnNetworkProvider() {
client = Dio();
client.interceptors.add(RetryInterceptor(
dio: client,
retries: 3,
retryDelays: const [
Duration(milliseconds: 300),
Duration(milliseconds: 1000),
Duration(milliseconds: 3000),
],
));
// client.interceptors.add(RetryInterceptor(
// dio: client,
// retries: 3,
// retryDelays: const [
// Duration(milliseconds: 300),
// Duration(milliseconds: 1000),
// Duration(milliseconds: 3000),
// ],
// ));
client.interceptors.add(
InterceptorsWrapper(

View File

@ -52,6 +52,7 @@ class WebSocketProvider extends ChangeNotifier {
try {
conn = WebSocketChannel.connect(uri);
await conn!.ready;
listen();
log('[WebSocket] Connected to server!');
isConnected = true;
} catch (err) {