map method
Maps the given row returned by the database into the fitting data class.
Implementation
@override
Group map(Map<String, dynamic> data, {String? tablePrefix}) {
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
return Group(
groupId: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}group_id'],
)!,
displayName: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}display_name'],
)!,
discoveredAt: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}discovered_at'],
)!,
lastSeenAt: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}last_seen_at'],
)!,
memberCount: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}member_count'],
)!,
isSubscribed: attachedDatabase.typeMapping.read(
DriftSqlType.bool,
data['${effectivePrefix}is_subscribed'],
)!,
metadata: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}metadata'],
),
);
}