map method
Maps the given row returned by the database into the fitting data class.
Implementation
@override
CountryData map(Map<String, dynamic> data, {String? tablePrefix}) {
final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
return CountryData(
id: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}id'],
)!,
code: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}code'],
)!,
name: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}name'],
)!,
nameInEnglish: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}name_in_english'],
)!,
countryCode: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}country_code'],
)!,
isoCode2: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}iso_code2'],
)!,
isoCode3: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}iso_code3'],
)!,
population: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}population'],
)!,
area: attachedDatabase.typeMapping.read(
DriftSqlType.int,
data['${effectivePrefix}area'],
)!,
gdp: attachedDatabase.typeMapping.read(
DriftSqlType.double,
data['${effectivePrefix}gdp'],
),
description: attachedDatabase.typeMapping.read(
DriftSqlType.string,
data['${effectivePrefix}description'],
),
);
}