map method

  1. @override
PortalApplicationCategory map(
  1. Map<String, dynamic> data, {
  2. String? tablePrefix,
})
override

Maps the given row returned by the database into the fitting data class.

Implementation

@override
PortalApplicationCategory map(
  Map<String, dynamic> data, {
  String? tablePrefix,
}) {
  final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
  return PortalApplicationCategory(
    id: attachedDatabase.typeMapping.read(
      DriftSqlType.int,
      data['${effectivePrefix}id'],
    )!,
    user: attachedDatabase.typeMapping.read(
      DriftSqlType.int,
      data['${effectivePrefix}user'],
    )!,
    distinguishedName: attachedDatabase.typeMapping.read(
      DriftSqlType.string,
      data['${effectivePrefix}distinguished_name'],
    )!,
    nameZh: attachedDatabase.typeMapping.read(
      DriftSqlType.string,
      data['${effectivePrefix}name_zh'],
    )!,
    nameEn: attachedDatabase.typeMapping.read(
      DriftSqlType.string,
      data['${effectivePrefix}name_en'],
    ),
    position: attachedDatabase.typeMapping.read(
      DriftSqlType.int,
      data['${effectivePrefix}position'],
    )!,
  );
}