map method

  1. @override
MapFloorRecord 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
MapFloorRecord map(Map<String, dynamic> data, {String? tablePrefix}) {
  final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
  return MapFloorRecord(
    layerName: attachedDatabase.typeMapping.read(
      DriftSqlType.string,
      data['${effectivePrefix}layer_name'],
    )!,
    building: attachedDatabase.typeMapping.read(
      DriftSqlType.string,
      data['${effectivePrefix}building'],
    )!,
    code: attachedDatabase.typeMapping.read(
      DriftSqlType.string,
      data['${effectivePrefix}code'],
    )!,
    fetchedAt: attachedDatabase.typeMapping.read(
      DriftSqlType.dateTime,
      data['${effectivePrefix}fetched_at'],
    ),
  );
}