// GENERATED CODE - DO NOT MODIFY BY HAND part of 'database.dart'; // ************************************************************************** // MoorGenerator // ************************************************************************** // ignore_for_file: type=lint class Setting extends DataClass implements Insertable { final bool alarm; final bool vibrate; final String sound; final bool notify; final bool images; final bool showUnit; final String? lightColor; final String? darkColor; final bool steps; final String date; final bool showDate; final String theme; final bool showSets; final bool noSound; final bool backup; Setting( {required this.alarm, required this.vibrate, required this.sound, required this.notify, required this.images, required this.showUnit, this.lightColor, this.darkColor, required this.steps, required this.date, required this.showDate, required this.theme, required this.showSets, required this.noSound, required this.backup}); factory Setting.fromData(Map data, GeneratedDatabase db, {String? prefix}) { final effectivePrefix = prefix ?? ''; return Setting( alarm: const BoolType() .mapFromDatabaseResponse(data['${effectivePrefix}alarm'])!, vibrate: const BoolType() .mapFromDatabaseResponse(data['${effectivePrefix}vibrate'])!, sound: const StringType() .mapFromDatabaseResponse(data['${effectivePrefix}sound'])!, notify: const BoolType() .mapFromDatabaseResponse(data['${effectivePrefix}notify'])!, images: const BoolType() .mapFromDatabaseResponse(data['${effectivePrefix}images'])!, showUnit: const BoolType() .mapFromDatabaseResponse(data['${effectivePrefix}show_unit'])!, lightColor: const StringType() .mapFromDatabaseResponse(data['${effectivePrefix}light_color']), darkColor: const StringType() .mapFromDatabaseResponse(data['${effectivePrefix}dark_color']), steps: const BoolType() .mapFromDatabaseResponse(data['${effectivePrefix}steps'])!, date: const StringType() .mapFromDatabaseResponse(data['${effectivePrefix}date'])!, showDate: const BoolType() .mapFromDatabaseResponse(data['${effectivePrefix}show_date'])!, theme: const StringType() .mapFromDatabaseResponse(data['${effectivePrefix}theme'])!, showSets: const BoolType() .mapFromDatabaseResponse(data['${effectivePrefix}show_sets'])!, noSound: const BoolType() .mapFromDatabaseResponse(data['${effectivePrefix}no_sound'])!, backup: const BoolType() .mapFromDatabaseResponse(data['${effectivePrefix}backup'])!, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; map['alarm'] = Variable(alarm); map['vibrate'] = Variable(vibrate); map['sound'] = Variable(sound); map['notify'] = Variable(notify); map['images'] = Variable(images); map['show_unit'] = Variable(showUnit); if (!nullToAbsent || lightColor != null) { map['light_color'] = Variable(lightColor); } if (!nullToAbsent || darkColor != null) { map['dark_color'] = Variable(darkColor); } map['steps'] = Variable(steps); map['date'] = Variable(date); map['show_date'] = Variable(showDate); map['theme'] = Variable(theme); map['show_sets'] = Variable(showSets); map['no_sound'] = Variable(noSound); map['backup'] = Variable(backup); return map; } SettingsCompanion toCompanion(bool nullToAbsent) { return SettingsCompanion( alarm: Value(alarm), vibrate: Value(vibrate), sound: Value(sound), notify: Value(notify), images: Value(images), showUnit: Value(showUnit), lightColor: lightColor == null && nullToAbsent ? const Value.absent() : Value(lightColor), darkColor: darkColor == null && nullToAbsent ? const Value.absent() : Value(darkColor), steps: Value(steps), date: Value(date), showDate: Value(showDate), theme: Value(theme), showSets: Value(showSets), noSound: Value(noSound), backup: Value(backup), ); } factory Setting.fromJson(Map json, {ValueSerializer? serializer}) { serializer ??= moorRuntimeOptions.defaultSerializer; return Setting( alarm: serializer.fromJson(json['alarm']), vibrate: serializer.fromJson(json['vibrate']), sound: serializer.fromJson(json['sound']), notify: serializer.fromJson(json['notify']), images: serializer.fromJson(json['images']), showUnit: serializer.fromJson(json['showUnit']), lightColor: serializer.fromJson(json['lightColor']), darkColor: serializer.fromJson(json['darkColor']), steps: serializer.fromJson(json['steps']), date: serializer.fromJson(json['date']), showDate: serializer.fromJson(json['showDate']), theme: serializer.fromJson(json['theme']), showSets: serializer.fromJson(json['showSets']), noSound: serializer.fromJson(json['noSound']), backup: serializer.fromJson(json['backup']), ); } @override Map toJson({ValueSerializer? serializer}) { serializer ??= moorRuntimeOptions.defaultSerializer; return { 'alarm': serializer.toJson(alarm), 'vibrate': serializer.toJson(vibrate), 'sound': serializer.toJson(sound), 'notify': serializer.toJson(notify), 'images': serializer.toJson(images), 'showUnit': serializer.toJson(showUnit), 'lightColor': serializer.toJson(lightColor), 'darkColor': serializer.toJson(darkColor), 'steps': serializer.toJson(steps), 'date': serializer.toJson(date), 'showDate': serializer.toJson(showDate), 'theme': serializer.toJson(theme), 'showSets': serializer.toJson(showSets), 'noSound': serializer.toJson(noSound), 'backup': serializer.toJson(backup), }; } Setting copyWith( {bool? alarm, bool? vibrate, String? sound, bool? notify, bool? images, bool? showUnit, String? lightColor, String? darkColor, bool? steps, String? date, bool? showDate, String? theme, bool? showSets, bool? noSound, bool? backup}) => Setting( alarm: alarm ?? this.alarm, vibrate: vibrate ?? this.vibrate, sound: sound ?? this.sound, notify: notify ?? this.notify, images: images ?? this.images, showUnit: showUnit ?? this.showUnit, lightColor: lightColor ?? this.lightColor, darkColor: darkColor ?? this.darkColor, steps: steps ?? this.steps, date: date ?? this.date, showDate: showDate ?? this.showDate, theme: theme ?? this.theme, showSets: showSets ?? this.showSets, noSound: noSound ?? this.noSound, backup: backup ?? this.backup, ); @override String toString() { return (StringBuffer('Setting(') ..write('alarm: $alarm, ') ..write('vibrate: $vibrate, ') ..write('sound: $sound, ') ..write('notify: $notify, ') ..write('images: $images, ') ..write('showUnit: $showUnit, ') ..write('lightColor: $lightColor, ') ..write('darkColor: $darkColor, ') ..write('steps: $steps, ') ..write('date: $date, ') ..write('showDate: $showDate, ') ..write('theme: $theme, ') ..write('showSets: $showSets, ') ..write('noSound: $noSound, ') ..write('backup: $backup') ..write(')')) .toString(); } @override int get hashCode => Object.hash( alarm, vibrate, sound, notify, images, showUnit, lightColor, darkColor, steps, date, showDate, theme, showSets, noSound, backup); @override bool operator ==(Object other) => identical(this, other) || (other is Setting && other.alarm == this.alarm && other.vibrate == this.vibrate && other.sound == this.sound && other.notify == this.notify && other.images == this.images && other.showUnit == this.showUnit && other.lightColor == this.lightColor && other.darkColor == this.darkColor && other.steps == this.steps && other.date == this.date && other.showDate == this.showDate && other.theme == this.theme && other.showSets == this.showSets && other.noSound == this.noSound && other.backup == this.backup); } class SettingsCompanion extends UpdateCompanion { final Value alarm; final Value vibrate; final Value sound; final Value notify; final Value images; final Value showUnit; final Value lightColor; final Value darkColor; final Value steps; final Value date; final Value showDate; final Value theme; final Value showSets; final Value noSound; final Value backup; const SettingsCompanion({ this.alarm = const Value.absent(), this.vibrate = const Value.absent(), this.sound = const Value.absent(), this.notify = const Value.absent(), this.images = const Value.absent(), this.showUnit = const Value.absent(), this.lightColor = const Value.absent(), this.darkColor = const Value.absent(), this.steps = const Value.absent(), this.date = const Value.absent(), this.showDate = const Value.absent(), this.theme = const Value.absent(), this.showSets = const Value.absent(), this.noSound = const Value.absent(), this.backup = const Value.absent(), }); SettingsCompanion.insert({ required bool alarm, required bool vibrate, required String sound, required bool notify, required bool images, required bool showUnit, this.lightColor = const Value.absent(), this.darkColor = const Value.absent(), required bool steps, required String date, required bool showDate, required String theme, required bool showSets, required bool noSound, required bool backup, }) : alarm = Value(alarm), vibrate = Value(vibrate), sound = Value(sound), notify = Value(notify), images = Value(images), showUnit = Value(showUnit), steps = Value(steps), date = Value(date), showDate = Value(showDate), theme = Value(theme), showSets = Value(showSets), noSound = Value(noSound), backup = Value(backup); static Insertable custom({ Expression? alarm, Expression? vibrate, Expression? sound, Expression? notify, Expression? images, Expression? showUnit, Expression? lightColor, Expression? darkColor, Expression? steps, Expression? date, Expression? showDate, Expression? theme, Expression? showSets, Expression? noSound, Expression? backup, }) { return RawValuesInsertable({ if (alarm != null) 'alarm': alarm, if (vibrate != null) 'vibrate': vibrate, if (sound != null) 'sound': sound, if (notify != null) 'notify': notify, if (images != null) 'images': images, if (showUnit != null) 'show_unit': showUnit, if (lightColor != null) 'light_color': lightColor, if (darkColor != null) 'dark_color': darkColor, if (steps != null) 'steps': steps, if (date != null) 'date': date, if (showDate != null) 'show_date': showDate, if (theme != null) 'theme': theme, if (showSets != null) 'show_sets': showSets, if (noSound != null) 'no_sound': noSound, if (backup != null) 'backup': backup, }); } SettingsCompanion copyWith( {Value? alarm, Value? vibrate, Value? sound, Value? notify, Value? images, Value? showUnit, Value? lightColor, Value? darkColor, Value? steps, Value? date, Value? showDate, Value? theme, Value? showSets, Value? noSound, Value? backup}) { return SettingsCompanion( alarm: alarm ?? this.alarm, vibrate: vibrate ?? this.vibrate, sound: sound ?? this.sound, notify: notify ?? this.notify, images: images ?? this.images, showUnit: showUnit ?? this.showUnit, lightColor: lightColor ?? this.lightColor, darkColor: darkColor ?? this.darkColor, steps: steps ?? this.steps, date: date ?? this.date, showDate: showDate ?? this.showDate, theme: theme ?? this.theme, showSets: showSets ?? this.showSets, noSound: noSound ?? this.noSound, backup: backup ?? this.backup, ); } @override Map toColumns(bool nullToAbsent) { final map = {}; if (alarm.present) { map['alarm'] = Variable(alarm.value); } if (vibrate.present) { map['vibrate'] = Variable(vibrate.value); } if (sound.present) { map['sound'] = Variable(sound.value); } if (notify.present) { map['notify'] = Variable(notify.value); } if (images.present) { map['images'] = Variable(images.value); } if (showUnit.present) { map['show_unit'] = Variable(showUnit.value); } if (lightColor.present) { map['light_color'] = Variable(lightColor.value); } if (darkColor.present) { map['dark_color'] = Variable(darkColor.value); } if (steps.present) { map['steps'] = Variable(steps.value); } if (date.present) { map['date'] = Variable(date.value); } if (showDate.present) { map['show_date'] = Variable(showDate.value); } if (theme.present) { map['theme'] = Variable(theme.value); } if (showSets.present) { map['show_sets'] = Variable(showSets.value); } if (noSound.present) { map['no_sound'] = Variable(noSound.value); } if (backup.present) { map['backup'] = Variable(backup.value); } return map; } @override String toString() { return (StringBuffer('SettingsCompanion(') ..write('alarm: $alarm, ') ..write('vibrate: $vibrate, ') ..write('sound: $sound, ') ..write('notify: $notify, ') ..write('images: $images, ') ..write('showUnit: $showUnit, ') ..write('lightColor: $lightColor, ') ..write('darkColor: $darkColor, ') ..write('steps: $steps, ') ..write('date: $date, ') ..write('showDate: $showDate, ') ..write('theme: $theme, ') ..write('showSets: $showSets, ') ..write('noSound: $noSound, ') ..write('backup: $backup') ..write(')')) .toString(); } } class $SettingsTable extends Settings with TableInfo<$SettingsTable, Setting> { @override final GeneratedDatabase attachedDatabase; final String? _alias; $SettingsTable(this.attachedDatabase, [this._alias]); final VerificationMeta _alarmMeta = const VerificationMeta('alarm'); @override late final GeneratedColumn alarm = GeneratedColumn( 'alarm', aliasedName, false, type: const BoolType(), requiredDuringInsert: true, defaultConstraints: 'CHECK (alarm IN (0, 1))'); final VerificationMeta _vibrateMeta = const VerificationMeta('vibrate'); @override late final GeneratedColumn vibrate = GeneratedColumn( 'vibrate', aliasedName, false, type: const BoolType(), requiredDuringInsert: true, defaultConstraints: 'CHECK (vibrate IN (0, 1))'); final VerificationMeta _soundMeta = const VerificationMeta('sound'); @override late final GeneratedColumn sound = GeneratedColumn( 'sound', aliasedName, false, type: const StringType(), requiredDuringInsert: true); final VerificationMeta _notifyMeta = const VerificationMeta('notify'); @override late final GeneratedColumn notify = GeneratedColumn( 'notify', aliasedName, false, type: const BoolType(), requiredDuringInsert: true, defaultConstraints: 'CHECK (notify IN (0, 1))'); final VerificationMeta _imagesMeta = const VerificationMeta('images'); @override late final GeneratedColumn images = GeneratedColumn( 'images', aliasedName, false, type: const BoolType(), requiredDuringInsert: true, defaultConstraints: 'CHECK (images IN (0, 1))'); final VerificationMeta _showUnitMeta = const VerificationMeta('showUnit'); @override late final GeneratedColumn showUnit = GeneratedColumn( 'show_unit', aliasedName, false, type: const BoolType(), requiredDuringInsert: true, defaultConstraints: 'CHECK (show_unit IN (0, 1))'); final VerificationMeta _lightColorMeta = const VerificationMeta('lightColor'); @override late final GeneratedColumn lightColor = GeneratedColumn( 'light_color', aliasedName, true, type: const StringType(), requiredDuringInsert: false); final VerificationMeta _darkColorMeta = const VerificationMeta('darkColor'); @override late final GeneratedColumn darkColor = GeneratedColumn( 'dark_color', aliasedName, true, type: const StringType(), requiredDuringInsert: false); final VerificationMeta _stepsMeta = const VerificationMeta('steps'); @override late final GeneratedColumn steps = GeneratedColumn( 'steps', aliasedName, false, type: const BoolType(), requiredDuringInsert: true, defaultConstraints: 'CHECK (steps IN (0, 1))'); final VerificationMeta _dateMeta = const VerificationMeta('date'); @override late final GeneratedColumn date = GeneratedColumn( 'date', aliasedName, false, type: const StringType(), requiredDuringInsert: true); final VerificationMeta _showDateMeta = const VerificationMeta('showDate'); @override late final GeneratedColumn showDate = GeneratedColumn( 'show_date', aliasedName, false, type: const BoolType(), requiredDuringInsert: true, defaultConstraints: 'CHECK (show_date IN (0, 1))'); final VerificationMeta _themeMeta = const VerificationMeta('theme'); @override late final GeneratedColumn theme = GeneratedColumn( 'theme', aliasedName, false, type: const StringType(), requiredDuringInsert: true); final VerificationMeta _showSetsMeta = const VerificationMeta('showSets'); @override late final GeneratedColumn showSets = GeneratedColumn( 'show_sets', aliasedName, false, type: const BoolType(), requiredDuringInsert: true, defaultConstraints: 'CHECK (show_sets IN (0, 1))'); final VerificationMeta _noSoundMeta = const VerificationMeta('noSound'); @override late final GeneratedColumn noSound = GeneratedColumn( 'no_sound', aliasedName, false, type: const BoolType(), requiredDuringInsert: true, defaultConstraints: 'CHECK (no_sound IN (0, 1))'); final VerificationMeta _backupMeta = const VerificationMeta('backup'); @override late final GeneratedColumn backup = GeneratedColumn( 'backup', aliasedName, false, type: const BoolType(), requiredDuringInsert: true, defaultConstraints: 'CHECK (backup IN (0, 1))'); @override List get $columns => [ alarm, vibrate, sound, notify, images, showUnit, lightColor, darkColor, steps, date, showDate, theme, showSets, noSound, backup ]; @override String get aliasedName => _alias ?? 'settings'; @override String get actualTableName => 'settings'; @override VerificationContext validateIntegrity(Insertable instance, {bool isInserting = false}) { final context = VerificationContext(); final data = instance.toColumns(true); if (data.containsKey('alarm')) { context.handle( _alarmMeta, alarm.isAcceptableOrUnknown(data['alarm']!, _alarmMeta)); } else if (isInserting) { context.missing(_alarmMeta); } if (data.containsKey('vibrate')) { context.handle(_vibrateMeta, vibrate.isAcceptableOrUnknown(data['vibrate']!, _vibrateMeta)); } else if (isInserting) { context.missing(_vibrateMeta); } if (data.containsKey('sound')) { context.handle( _soundMeta, sound.isAcceptableOrUnknown(data['sound']!, _soundMeta)); } else if (isInserting) { context.missing(_soundMeta); } if (data.containsKey('notify')) { context.handle(_notifyMeta, notify.isAcceptableOrUnknown(data['notify']!, _notifyMeta)); } else if (isInserting) { context.missing(_notifyMeta); } if (data.containsKey('images')) { context.handle(_imagesMeta, images.isAcceptableOrUnknown(data['images']!, _imagesMeta)); } else if (isInserting) { context.missing(_imagesMeta); } if (data.containsKey('show_unit')) { context.handle(_showUnitMeta, showUnit.isAcceptableOrUnknown(data['show_unit']!, _showUnitMeta)); } else if (isInserting) { context.missing(_showUnitMeta); } if (data.containsKey('light_color')) { context.handle( _lightColorMeta, lightColor.isAcceptableOrUnknown( data['light_color']!, _lightColorMeta)); } if (data.containsKey('dark_color')) { context.handle(_darkColorMeta, darkColor.isAcceptableOrUnknown(data['dark_color']!, _darkColorMeta)); } if (data.containsKey('steps')) { context.handle( _stepsMeta, steps.isAcceptableOrUnknown(data['steps']!, _stepsMeta)); } else if (isInserting) { context.missing(_stepsMeta); } if (data.containsKey('date')) { context.handle( _dateMeta, date.isAcceptableOrUnknown(data['date']!, _dateMeta)); } else if (isInserting) { context.missing(_dateMeta); } if (data.containsKey('show_date')) { context.handle(_showDateMeta, showDate.isAcceptableOrUnknown(data['show_date']!, _showDateMeta)); } else if (isInserting) { context.missing(_showDateMeta); } if (data.containsKey('theme')) { context.handle( _themeMeta, theme.isAcceptableOrUnknown(data['theme']!, _themeMeta)); } else if (isInserting) { context.missing(_themeMeta); } if (data.containsKey('show_sets')) { context.handle(_showSetsMeta, showSets.isAcceptableOrUnknown(data['show_sets']!, _showSetsMeta)); } else if (isInserting) { context.missing(_showSetsMeta); } if (data.containsKey('no_sound')) { context.handle(_noSoundMeta, noSound.isAcceptableOrUnknown(data['no_sound']!, _noSoundMeta)); } else if (isInserting) { context.missing(_noSoundMeta); } if (data.containsKey('backup')) { context.handle(_backupMeta, backup.isAcceptableOrUnknown(data['backup']!, _backupMeta)); } else if (isInserting) { context.missing(_backupMeta); } return context; } @override Set get $primaryKey => {}; @override Setting map(Map data, {String? tablePrefix}) { return Setting.fromData(data, attachedDatabase, prefix: tablePrefix != null ? '$tablePrefix.' : null); } @override $SettingsTable createAlias(String alias) { return $SettingsTable(attachedDatabase, alias); } } abstract class _$MyDatabase extends GeneratedDatabase { _$MyDatabase(QueryExecutor e) : super(SqlTypeSystem.defaultInstance, e); late final $SettingsTable settings = $SettingsTable(this); @override Iterable get allTables => allSchemaEntities.whereType(); @override List get allSchemaEntities => [settings]; }