map method
override
Maps the given row returned by the database into the fitting data class.
Implementation
@override
Student map(Map<String, dynamic> data, {String? tablePrefix}) {
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
return Student(
id: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}id'],
)!,
studentId: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}student_id'],
)!,
name: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}name'],
),
);
}