validateIntegrity method

  1. @override
VerificationContext validateIntegrity(
  1. Insertable<SettingsRow> instance, {
  2. bool isInserting = false,
})
override

Validates that the given entity can be inserted into this table, meaning that it respects all constraints (nullability, text length, etc.).

Implementation

@override
VerificationContext validateIntegrity(Insertable<SettingsRow> instance,
    {bool isInserting = false}) {
  final context = VerificationContext();
  final data = instance.toColumns(true);
  if (data.containsKey('user_id')) {
    context.handle(_userIdMeta,
        userId.isAcceptableOrUnknown(data['user_id']!, _userIdMeta));
  }
  if (data.containsKey('enable_popups')) {
    context.handle(
        _enablePopupsMeta,
        enablePopups.isAcceptableOrUnknown(
            data['enable_popups']!, _enablePopupsMeta));
  }
  if (data.containsKey('locale')) {
    context.handle(_localeMeta,
        locale.isAcceptableOrUnknown(data['locale']!, _localeMeta));
  }
  if (data.containsKey('show_introduction')) {
    context.handle(
        _showIntroductionMeta,
        showIntroduction.isAcceptableOrUnknown(
            data['show_introduction']!, _showIntroductionMeta));
  }
  if (data.containsKey('side_bar_width')) {
    context.handle(
        _sideBarWidthMeta,
        sideBarWidth.isAcceptableOrUnknown(
            data['side_bar_width']!, _sideBarWidthMeta));
  }
  if (data.containsKey('call_buttons')) {
    context.handle(
        _callButtonsMeta,
        callButtons.isAcceptableOrUnknown(
            data['call_buttons']!, _callButtonsMeta));
  }
  if (data.containsKey('pinned_actions')) {
    context.handle(
        _pinnedActionsMeta,
        pinnedActions.isAcceptableOrUnknown(
            data['pinned_actions']!, _pinnedActionsMeta));
  }
  if (data.containsKey('call_buttons_position')) {
    context.handle(
        _callButtonsPositionMeta,
        callButtonsPosition.isAcceptableOrUnknown(
            data['call_buttons_position']!, _callButtonsPositionMeta));
  }
  if (data.containsKey('work_with_us_tab_enabled')) {
    context.handle(
        _workWithUsTabEnabledMeta,
        workWithUsTabEnabled.isAcceptableOrUnknown(
            data['work_with_us_tab_enabled']!, _workWithUsTabEnabledMeta));
  }
  if (data.containsKey('video_device')) {
    context.handle(
        _videoDeviceMeta,
        videoDevice.isAcceptableOrUnknown(
            data['video_device']!, _videoDeviceMeta));
  }
  if (data.containsKey('audio_device')) {
    context.handle(
        _audioDeviceMeta,
        audioDevice.isAcceptableOrUnknown(
            data['audio_device']!, _audioDeviceMeta));
  }
  if (data.containsKey('output_device')) {
    context.handle(
        _outputDeviceMeta,
        outputDevice.isAcceptableOrUnknown(
            data['output_device']!, _outputDeviceMeta));
  }
  if (data.containsKey('screen_device')) {
    context.handle(
        _screenDeviceMeta,
        screenDevice.isAcceptableOrUnknown(
            data['screen_device']!, _screenDeviceMeta));
  }
  if (data.containsKey('mute_keys')) {
    context.handle(_muteKeysMeta,
        muteKeys.isAcceptableOrUnknown(data['mute_keys']!, _muteKeysMeta));
  }
  return context;
}