map method
Maps the given row returned by the database into the fitting data class.
Implementation
@override
TeacherData map(Map<String, dynamic> data, {String? tablePrefix}) {
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
return TeacherData(
id: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}id'],
)!,
fullName: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}full_name'],
)!,
birthday: attachedDatabase.typeMapping.read(
DriftSqlType.dateTime,
data['${effectivePrefix}birthday'],
)!,
genderId: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}gender_id'],
)!,
teacherPositionId: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}teacher_position_id'],
)!,
locked: attachedDatabase.typeMapping.read(
DriftSqlType.bool,
data['${effectivePrefix}locked'],
)!,
active: attachedDatabase.typeMapping.read(
DriftSqlType.bool,
data['${effectivePrefix}active'],
)!,
universityId: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}university_id'],
)!,
countryId: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}country_id'],
),
youtubeVideoCode: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}youtube_video_code'],
),
email: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}email'],
)!,
skype: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}skype'],
),
facebook: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}facebook'],
),
phoneNumber: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}phone_number'],
),
description: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}description'],
),
note: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}note'],
),
imagePath: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}image_path'],
),
);
}