toModel method

ChatMembersDialed toModel()

Constructs a new ChatMembersDialed from this ChatCallMixin$Dialed.

Implementation

ChatMembersDialed toModel() {
  if ($$typename == 'ChatMembersDialedAll') {
    final model = this as ChatCallMixin$Dialed$ChatMembersDialedAll;
    return ChatMembersDialedAll(
      model.answeredMembers
          .map((e) => ChatMember(e.user.toModel(), e.joinedAt))
          .toList(),
    );
  } else if ($$typename == 'ChatMembersDialedConcrete') {
    final model = this as ChatCallMixin$Dialed$ChatMembersDialedConcrete;
    return ChatMembersDialedConcrete(
      model.members
          .map((e) => ChatMember(e.user.toModel(), e.joinedAt))
          .toList(),
    );
  }

  throw Exception('Unknown ChatMembersDialed: ${$$typename}');
}