map method

  1. @override
ChatMemberRow map(
  1. Map<String, dynamic> data, {
  2. String? tablePrefix,
})
override

Maps the given row returned by the database into the fitting data class.

Implementation

@override
ChatMemberRow map(Map<String, dynamic> data, {String? tablePrefix}) {
  final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
  return ChatMemberRow(
    userId: attachedDatabase.typeMapping
        .read(DriftSqlType.string, data['${effectivePrefix}user_id'])!,
    chatId: attachedDatabase.typeMapping
        .read(DriftSqlType.string, data['${effectivePrefix}chat_id'])!,
    joinedAt: $ChatMembersTable.$converterjoinedAt.fromSql(attachedDatabase
        .typeMapping
        .read(DriftSqlType.int, data['${effectivePrefix}joined_at'])!),
    cursor: attachedDatabase.typeMapping
        .read(DriftSqlType.string, data['${effectivePrefix}cursor']),
  );
}