OpenChannel class Null safety

Represents open channel

In most case, any static or instance method will throw a SBError if anything goes wrong such as parameter is not provided or connection has not been maded. Use method with try/catch block or then/catchError callback

try {
   final channel = OpenChannel.getChannel('1234');
   //do something with channel
} catch (e) {
   //handle error


OpenChannel.getChannel('1234').then((channel) {
  //do seomthing with channel
}).catchError((e) {
  //handle error
Available Extensions


OpenChannel({required int participantCount, required List<User> operators, required String channelUrl, String? name, String? coverUrl, User? creator, int? createdAt, String? data, String? customType, bool isFrozen = false, bool isEphemeral = false})
WARNING: Do not use default constructor to initialize manually
OpenChannel.fromJson(Map<String, dynamic> json)
OpenChannel.fromJsonAndCached(Map<String, dynamic> json, {int? ts})


channelType ChannelType
Channel type for this channel
channelUrl String
This channel url
read / writeinherited
coverUrl String?
cover image URL for this channel
read / writeinherited
createdAt int?
timestamp when this channel is created
read / writeinherited
creator User?
User who creates this channel
read / writeinherited
customType String?
custom type for this channel
read / writeinherited
data String?
custom data for this channel
read / writeinherited
dirty bool
read / writeinherited
entered bool
read / write
fromCache bool
local usage
read / writeinherited
hashCode int
The hash code for this object.
isEphemeral bool
True if this channel is ephemeral
read / writeinherited
isFrozen bool
Ture if this channel is frozen
read / writeinherited
key String
name String?
name for this channel
read / writeinherited
operators List<User>
Operators of this channel
read / write
participantCount int
Number of participants in this channel
read / write
primaryKey String
runtimeType Type
A representation of the runtime type of the object.


copyWith(dynamic others) → void
deleteChannel() Future<void>
Deletes this channel
isOperator(String userId) bool
Returns true if a given user with userId is operator
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
toJson() Map<String, dynamic>
toString() String
A string representation of this object.
updateChannel(OpenChannelParams params, {OnUploadProgressCallback? progress}) Future<OpenChannel>
Updates an OpenChannel with given params and optional progress.


operator ==(Object other) bool
The equality operator.

Static Methods

createChannel(OpenChannelParams params, {OnUploadProgressCallback? progress}) Future<OpenChannel>
Creates an OpenChannel with given params and optional progress.
getChannel(String channelUrl) Future<OpenChannel>
Gets an OpenChannel with given channelUrl.
refresh(String channelUrl) Future<OpenChannel>
Refreshes an OpenChannel with given channelUrl