map method

  1. @override
SettingsRow 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
SettingsRow map(Map<String, dynamic> data, {String? tablePrefix}) {
  final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : '';
  return SettingsRow(
    userId: attachedDatabase.typeMapping.read(
      DriftSqlType.string,
      data['${effectivePrefix}user_id'],
    ),
    enablePopups: attachedDatabase.typeMapping.read(
      DriftSqlType.bool,
      data['${effectivePrefix}enable_popups'],
    ),
    locale: attachedDatabase.typeMapping.read(
      DriftSqlType.string,
      data['${effectivePrefix}locale'],
    ),
    showIntroduction: attachedDatabase.typeMapping.read(
      DriftSqlType.bool,
      data['${effectivePrefix}show_introduction'],
    ),
    sideBarWidth: attachedDatabase.typeMapping.read(
      DriftSqlType.double,
      data['${effectivePrefix}side_bar_width'],
    ),
    callButtons: attachedDatabase.typeMapping.read(
      DriftSqlType.string,
      data['${effectivePrefix}call_buttons'],
    )!,
    pinnedActions: attachedDatabase.typeMapping.read(
      DriftSqlType.string,
      data['${effectivePrefix}pinned_actions'],
    )!,
    callButtonsPosition: attachedDatabase.typeMapping.read(
      DriftSqlType.string,
      data['${effectivePrefix}call_buttons_position'],
    ),
    workWithUsTabEnabled: attachedDatabase.typeMapping.read(
      DriftSqlType.bool,
      data['${effectivePrefix}work_with_us_tab_enabled'],
    ),
    videoDevice: attachedDatabase.typeMapping.read(
      DriftSqlType.string,
      data['${effectivePrefix}video_device'],
    ),
    audioDevice: attachedDatabase.typeMapping.read(
      DriftSqlType.string,
      data['${effectivePrefix}audio_device'],
    ),
    outputDevice: attachedDatabase.typeMapping.read(
      DriftSqlType.string,
      data['${effectivePrefix}output_device'],
    ),
    screenDevice: attachedDatabase.typeMapping.read(
      DriftSqlType.string,
      data['${effectivePrefix}screen_device'],
    ),
    muteKeys: attachedDatabase.typeMapping.read(
      DriftSqlType.string,
      data['${effectivePrefix}mute_keys'],
    ),
  );
}