map method

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

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

Implementation

@override
NotificationAuditData map(Map<String, dynamic> data, {String? tablePrefix}) {
  final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
  return NotificationAuditData(
    id: attachedDatabase.typeMapping
        .read(DriftSqlType.int, data['${effectivePrefix}id'])!,
    happenedAt: attachedDatabase.typeMapping
        .read(DriftSqlType.dateTime, data['${effectivePrefix}happened_at'])!,
    checkSum: attachedDatabase.typeMapping
        .read(DriftSqlType.string, data['${effectivePrefix}check_sum'])!,
    summary: attachedDatabase.typeMapping
        .read(DriftSqlType.string, data['${effectivePrefix}summary'])!,
    packageName: attachedDatabase.typeMapping
        .read(DriftSqlType.string, data['${effectivePrefix}package_name'])!,
    type: $NotificationAuditTable.$convertertype.fromSql(attachedDatabase
        .typeMapping
        .read(DriftSqlType.string, data['${effectivePrefix}type'])!),
    title: attachedDatabase.typeMapping
        .read(DriftSqlType.string, data['${effectivePrefix}title']),
    key: attachedDatabase.typeMapping
        .read(DriftSqlType.string, data['${effectivePrefix}key']),
  );
}