copyWith method

ChatUser copyWith({
  1. String? id,
  2. String? name,
  3. String? firstName,
  4. String? avatar,
  5. Map<String, dynamic>? customProperties,
  6. String? role,
})

Creates a copy of this user with the given fields replaced with new values

Implementation

ChatUser copyWith({
  String? id,
  String? name,
  String? firstName,
  String? avatar,
  Map<String, dynamic>? customProperties,
  String? role,
}) =>
    ChatUser(
      id: id ?? this.id,
      name: name ?? firstName ?? this.name,
      avatar: avatar ?? this.avatar,
      customProperties: customProperties ?? this.customProperties,
      role: role ?? this.role,
    );