RoomPowerLevel class

Represents the power level configuration for a room.

This class represents the power level configuration for a room, including the power levels of individual users and events. It is typically used in the context of managing permissions and access control within a Matrix room.

Example usage:

final powerLevel = RoomPowerLevel(
  users: {'user1': 50, 'user2': 100},
  usersDefault: 0,
  events: {'m.room.message': 50, 'm.room.name': 100},
  eventsDefault: 0,
  stateDefault: 50,
  ban: 50,
  kick: 50,
  redact: 50,
  invite: 50,
  historical: 100,
);
Annotations
  • @Freezed(makeCollectionsUnmodifiable: false)

Constructors

RoomPowerLevel({@JsonKey(name: 'users') Map<String, dynamic>? users, @JsonKey(name: 'users_default') int? usersDefault, @JsonKey(name: 'events') Map<String, int?>? events, @JsonKey(name: 'events_default') int? eventsDefault, @JsonKey(name: 'state_default') int? stateDefault, @JsonKey(name: 'ban') int? ban, @JsonKey(name: 'kick') int? kick, @JsonKey(name: 'redact') int? redact, @JsonKey(name: 'invite') int? invite, @JsonKey(name: 'historical') int? historical})
Creates an instance of RoomPowerLevel.
factory
RoomPowerLevel.fromJson(Map<String, dynamic> json)
Creates an instance of RoomPowerLevel from JSON data.
factory
RoomPowerLevel.initial()
Creates an initial instance of RoomPowerLevel.
factory

Properties

ban int?
no setterinherited
copyWith → $RoomPowerLevelCopyWith<RoomPowerLevel>
no setterinherited
events Map<String, int?>?
no setterinherited
eventsDefault int?
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
historical int?
no setterinherited
invite int?
no setterinherited
kick int?
no setterinherited
redact int?
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stateDefault int?
no setterinherited
users Map<String, dynamic>?
no setterinherited
usersDefault int?
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
inherited
toString() String
A string representation of this object.
inherited

Operators

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