Dart - websocket()
This is reference documentation for the Nitric Dart SDK. To learn about Websockets in Nitric start with the Websockets docs.
Creates a new Websocket.
import 'package:nitric_sdk/nitric.dart';final socket = Nitric.websocket("socket");
Parameters
- Name
name
- Required
- Required
- Type
- String
- Description
The unique name of this Websocket within the app. Subsequent calls to
websocket()
with the same name will return the same object.
Examples
Create a Websocket
import 'package:nitric_sdk/nitric.dart';final socket = Nitric.websocket("socket");
Last updated on May 20, 2025