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