map method

  1. @override
UserAcademicSummary 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
UserAcademicSummary map(Map<String, dynamic> data, {String? tablePrefix}) {
  final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
  return UserAcademicSummary(
    id: attachedDatabase.typeMapping.read(
      DriftSqlType.int,
      data['${effectivePrefix}id'],
    )!,
    user: attachedDatabase.typeMapping.read(
      DriftSqlType.int,
      data['${effectivePrefix}user'],
    )!,
    semester: attachedDatabase.typeMapping.read(
      DriftSqlType.int,
      data['${effectivePrefix}semester'],
    )!,
    year: attachedDatabase.typeMapping.read(
      DriftSqlType.int,
      data['${effectivePrefix}year'],
    )!,
    term: attachedDatabase.typeMapping.read(
      DriftSqlType.int,
      data['${effectivePrefix}term'],
    )!,
    average: attachedDatabase.typeMapping.read(
      DriftSqlType.double,
      data['${effectivePrefix}average'],
    ),
    conduct: attachedDatabase.typeMapping.read(
      DriftSqlType.double,
      data['${effectivePrefix}conduct'],
    ),
    totalCredits: attachedDatabase.typeMapping.read(
      DriftSqlType.double,
      data['${effectivePrefix}total_credits'],
    ),
    creditsPassed: attachedDatabase.typeMapping.read(
      DriftSqlType.double,
      data['${effectivePrefix}credits_passed'],
    ),
    note: attachedDatabase.typeMapping.read(
      DriftSqlType.string,
      data['${effectivePrefix}note'],
    ),
    gpa: attachedDatabase.typeMapping.read(
      DriftSqlType.double,
      data['${effectivePrefix}gpa'],
    ),
  );
}