Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"dart.lineLength": 120,
"dart.flutterSdkPath": ".fvm/versions/3.27.1"
}
"dart.lineLength": 120
}
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,19 @@ class _EventSocketsViewState extends State<EventSocketsView> {
Icon(Iconsax.warning_2, color: Colors.amber),
Text(
"Check your socket parameters before connecting to websocket",
style: TextStyle(fontStyle: FontStyle.italic, fontWeight: FontWeight.bold),
style: TextStyle(fontWeight: FontWeight.bold),
),
],
),
Container(
width: size.width * 0.4,
height: size.height * 0.2,
height: size.height * 0.3,
padding: EdgeInsets.symmetric(horizontal: 20),
color: Colors.grey.shade200,
decoration: BoxDecoration(
color: Colors.grey.shade300,
borderRadius: BorderRadius.circular(10),
border: Border.all(color: Colors.grey.shade400),
),
child: JsonEditorTheme(
themeData: JsonEditorThemeData(lightTheme: JsonTheme.light()),
child: JsonEditor.object(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ class WsprotocolRepoImpl {
},
onError: (error) {
// Forward errors to listeners.
_messageController.addError(error);
// _messageController.addError(error);
// Extract error message
final String errorMessage = error is WebSocketChannelException
? 'WebSocket Error: ${error.inner}'
: 'Unknown WebSocket Error: $error';

// Forward a structured error message
_messageController.addError(errorMessage);
},
onDone: () {
// Optionally notify listeners that the connection has closed.
Expand Down