map method

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

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

Implementation

@override
SyncPoint map(Map<String, dynamic> data, {String? tablePrefix}) {
  final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
  return SyncPoint(
    scopeName: attachedDatabase.typeMapping.read(
      DriftSqlType.string,
      data['${effectivePrefix}scope_name'],
    )!,
    scopeKeys: attachedDatabase.typeMapping.read(
      DriftSqlType.string,
      data['${effectivePrefix}scope_keys'],
    )!,
    lastServerTs: attachedDatabase.typeMapping.read(
      DriftSqlType.string,
      data['${effectivePrefix}last_server_ts'],
    )!,
  );
}