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
}
or
OpenChannel.getChannel('1234').then((channel) {
//do seomthing with channel
}).catchError((e) {
//handle error
})
- Inheritance
-
- Object
- BaseChannel
- OpenChannel
- Available Extensions
- Annotations
Constructors
-
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) -
factory
-
OpenChannel.fromJsonAndCached(Map<
String, dynamic> json, {int? ts}) -
factory
Properties
- channelType → ChannelType
-
Channel type for this channel
read-onlyinherited
- 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.
read-onlyoverride
- isEphemeral ↔ bool
-
True if this channel is ephemeral
read / writeinherited
- isFrozen ↔ bool
-
Ture if this channel is frozen
read / writeinherited
- key → String
-
read-onlyinherited
- 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
-
read-onlyinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
read-onlyinherited
Methods
-
copyWith(
dynamic others) → void -
override
-
deleteChannel(
) → Future< void> - Deletes this channel
-
isOperator(
String userId) → bool -
Returns
true
if a given user withuserId
is operator -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
inherited
-
updateChannel(
OpenChannelParams params, {OnUploadProgressCallback? progress}) → Future< OpenChannel> -
Updates an
OpenChannel
with givenparams
and optionalprogress
.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Methods
-
createChannel(
OpenChannelParams params, {OnUploadProgressCallback? progress}) → Future< OpenChannel> -
Creates an
OpenChannel
with givenparams
and optionalprogress
. -
getChannel(
String channelUrl) → Future< OpenChannel> -
Gets an
OpenChannel
with givenchannelUrl
. -
refresh(
String channelUrl) → Future< OpenChannel> -
Refreshes an
OpenChannel
with givenchannelUrl