map method
Maps the given row returned by the database into the fitting data class.
Implementation
@override
LessonData map(Map<String, dynamic> data, {String? tablePrefix}) {
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
return LessonData(
id: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}id'],
)!,
title: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}title'],
)!,
titleInEnglish: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}title_in_english'],
)!,
seqNum: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}seq_num'],
)!,
locked: attachedDatabase.typeMapping.read(
DriftSqlType.bool,
data['${effectivePrefix}locked'],
)!,
published: attachedDatabase.typeMapping.read(
DriftSqlType.bool,
data['${effectivePrefix}published'],
)!,
publishDate: attachedDatabase.typeMapping.read(
DriftSqlType.dateTime,
data['${effectivePrefix}publish_date'],
),
imagePath: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}image_path'],
),
bookId: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}book_id'],
)!,
description: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}description'],
),
note: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}note'],
),
);
}