diff --git a/.claude/settings.local.json b/.claude/settings.local.json index 3b1a4ca..39932b7 100644 --- a/.claude/settings.local.json +++ b/.claude/settings.local.json @@ -6,7 +6,9 @@ "Bash(dart run build_runner:*)", "Bash(findstr:*)", "Bash(dir /s /b \"C:\\\\Users\\\\kaziu\\\\Desktop\\\\Trainhubv2\\\\trainhub_flutter\\\\lib\\\\presentation\\\\*.dart\")", - "Bash(flutter build:*)" + "Bash(flutter build:*)", + "Bash(test:*)", + "Bash(powershell -Command \"Remove-Item ''C:\\\\Users\\\\kaziu\\\\Desktop\\\\Trainhubv2\\\\trainhub_flutter\\\\lib\\\\theme.dart'' -Force -ErrorAction SilentlyContinue; Remove-Item ''C:\\\\Users\\\\kaziu\\\\Desktop\\\\Trainhubv2\\\\trainhub_flutter\\\\lib\\\\models'' -Recurse -Force -ErrorAction SilentlyContinue; Remove-Item ''C:\\\\Users\\\\kaziu\\\\Desktop\\\\Trainhubv2\\\\trainhub_flutter\\\\lib\\\\database'' -Recurse -Force -ErrorAction SilentlyContinue; Remove-Item ''C:\\\\Users\\\\kaziu\\\\Desktop\\\\Trainhubv2\\\\trainhub_flutter\\\\lib\\\\providers'' -Recurse -Force -ErrorAction SilentlyContinue; Write-Output ''Done''\")" ] } } diff --git a/lib/database/database.dart b/lib/database/database.dart deleted file mode 100644 index abd6524..0000000 --- a/lib/database/database.dart +++ /dev/null @@ -1,148 +0,0 @@ -import 'package:drift/drift.dart'; -import 'package:drift/native.dart'; -import 'package:path_provider/path_provider.dart'; -import 'package:path/path.dart' as p; -import 'dart:io'; - -part 'database.g.dart'; - -// Exercises -class Exercises extends Table { - TextColumn get id => text()(); - TextColumn get name => text()(); - TextColumn get instructions => text().nullable()(); - TextColumn get enrichment => text().nullable()(); - TextColumn get tags => text().nullable()(); // JSON string - TextColumn get videoUrl => text().nullable()(); - - @override - Set get primaryKey => {id}; -} - -// TrainingPlans -class TrainingPlans extends Table { - TextColumn get id => text()(); - TextColumn get name => text()(); - TextColumn get sections => text().nullable()(); // JSON string - - @override - Set get primaryKey => {id}; -} - -// Programs -class Programs extends Table { - TextColumn get id => text()(); - TextColumn get name => text()(); - TextColumn get createdAt => text()(); - - @override - Set get primaryKey => {id}; -} - -// ProgramWeeks -class ProgramWeeks extends Table { - TextColumn get id => text()(); - TextColumn get programId => - text().references(Programs, #id, onDelete: KeyAction.cascade)(); - IntColumn get position => integer()(); - TextColumn get notes => text().nullable()(); - - @override - Set get primaryKey => {id}; -} - -// ProgramWorkouts -class ProgramWorkouts extends Table { - TextColumn get id => text()(); - TextColumn get weekId => - text().references(ProgramWeeks, #id, onDelete: KeyAction.cascade)(); - TextColumn get programId => - text().references(Programs, #id, onDelete: KeyAction.cascade)(); - TextColumn get day => text()(); - TextColumn get type => text()(); // "exercise" | "plan" - TextColumn get refId => text().nullable()(); - TextColumn get name => text().nullable()(); - TextColumn get description => text().nullable()(); - BoolColumn get completed => boolean().withDefault(const Constant(false))(); - - @override - Set get primaryKey => {id}; -} - -// AnalysisSessions -class AnalysisSessions extends Table { - TextColumn get id => text()(); - TextColumn get name => text()(); - TextColumn get date => text()(); - TextColumn get videoPath => text().nullable()(); - - @override - Set get primaryKey => {id}; -} - -// Annotations -class Annotations extends Table { - TextColumn get id => text()(); - TextColumn get sessionId => - text().references(AnalysisSessions, #id, onDelete: KeyAction.cascade)(); - RealColumn get startTime => real()(); - RealColumn get endTime => real()(); - TextColumn get name => text().nullable()(); - TextColumn get description => text().nullable()(); - TextColumn get color => text().nullable()(); - - @override - Set get primaryKey => {id}; -} - -// ChatSessions -class ChatSessions extends Table { - TextColumn get id => text()(); - TextColumn get title => text().nullable()(); - TextColumn get createdAt => text()(); - TextColumn get updatedAt => text()(); - - @override - Set get primaryKey => {id}; -} - -// ChatMessages -class ChatMessages extends Table { - TextColumn get id => text()(); - TextColumn get sessionId => - text().references(ChatSessions, #id, onDelete: KeyAction.cascade)(); - TextColumn get role => text()(); // 'user' | 'assistant' - TextColumn get content => text()(); - TextColumn get createdAt => text()(); - - @override - Set get primaryKey => {id}; -} - -@DriftDatabase( - tables: [ - Exercises, - TrainingPlans, - Programs, - ProgramWeeks, - ProgramWorkouts, - AnalysisSessions, - Annotations, - ChatSessions, - ChatMessages, - ], -) -class AppDatabase extends _$AppDatabase { - AppDatabase() : super(_openConnection()); - - @override - int get schemaVersion => 1; -} - -LazyDatabase _openConnection() { - return LazyDatabase(() async { - final dbFolder = await getApplicationDocumentsDirectory(); - final file = File(p.join(dbFolder.path, 'trainhub.sqlite')); - return NativeDatabase.createInBackground(file); - }); -} diff --git a/lib/database/database.g.dart b/lib/database/database.g.dart deleted file mode 100644 index 4c726d4..0000000 --- a/lib/database/database.g.dart +++ /dev/null @@ -1,6242 +0,0 @@ -// GENERATED CODE - DO NOT MODIFY BY HAND - -part of 'database.dart'; - -// ignore_for_file: type=lint -class $ExercisesTable extends Exercises - with TableInfo<$ExercisesTable, Exercise> { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - $ExercisesTable(this.attachedDatabase, [this._alias]); - static const VerificationMeta _idMeta = const VerificationMeta('id'); - @override - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - static const VerificationMeta _nameMeta = const VerificationMeta('name'); - @override - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - static const VerificationMeta _instructionsMeta = const VerificationMeta( - 'instructions', - ); - @override - late final GeneratedColumn instructions = GeneratedColumn( - 'instructions', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - static const VerificationMeta _enrichmentMeta = const VerificationMeta( - 'enrichment', - ); - @override - late final GeneratedColumn enrichment = GeneratedColumn( - 'enrichment', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - static const VerificationMeta _tagsMeta = const VerificationMeta('tags'); - @override - late final GeneratedColumn tags = GeneratedColumn( - 'tags', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - static const VerificationMeta _videoUrlMeta = const VerificationMeta( - 'videoUrl', - ); - @override - late final GeneratedColumn videoUrl = GeneratedColumn( - 'video_url', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - name, - instructions, - enrichment, - tags, - videoUrl, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'exercises'; - @override - VerificationContext validateIntegrity( - Insertable instance, { - bool isInserting = false, - }) { - final context = VerificationContext(); - final data = instance.toColumns(true); - if (data.containsKey('id')) { - context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); - } else if (isInserting) { - context.missing(_idMeta); - } - if (data.containsKey('name')) { - context.handle( - _nameMeta, - name.isAcceptableOrUnknown(data['name']!, _nameMeta), - ); - } else if (isInserting) { - context.missing(_nameMeta); - } - if (data.containsKey('instructions')) { - context.handle( - _instructionsMeta, - instructions.isAcceptableOrUnknown( - data['instructions']!, - _instructionsMeta, - ), - ); - } - if (data.containsKey('enrichment')) { - context.handle( - _enrichmentMeta, - enrichment.isAcceptableOrUnknown(data['enrichment']!, _enrichmentMeta), - ); - } - if (data.containsKey('tags')) { - context.handle( - _tagsMeta, - tags.isAcceptableOrUnknown(data['tags']!, _tagsMeta), - ); - } - if (data.containsKey('video_url')) { - context.handle( - _videoUrlMeta, - videoUrl.isAcceptableOrUnknown(data['video_url']!, _videoUrlMeta), - ); - } - return context; - } - - @override - Set get $primaryKey => {id}; - @override - Exercise map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return Exercise( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - instructions: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}instructions'], - ), - enrichment: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}enrichment'], - ), - tags: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}tags'], - ), - videoUrl: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}video_url'], - ), - ); - } - - @override - $ExercisesTable createAlias(String alias) { - return $ExercisesTable(attachedDatabase, alias); - } -} - -class Exercise extends DataClass implements Insertable { - final String id; - final String name; - final String? instructions; - final String? enrichment; - final String? tags; - final String? videoUrl; - const Exercise({ - required this.id, - required this.name, - this.instructions, - this.enrichment, - this.tags, - this.videoUrl, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - if (!nullToAbsent || instructions != null) { - map['instructions'] = Variable(instructions); - } - if (!nullToAbsent || enrichment != null) { - map['enrichment'] = Variable(enrichment); - } - if (!nullToAbsent || tags != null) { - map['tags'] = Variable(tags); - } - if (!nullToAbsent || videoUrl != null) { - map['video_url'] = Variable(videoUrl); - } - return map; - } - - ExercisesCompanion toCompanion(bool nullToAbsent) { - return ExercisesCompanion( - id: Value(id), - name: Value(name), - instructions: instructions == null && nullToAbsent - ? const Value.absent() - : Value(instructions), - enrichment: enrichment == null && nullToAbsent - ? const Value.absent() - : Value(enrichment), - tags: tags == null && nullToAbsent ? const Value.absent() : Value(tags), - videoUrl: videoUrl == null && nullToAbsent - ? const Value.absent() - : Value(videoUrl), - ); - } - - factory Exercise.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return Exercise( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - instructions: serializer.fromJson(json['instructions']), - enrichment: serializer.fromJson(json['enrichment']), - tags: serializer.fromJson(json['tags']), - videoUrl: serializer.fromJson(json['videoUrl']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'instructions': serializer.toJson(instructions), - 'enrichment': serializer.toJson(enrichment), - 'tags': serializer.toJson(tags), - 'videoUrl': serializer.toJson(videoUrl), - }; - } - - Exercise copyWith({ - String? id, - String? name, - Value instructions = const Value.absent(), - Value enrichment = const Value.absent(), - Value tags = const Value.absent(), - Value videoUrl = const Value.absent(), - }) => Exercise( - id: id ?? this.id, - name: name ?? this.name, - instructions: instructions.present ? instructions.value : this.instructions, - enrichment: enrichment.present ? enrichment.value : this.enrichment, - tags: tags.present ? tags.value : this.tags, - videoUrl: videoUrl.present ? videoUrl.value : this.videoUrl, - ); - Exercise copyWithCompanion(ExercisesCompanion data) { - return Exercise( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - instructions: data.instructions.present - ? data.instructions.value - : this.instructions, - enrichment: data.enrichment.present - ? data.enrichment.value - : this.enrichment, - tags: data.tags.present ? data.tags.value : this.tags, - videoUrl: data.videoUrl.present ? data.videoUrl.value : this.videoUrl, - ); - } - - @override - String toString() { - return (StringBuffer('Exercise(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('instructions: $instructions, ') - ..write('enrichment: $enrichment, ') - ..write('tags: $tags, ') - ..write('videoUrl: $videoUrl') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, name, instructions, enrichment, tags, videoUrl); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is Exercise && - other.id == this.id && - other.name == this.name && - other.instructions == this.instructions && - other.enrichment == this.enrichment && - other.tags == this.tags && - other.videoUrl == this.videoUrl); -} - -class ExercisesCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value instructions; - final Value enrichment; - final Value tags; - final Value videoUrl; - final Value rowid; - const ExercisesCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.instructions = const Value.absent(), - this.enrichment = const Value.absent(), - this.tags = const Value.absent(), - this.videoUrl = const Value.absent(), - this.rowid = const Value.absent(), - }); - ExercisesCompanion.insert({ - required String id, - required String name, - this.instructions = const Value.absent(), - this.enrichment = const Value.absent(), - this.tags = const Value.absent(), - this.videoUrl = const Value.absent(), - this.rowid = const Value.absent(), - }) : id = Value(id), - name = Value(name); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? instructions, - Expression? enrichment, - Expression? tags, - Expression? videoUrl, - Expression? rowid, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (instructions != null) 'instructions': instructions, - if (enrichment != null) 'enrichment': enrichment, - if (tags != null) 'tags': tags, - if (videoUrl != null) 'video_url': videoUrl, - if (rowid != null) 'rowid': rowid, - }); - } - - ExercisesCompanion copyWith({ - Value? id, - Value? name, - Value? instructions, - Value? enrichment, - Value? tags, - Value? videoUrl, - Value? rowid, - }) { - return ExercisesCompanion( - id: id ?? this.id, - name: name ?? this.name, - instructions: instructions ?? this.instructions, - enrichment: enrichment ?? this.enrichment, - tags: tags ?? this.tags, - videoUrl: videoUrl ?? this.videoUrl, - rowid: rowid ?? this.rowid, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (instructions.present) { - map['instructions'] = Variable(instructions.value); - } - if (enrichment.present) { - map['enrichment'] = Variable(enrichment.value); - } - if (tags.present) { - map['tags'] = Variable(tags.value); - } - if (videoUrl.present) { - map['video_url'] = Variable(videoUrl.value); - } - if (rowid.present) { - map['rowid'] = Variable(rowid.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('ExercisesCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('instructions: $instructions, ') - ..write('enrichment: $enrichment, ') - ..write('tags: $tags, ') - ..write('videoUrl: $videoUrl, ') - ..write('rowid: $rowid') - ..write(')')) - .toString(); - } -} - -class $TrainingPlansTable extends TrainingPlans - with TableInfo<$TrainingPlansTable, TrainingPlan> { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - $TrainingPlansTable(this.attachedDatabase, [this._alias]); - static const VerificationMeta _idMeta = const VerificationMeta('id'); - @override - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - static const VerificationMeta _nameMeta = const VerificationMeta('name'); - @override - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - static const VerificationMeta _sectionsMeta = const VerificationMeta( - 'sections', - ); - @override - late final GeneratedColumn sections = GeneratedColumn( - 'sections', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [id, name, sections]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'training_plans'; - @override - VerificationContext validateIntegrity( - Insertable instance, { - bool isInserting = false, - }) { - final context = VerificationContext(); - final data = instance.toColumns(true); - if (data.containsKey('id')) { - context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); - } else if (isInserting) { - context.missing(_idMeta); - } - if (data.containsKey('name')) { - context.handle( - _nameMeta, - name.isAcceptableOrUnknown(data['name']!, _nameMeta), - ); - } else if (isInserting) { - context.missing(_nameMeta); - } - if (data.containsKey('sections')) { - context.handle( - _sectionsMeta, - sections.isAcceptableOrUnknown(data['sections']!, _sectionsMeta), - ); - } - return context; - } - - @override - Set get $primaryKey => {id}; - @override - TrainingPlan map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return TrainingPlan( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - sections: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}sections'], - ), - ); - } - - @override - $TrainingPlansTable createAlias(String alias) { - return $TrainingPlansTable(attachedDatabase, alias); - } -} - -class TrainingPlan extends DataClass implements Insertable { - final String id; - final String name; - final String? sections; - const TrainingPlan({required this.id, required this.name, this.sections}); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - if (!nullToAbsent || sections != null) { - map['sections'] = Variable(sections); - } - return map; - } - - TrainingPlansCompanion toCompanion(bool nullToAbsent) { - return TrainingPlansCompanion( - id: Value(id), - name: Value(name), - sections: sections == null && nullToAbsent - ? const Value.absent() - : Value(sections), - ); - } - - factory TrainingPlan.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return TrainingPlan( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - sections: serializer.fromJson(json['sections']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'sections': serializer.toJson(sections), - }; - } - - TrainingPlan copyWith({ - String? id, - String? name, - Value sections = const Value.absent(), - }) => TrainingPlan( - id: id ?? this.id, - name: name ?? this.name, - sections: sections.present ? sections.value : this.sections, - ); - TrainingPlan copyWithCompanion(TrainingPlansCompanion data) { - return TrainingPlan( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - sections: data.sections.present ? data.sections.value : this.sections, - ); - } - - @override - String toString() { - return (StringBuffer('TrainingPlan(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('sections: $sections') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(id, name, sections); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is TrainingPlan && - other.id == this.id && - other.name == this.name && - other.sections == this.sections); -} - -class TrainingPlansCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value sections; - final Value rowid; - const TrainingPlansCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.sections = const Value.absent(), - this.rowid = const Value.absent(), - }); - TrainingPlansCompanion.insert({ - required String id, - required String name, - this.sections = const Value.absent(), - this.rowid = const Value.absent(), - }) : id = Value(id), - name = Value(name); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? sections, - Expression? rowid, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (sections != null) 'sections': sections, - if (rowid != null) 'rowid': rowid, - }); - } - - TrainingPlansCompanion copyWith({ - Value? id, - Value? name, - Value? sections, - Value? rowid, - }) { - return TrainingPlansCompanion( - id: id ?? this.id, - name: name ?? this.name, - sections: sections ?? this.sections, - rowid: rowid ?? this.rowid, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (sections.present) { - map['sections'] = Variable(sections.value); - } - if (rowid.present) { - map['rowid'] = Variable(rowid.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('TrainingPlansCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('sections: $sections, ') - ..write('rowid: $rowid') - ..write(')')) - .toString(); - } -} - -class $ProgramsTable extends Programs with TableInfo<$ProgramsTable, Program> { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - $ProgramsTable(this.attachedDatabase, [this._alias]); - static const VerificationMeta _idMeta = const VerificationMeta('id'); - @override - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - static const VerificationMeta _nameMeta = const VerificationMeta('name'); - @override - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - static const VerificationMeta _createdAtMeta = const VerificationMeta( - 'createdAt', - ); - @override - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [id, name, createdAt]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'programs'; - @override - VerificationContext validateIntegrity( - Insertable instance, { - bool isInserting = false, - }) { - final context = VerificationContext(); - final data = instance.toColumns(true); - if (data.containsKey('id')) { - context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); - } else if (isInserting) { - context.missing(_idMeta); - } - if (data.containsKey('name')) { - context.handle( - _nameMeta, - name.isAcceptableOrUnknown(data['name']!, _nameMeta), - ); - } else if (isInserting) { - context.missing(_nameMeta); - } - if (data.containsKey('created_at')) { - context.handle( - _createdAtMeta, - createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta), - ); - } else if (isInserting) { - context.missing(_createdAtMeta); - } - return context; - } - - @override - Set get $primaryKey => {id}; - @override - Program map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return Program( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - ); - } - - @override - $ProgramsTable createAlias(String alias) { - return $ProgramsTable(attachedDatabase, alias); - } -} - -class Program extends DataClass implements Insertable { - final String id; - final String name; - final String createdAt; - const Program({ - required this.id, - required this.name, - required this.createdAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['created_at'] = Variable(createdAt); - return map; - } - - ProgramsCompanion toCompanion(bool nullToAbsent) { - return ProgramsCompanion( - id: Value(id), - name: Value(name), - createdAt: Value(createdAt), - ); - } - - factory Program.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return Program( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - createdAt: serializer.fromJson(json['createdAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'createdAt': serializer.toJson(createdAt), - }; - } - - Program copyWith({String? id, String? name, String? createdAt}) => Program( - id: id ?? this.id, - name: name ?? this.name, - createdAt: createdAt ?? this.createdAt, - ); - Program copyWithCompanion(ProgramsCompanion data) { - return Program( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - ); - } - - @override - String toString() { - return (StringBuffer('Program(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('createdAt: $createdAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(id, name, createdAt); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is Program && - other.id == this.id && - other.name == this.name && - other.createdAt == this.createdAt); -} - -class ProgramsCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value createdAt; - final Value rowid; - const ProgramsCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.createdAt = const Value.absent(), - this.rowid = const Value.absent(), - }); - ProgramsCompanion.insert({ - required String id, - required String name, - required String createdAt, - this.rowid = const Value.absent(), - }) : id = Value(id), - name = Value(name), - createdAt = Value(createdAt); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? createdAt, - Expression? rowid, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (createdAt != null) 'created_at': createdAt, - if (rowid != null) 'rowid': rowid, - }); - } - - ProgramsCompanion copyWith({ - Value? id, - Value? name, - Value? createdAt, - Value? rowid, - }) { - return ProgramsCompanion( - id: id ?? this.id, - name: name ?? this.name, - createdAt: createdAt ?? this.createdAt, - rowid: rowid ?? this.rowid, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (rowid.present) { - map['rowid'] = Variable(rowid.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('ProgramsCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('createdAt: $createdAt, ') - ..write('rowid: $rowid') - ..write(')')) - .toString(); - } -} - -class $ProgramWeeksTable extends ProgramWeeks - with TableInfo<$ProgramWeeksTable, ProgramWeek> { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - $ProgramWeeksTable(this.attachedDatabase, [this._alias]); - static const VerificationMeta _idMeta = const VerificationMeta('id'); - @override - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - static const VerificationMeta _programIdMeta = const VerificationMeta( - 'programId', - ); - @override - late final GeneratedColumn programId = GeneratedColumn( - 'program_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES programs (id) ON DELETE CASCADE', - ), - ); - static const VerificationMeta _positionMeta = const VerificationMeta( - 'position', - ); - @override - late final GeneratedColumn position = GeneratedColumn( - 'position', - aliasedName, - false, - type: DriftSqlType.int, - requiredDuringInsert: true, - ); - static const VerificationMeta _notesMeta = const VerificationMeta('notes'); - @override - late final GeneratedColumn notes = GeneratedColumn( - 'notes', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [id, programId, position, notes]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'program_weeks'; - @override - VerificationContext validateIntegrity( - Insertable instance, { - bool isInserting = false, - }) { - final context = VerificationContext(); - final data = instance.toColumns(true); - if (data.containsKey('id')) { - context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); - } else if (isInserting) { - context.missing(_idMeta); - } - if (data.containsKey('program_id')) { - context.handle( - _programIdMeta, - programId.isAcceptableOrUnknown(data['program_id']!, _programIdMeta), - ); - } else if (isInserting) { - context.missing(_programIdMeta); - } - if (data.containsKey('position')) { - context.handle( - _positionMeta, - position.isAcceptableOrUnknown(data['position']!, _positionMeta), - ); - } else if (isInserting) { - context.missing(_positionMeta); - } - if (data.containsKey('notes')) { - context.handle( - _notesMeta, - notes.isAcceptableOrUnknown(data['notes']!, _notesMeta), - ); - } - return context; - } - - @override - Set get $primaryKey => {id}; - @override - ProgramWeek map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return ProgramWeek( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - programId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}program_id'], - )!, - position: attachedDatabase.typeMapping.read( - DriftSqlType.int, - data['${effectivePrefix}position'], - )!, - notes: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}notes'], - ), - ); - } - - @override - $ProgramWeeksTable createAlias(String alias) { - return $ProgramWeeksTable(attachedDatabase, alias); - } -} - -class ProgramWeek extends DataClass implements Insertable { - final String id; - final String programId; - final int position; - final String? notes; - const ProgramWeek({ - required this.id, - required this.programId, - required this.position, - this.notes, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['program_id'] = Variable(programId); - map['position'] = Variable(position); - if (!nullToAbsent || notes != null) { - map['notes'] = Variable(notes); - } - return map; - } - - ProgramWeeksCompanion toCompanion(bool nullToAbsent) { - return ProgramWeeksCompanion( - id: Value(id), - programId: Value(programId), - position: Value(position), - notes: notes == null && nullToAbsent - ? const Value.absent() - : Value(notes), - ); - } - - factory ProgramWeek.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return ProgramWeek( - id: serializer.fromJson(json['id']), - programId: serializer.fromJson(json['programId']), - position: serializer.fromJson(json['position']), - notes: serializer.fromJson(json['notes']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'programId': serializer.toJson(programId), - 'position': serializer.toJson(position), - 'notes': serializer.toJson(notes), - }; - } - - ProgramWeek copyWith({ - String? id, - String? programId, - int? position, - Value notes = const Value.absent(), - }) => ProgramWeek( - id: id ?? this.id, - programId: programId ?? this.programId, - position: position ?? this.position, - notes: notes.present ? notes.value : this.notes, - ); - ProgramWeek copyWithCompanion(ProgramWeeksCompanion data) { - return ProgramWeek( - id: data.id.present ? data.id.value : this.id, - programId: data.programId.present ? data.programId.value : this.programId, - position: data.position.present ? data.position.value : this.position, - notes: data.notes.present ? data.notes.value : this.notes, - ); - } - - @override - String toString() { - return (StringBuffer('ProgramWeek(') - ..write('id: $id, ') - ..write('programId: $programId, ') - ..write('position: $position, ') - ..write('notes: $notes') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(id, programId, position, notes); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is ProgramWeek && - other.id == this.id && - other.programId == this.programId && - other.position == this.position && - other.notes == this.notes); -} - -class ProgramWeeksCompanion extends UpdateCompanion { - final Value id; - final Value programId; - final Value position; - final Value notes; - final Value rowid; - const ProgramWeeksCompanion({ - this.id = const Value.absent(), - this.programId = const Value.absent(), - this.position = const Value.absent(), - this.notes = const Value.absent(), - this.rowid = const Value.absent(), - }); - ProgramWeeksCompanion.insert({ - required String id, - required String programId, - required int position, - this.notes = const Value.absent(), - this.rowid = const Value.absent(), - }) : id = Value(id), - programId = Value(programId), - position = Value(position); - static Insertable custom({ - Expression? id, - Expression? programId, - Expression? position, - Expression? notes, - Expression? rowid, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (programId != null) 'program_id': programId, - if (position != null) 'position': position, - if (notes != null) 'notes': notes, - if (rowid != null) 'rowid': rowid, - }); - } - - ProgramWeeksCompanion copyWith({ - Value? id, - Value? programId, - Value? position, - Value? notes, - Value? rowid, - }) { - return ProgramWeeksCompanion( - id: id ?? this.id, - programId: programId ?? this.programId, - position: position ?? this.position, - notes: notes ?? this.notes, - rowid: rowid ?? this.rowid, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (programId.present) { - map['program_id'] = Variable(programId.value); - } - if (position.present) { - map['position'] = Variable(position.value); - } - if (notes.present) { - map['notes'] = Variable(notes.value); - } - if (rowid.present) { - map['rowid'] = Variable(rowid.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('ProgramWeeksCompanion(') - ..write('id: $id, ') - ..write('programId: $programId, ') - ..write('position: $position, ') - ..write('notes: $notes, ') - ..write('rowid: $rowid') - ..write(')')) - .toString(); - } -} - -class $ProgramWorkoutsTable extends ProgramWorkouts - with TableInfo<$ProgramWorkoutsTable, ProgramWorkout> { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - $ProgramWorkoutsTable(this.attachedDatabase, [this._alias]); - static const VerificationMeta _idMeta = const VerificationMeta('id'); - @override - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - static const VerificationMeta _weekIdMeta = const VerificationMeta('weekId'); - @override - late final GeneratedColumn weekId = GeneratedColumn( - 'week_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES program_weeks (id) ON DELETE CASCADE', - ), - ); - static const VerificationMeta _programIdMeta = const VerificationMeta( - 'programId', - ); - @override - late final GeneratedColumn programId = GeneratedColumn( - 'program_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES programs (id) ON DELETE CASCADE', - ), - ); - static const VerificationMeta _dayMeta = const VerificationMeta('day'); - @override - late final GeneratedColumn day = GeneratedColumn( - 'day', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - static const VerificationMeta _typeMeta = const VerificationMeta('type'); - @override - late final GeneratedColumn type = GeneratedColumn( - 'type', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - static const VerificationMeta _refIdMeta = const VerificationMeta('refId'); - @override - late final GeneratedColumn refId = GeneratedColumn( - 'ref_id', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - static const VerificationMeta _nameMeta = const VerificationMeta('name'); - @override - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - static const VerificationMeta _descriptionMeta = const VerificationMeta( - 'description', - ); - @override - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - static const VerificationMeta _completedMeta = const VerificationMeta( - 'completed', - ); - @override - late final GeneratedColumn completed = GeneratedColumn( - 'completed', - aliasedName, - false, - type: DriftSqlType.bool, - requiredDuringInsert: false, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'CHECK ("completed" IN (0, 1))', - ), - defaultValue: const Constant(false), - ); - @override - List get $columns => [ - id, - weekId, - programId, - day, - type, - refId, - name, - description, - completed, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'program_workouts'; - @override - VerificationContext validateIntegrity( - Insertable instance, { - bool isInserting = false, - }) { - final context = VerificationContext(); - final data = instance.toColumns(true); - if (data.containsKey('id')) { - context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); - } else if (isInserting) { - context.missing(_idMeta); - } - if (data.containsKey('week_id')) { - context.handle( - _weekIdMeta, - weekId.isAcceptableOrUnknown(data['week_id']!, _weekIdMeta), - ); - } else if (isInserting) { - context.missing(_weekIdMeta); - } - if (data.containsKey('program_id')) { - context.handle( - _programIdMeta, - programId.isAcceptableOrUnknown(data['program_id']!, _programIdMeta), - ); - } else if (isInserting) { - context.missing(_programIdMeta); - } - if (data.containsKey('day')) { - context.handle( - _dayMeta, - day.isAcceptableOrUnknown(data['day']!, _dayMeta), - ); - } else if (isInserting) { - context.missing(_dayMeta); - } - if (data.containsKey('type')) { - context.handle( - _typeMeta, - type.isAcceptableOrUnknown(data['type']!, _typeMeta), - ); - } else if (isInserting) { - context.missing(_typeMeta); - } - if (data.containsKey('ref_id')) { - context.handle( - _refIdMeta, - refId.isAcceptableOrUnknown(data['ref_id']!, _refIdMeta), - ); - } - if (data.containsKey('name')) { - context.handle( - _nameMeta, - name.isAcceptableOrUnknown(data['name']!, _nameMeta), - ); - } - if (data.containsKey('description')) { - context.handle( - _descriptionMeta, - description.isAcceptableOrUnknown( - data['description']!, - _descriptionMeta, - ), - ); - } - if (data.containsKey('completed')) { - context.handle( - _completedMeta, - completed.isAcceptableOrUnknown(data['completed']!, _completedMeta), - ); - } - return context; - } - - @override - Set get $primaryKey => {id}; - @override - ProgramWorkout map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return ProgramWorkout( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - weekId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}week_id'], - )!, - programId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}program_id'], - )!, - day: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}day'], - )!, - type: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}type'], - )!, - refId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}ref_id'], - ), - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - ), - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - ), - completed: attachedDatabase.typeMapping.read( - DriftSqlType.bool, - data['${effectivePrefix}completed'], - )!, - ); - } - - @override - $ProgramWorkoutsTable createAlias(String alias) { - return $ProgramWorkoutsTable(attachedDatabase, alias); - } -} - -class ProgramWorkout extends DataClass implements Insertable { - final String id; - final String weekId; - final String programId; - final String day; - final String type; - final String? refId; - final String? name; - final String? description; - final bool completed; - const ProgramWorkout({ - required this.id, - required this.weekId, - required this.programId, - required this.day, - required this.type, - this.refId, - this.name, - this.description, - required this.completed, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['week_id'] = Variable(weekId); - map['program_id'] = Variable(programId); - map['day'] = Variable(day); - map['type'] = Variable(type); - if (!nullToAbsent || refId != null) { - map['ref_id'] = Variable(refId); - } - if (!nullToAbsent || name != null) { - map['name'] = Variable(name); - } - if (!nullToAbsent || description != null) { - map['description'] = Variable(description); - } - map['completed'] = Variable(completed); - return map; - } - - ProgramWorkoutsCompanion toCompanion(bool nullToAbsent) { - return ProgramWorkoutsCompanion( - id: Value(id), - weekId: Value(weekId), - programId: Value(programId), - day: Value(day), - type: Value(type), - refId: refId == null && nullToAbsent - ? const Value.absent() - : Value(refId), - name: name == null && nullToAbsent ? const Value.absent() : Value(name), - description: description == null && nullToAbsent - ? const Value.absent() - : Value(description), - completed: Value(completed), - ); - } - - factory ProgramWorkout.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return ProgramWorkout( - id: serializer.fromJson(json['id']), - weekId: serializer.fromJson(json['weekId']), - programId: serializer.fromJson(json['programId']), - day: serializer.fromJson(json['day']), - type: serializer.fromJson(json['type']), - refId: serializer.fromJson(json['refId']), - name: serializer.fromJson(json['name']), - description: serializer.fromJson(json['description']), - completed: serializer.fromJson(json['completed']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'weekId': serializer.toJson(weekId), - 'programId': serializer.toJson(programId), - 'day': serializer.toJson(day), - 'type': serializer.toJson(type), - 'refId': serializer.toJson(refId), - 'name': serializer.toJson(name), - 'description': serializer.toJson(description), - 'completed': serializer.toJson(completed), - }; - } - - ProgramWorkout copyWith({ - String? id, - String? weekId, - String? programId, - String? day, - String? type, - Value refId = const Value.absent(), - Value name = const Value.absent(), - Value description = const Value.absent(), - bool? completed, - }) => ProgramWorkout( - id: id ?? this.id, - weekId: weekId ?? this.weekId, - programId: programId ?? this.programId, - day: day ?? this.day, - type: type ?? this.type, - refId: refId.present ? refId.value : this.refId, - name: name.present ? name.value : this.name, - description: description.present ? description.value : this.description, - completed: completed ?? this.completed, - ); - ProgramWorkout copyWithCompanion(ProgramWorkoutsCompanion data) { - return ProgramWorkout( - id: data.id.present ? data.id.value : this.id, - weekId: data.weekId.present ? data.weekId.value : this.weekId, - programId: data.programId.present ? data.programId.value : this.programId, - day: data.day.present ? data.day.value : this.day, - type: data.type.present ? data.type.value : this.type, - refId: data.refId.present ? data.refId.value : this.refId, - name: data.name.present ? data.name.value : this.name, - description: data.description.present - ? data.description.value - : this.description, - completed: data.completed.present ? data.completed.value : this.completed, - ); - } - - @override - String toString() { - return (StringBuffer('ProgramWorkout(') - ..write('id: $id, ') - ..write('weekId: $weekId, ') - ..write('programId: $programId, ') - ..write('day: $day, ') - ..write('type: $type, ') - ..write('refId: $refId, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('completed: $completed') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash( - id, - weekId, - programId, - day, - type, - refId, - name, - description, - completed, - ); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is ProgramWorkout && - other.id == this.id && - other.weekId == this.weekId && - other.programId == this.programId && - other.day == this.day && - other.type == this.type && - other.refId == this.refId && - other.name == this.name && - other.description == this.description && - other.completed == this.completed); -} - -class ProgramWorkoutsCompanion extends UpdateCompanion { - final Value id; - final Value weekId; - final Value programId; - final Value day; - final Value type; - final Value refId; - final Value name; - final Value description; - final Value completed; - final Value rowid; - const ProgramWorkoutsCompanion({ - this.id = const Value.absent(), - this.weekId = const Value.absent(), - this.programId = const Value.absent(), - this.day = const Value.absent(), - this.type = const Value.absent(), - this.refId = const Value.absent(), - this.name = const Value.absent(), - this.description = const Value.absent(), - this.completed = const Value.absent(), - this.rowid = const Value.absent(), - }); - ProgramWorkoutsCompanion.insert({ - required String id, - required String weekId, - required String programId, - required String day, - required String type, - this.refId = const Value.absent(), - this.name = const Value.absent(), - this.description = const Value.absent(), - this.completed = const Value.absent(), - this.rowid = const Value.absent(), - }) : id = Value(id), - weekId = Value(weekId), - programId = Value(programId), - day = Value(day), - type = Value(type); - static Insertable custom({ - Expression? id, - Expression? weekId, - Expression? programId, - Expression? day, - Expression? type, - Expression? refId, - Expression? name, - Expression? description, - Expression? completed, - Expression? rowid, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (weekId != null) 'week_id': weekId, - if (programId != null) 'program_id': programId, - if (day != null) 'day': day, - if (type != null) 'type': type, - if (refId != null) 'ref_id': refId, - if (name != null) 'name': name, - if (description != null) 'description': description, - if (completed != null) 'completed': completed, - if (rowid != null) 'rowid': rowid, - }); - } - - ProgramWorkoutsCompanion copyWith({ - Value? id, - Value? weekId, - Value? programId, - Value? day, - Value? type, - Value? refId, - Value? name, - Value? description, - Value? completed, - Value? rowid, - }) { - return ProgramWorkoutsCompanion( - id: id ?? this.id, - weekId: weekId ?? this.weekId, - programId: programId ?? this.programId, - day: day ?? this.day, - type: type ?? this.type, - refId: refId ?? this.refId, - name: name ?? this.name, - description: description ?? this.description, - completed: completed ?? this.completed, - rowid: rowid ?? this.rowid, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (weekId.present) { - map['week_id'] = Variable(weekId.value); - } - if (programId.present) { - map['program_id'] = Variable(programId.value); - } - if (day.present) { - map['day'] = Variable(day.value); - } - if (type.present) { - map['type'] = Variable(type.value); - } - if (refId.present) { - map['ref_id'] = Variable(refId.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (completed.present) { - map['completed'] = Variable(completed.value); - } - if (rowid.present) { - map['rowid'] = Variable(rowid.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('ProgramWorkoutsCompanion(') - ..write('id: $id, ') - ..write('weekId: $weekId, ') - ..write('programId: $programId, ') - ..write('day: $day, ') - ..write('type: $type, ') - ..write('refId: $refId, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('completed: $completed, ') - ..write('rowid: $rowid') - ..write(')')) - .toString(); - } -} - -class $AnalysisSessionsTable extends AnalysisSessions - with TableInfo<$AnalysisSessionsTable, AnalysisSession> { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - $AnalysisSessionsTable(this.attachedDatabase, [this._alias]); - static const VerificationMeta _idMeta = const VerificationMeta('id'); - @override - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - static const VerificationMeta _nameMeta = const VerificationMeta('name'); - @override - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - static const VerificationMeta _dateMeta = const VerificationMeta('date'); - @override - late final GeneratedColumn date = GeneratedColumn( - 'date', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - static const VerificationMeta _videoPathMeta = const VerificationMeta( - 'videoPath', - ); - @override - late final GeneratedColumn videoPath = GeneratedColumn( - 'video_path', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [id, name, date, videoPath]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'analysis_sessions'; - @override - VerificationContext validateIntegrity( - Insertable instance, { - bool isInserting = false, - }) { - final context = VerificationContext(); - final data = instance.toColumns(true); - if (data.containsKey('id')) { - context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); - } else if (isInserting) { - context.missing(_idMeta); - } - if (data.containsKey('name')) { - context.handle( - _nameMeta, - name.isAcceptableOrUnknown(data['name']!, _nameMeta), - ); - } else if (isInserting) { - context.missing(_nameMeta); - } - if (data.containsKey('date')) { - context.handle( - _dateMeta, - date.isAcceptableOrUnknown(data['date']!, _dateMeta), - ); - } else if (isInserting) { - context.missing(_dateMeta); - } - if (data.containsKey('video_path')) { - context.handle( - _videoPathMeta, - videoPath.isAcceptableOrUnknown(data['video_path']!, _videoPathMeta), - ); - } - return context; - } - - @override - Set get $primaryKey => {id}; - @override - AnalysisSession map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return AnalysisSession( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - )!, - date: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}date'], - )!, - videoPath: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}video_path'], - ), - ); - } - - @override - $AnalysisSessionsTable createAlias(String alias) { - return $AnalysisSessionsTable(attachedDatabase, alias); - } -} - -class AnalysisSession extends DataClass implements Insertable { - final String id; - final String name; - final String date; - final String? videoPath; - const AnalysisSession({ - required this.id, - required this.name, - required this.date, - this.videoPath, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['name'] = Variable(name); - map['date'] = Variable(date); - if (!nullToAbsent || videoPath != null) { - map['video_path'] = Variable(videoPath); - } - return map; - } - - AnalysisSessionsCompanion toCompanion(bool nullToAbsent) { - return AnalysisSessionsCompanion( - id: Value(id), - name: Value(name), - date: Value(date), - videoPath: videoPath == null && nullToAbsent - ? const Value.absent() - : Value(videoPath), - ); - } - - factory AnalysisSession.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return AnalysisSession( - id: serializer.fromJson(json['id']), - name: serializer.fromJson(json['name']), - date: serializer.fromJson(json['date']), - videoPath: serializer.fromJson(json['videoPath']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'name': serializer.toJson(name), - 'date': serializer.toJson(date), - 'videoPath': serializer.toJson(videoPath), - }; - } - - AnalysisSession copyWith({ - String? id, - String? name, - String? date, - Value videoPath = const Value.absent(), - }) => AnalysisSession( - id: id ?? this.id, - name: name ?? this.name, - date: date ?? this.date, - videoPath: videoPath.present ? videoPath.value : this.videoPath, - ); - AnalysisSession copyWithCompanion(AnalysisSessionsCompanion data) { - return AnalysisSession( - id: data.id.present ? data.id.value : this.id, - name: data.name.present ? data.name.value : this.name, - date: data.date.present ? data.date.value : this.date, - videoPath: data.videoPath.present ? data.videoPath.value : this.videoPath, - ); - } - - @override - String toString() { - return (StringBuffer('AnalysisSession(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('date: $date, ') - ..write('videoPath: $videoPath') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(id, name, date, videoPath); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is AnalysisSession && - other.id == this.id && - other.name == this.name && - other.date == this.date && - other.videoPath == this.videoPath); -} - -class AnalysisSessionsCompanion extends UpdateCompanion { - final Value id; - final Value name; - final Value date; - final Value videoPath; - final Value rowid; - const AnalysisSessionsCompanion({ - this.id = const Value.absent(), - this.name = const Value.absent(), - this.date = const Value.absent(), - this.videoPath = const Value.absent(), - this.rowid = const Value.absent(), - }); - AnalysisSessionsCompanion.insert({ - required String id, - required String name, - required String date, - this.videoPath = const Value.absent(), - this.rowid = const Value.absent(), - }) : id = Value(id), - name = Value(name), - date = Value(date); - static Insertable custom({ - Expression? id, - Expression? name, - Expression? date, - Expression? videoPath, - Expression? rowid, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (name != null) 'name': name, - if (date != null) 'date': date, - if (videoPath != null) 'video_path': videoPath, - if (rowid != null) 'rowid': rowid, - }); - } - - AnalysisSessionsCompanion copyWith({ - Value? id, - Value? name, - Value? date, - Value? videoPath, - Value? rowid, - }) { - return AnalysisSessionsCompanion( - id: id ?? this.id, - name: name ?? this.name, - date: date ?? this.date, - videoPath: videoPath ?? this.videoPath, - rowid: rowid ?? this.rowid, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (date.present) { - map['date'] = Variable(date.value); - } - if (videoPath.present) { - map['video_path'] = Variable(videoPath.value); - } - if (rowid.present) { - map['rowid'] = Variable(rowid.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AnalysisSessionsCompanion(') - ..write('id: $id, ') - ..write('name: $name, ') - ..write('date: $date, ') - ..write('videoPath: $videoPath, ') - ..write('rowid: $rowid') - ..write(')')) - .toString(); - } -} - -class $AnnotationsTable extends Annotations - with TableInfo<$AnnotationsTable, Annotation> { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - $AnnotationsTable(this.attachedDatabase, [this._alias]); - static const VerificationMeta _idMeta = const VerificationMeta('id'); - @override - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - static const VerificationMeta _sessionIdMeta = const VerificationMeta( - 'sessionId', - ); - @override - late final GeneratedColumn sessionId = GeneratedColumn( - 'session_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES analysis_sessions (id) ON DELETE CASCADE', - ), - ); - static const VerificationMeta _startTimeMeta = const VerificationMeta( - 'startTime', - ); - @override - late final GeneratedColumn startTime = GeneratedColumn( - 'start_time', - aliasedName, - false, - type: DriftSqlType.double, - requiredDuringInsert: true, - ); - static const VerificationMeta _endTimeMeta = const VerificationMeta( - 'endTime', - ); - @override - late final GeneratedColumn endTime = GeneratedColumn( - 'end_time', - aliasedName, - false, - type: DriftSqlType.double, - requiredDuringInsert: true, - ); - static const VerificationMeta _nameMeta = const VerificationMeta('name'); - @override - late final GeneratedColumn name = GeneratedColumn( - 'name', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - static const VerificationMeta _descriptionMeta = const VerificationMeta( - 'description', - ); - @override - late final GeneratedColumn description = GeneratedColumn( - 'description', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - static const VerificationMeta _colorMeta = const VerificationMeta('color'); - @override - late final GeneratedColumn color = GeneratedColumn( - 'color', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - @override - List get $columns => [ - id, - sessionId, - startTime, - endTime, - name, - description, - color, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'annotations'; - @override - VerificationContext validateIntegrity( - Insertable instance, { - bool isInserting = false, - }) { - final context = VerificationContext(); - final data = instance.toColumns(true); - if (data.containsKey('id')) { - context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); - } else if (isInserting) { - context.missing(_idMeta); - } - if (data.containsKey('session_id')) { - context.handle( - _sessionIdMeta, - sessionId.isAcceptableOrUnknown(data['session_id']!, _sessionIdMeta), - ); - } else if (isInserting) { - context.missing(_sessionIdMeta); - } - if (data.containsKey('start_time')) { - context.handle( - _startTimeMeta, - startTime.isAcceptableOrUnknown(data['start_time']!, _startTimeMeta), - ); - } else if (isInserting) { - context.missing(_startTimeMeta); - } - if (data.containsKey('end_time')) { - context.handle( - _endTimeMeta, - endTime.isAcceptableOrUnknown(data['end_time']!, _endTimeMeta), - ); - } else if (isInserting) { - context.missing(_endTimeMeta); - } - if (data.containsKey('name')) { - context.handle( - _nameMeta, - name.isAcceptableOrUnknown(data['name']!, _nameMeta), - ); - } - if (data.containsKey('description')) { - context.handle( - _descriptionMeta, - description.isAcceptableOrUnknown( - data['description']!, - _descriptionMeta, - ), - ); - } - if (data.containsKey('color')) { - context.handle( - _colorMeta, - color.isAcceptableOrUnknown(data['color']!, _colorMeta), - ); - } - return context; - } - - @override - Set get $primaryKey => {id}; - @override - Annotation map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return Annotation( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - sessionId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}session_id'], - )!, - startTime: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}start_time'], - )!, - endTime: attachedDatabase.typeMapping.read( - DriftSqlType.double, - data['${effectivePrefix}end_time'], - )!, - name: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}name'], - ), - description: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}description'], - ), - color: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}color'], - ), - ); - } - - @override - $AnnotationsTable createAlias(String alias) { - return $AnnotationsTable(attachedDatabase, alias); - } -} - -class Annotation extends DataClass implements Insertable { - final String id; - final String sessionId; - final double startTime; - final double endTime; - final String? name; - final String? description; - final String? color; - const Annotation({ - required this.id, - required this.sessionId, - required this.startTime, - required this.endTime, - this.name, - this.description, - this.color, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['session_id'] = Variable(sessionId); - map['start_time'] = Variable(startTime); - map['end_time'] = Variable(endTime); - if (!nullToAbsent || name != null) { - map['name'] = Variable(name); - } - if (!nullToAbsent || description != null) { - map['description'] = Variable(description); - } - if (!nullToAbsent || color != null) { - map['color'] = Variable(color); - } - return map; - } - - AnnotationsCompanion toCompanion(bool nullToAbsent) { - return AnnotationsCompanion( - id: Value(id), - sessionId: Value(sessionId), - startTime: Value(startTime), - endTime: Value(endTime), - name: name == null && nullToAbsent ? const Value.absent() : Value(name), - description: description == null && nullToAbsent - ? const Value.absent() - : Value(description), - color: color == null && nullToAbsent - ? const Value.absent() - : Value(color), - ); - } - - factory Annotation.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return Annotation( - id: serializer.fromJson(json['id']), - sessionId: serializer.fromJson(json['sessionId']), - startTime: serializer.fromJson(json['startTime']), - endTime: serializer.fromJson(json['endTime']), - name: serializer.fromJson(json['name']), - description: serializer.fromJson(json['description']), - color: serializer.fromJson(json['color']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'sessionId': serializer.toJson(sessionId), - 'startTime': serializer.toJson(startTime), - 'endTime': serializer.toJson(endTime), - 'name': serializer.toJson(name), - 'description': serializer.toJson(description), - 'color': serializer.toJson(color), - }; - } - - Annotation copyWith({ - String? id, - String? sessionId, - double? startTime, - double? endTime, - Value name = const Value.absent(), - Value description = const Value.absent(), - Value color = const Value.absent(), - }) => Annotation( - id: id ?? this.id, - sessionId: sessionId ?? this.sessionId, - startTime: startTime ?? this.startTime, - endTime: endTime ?? this.endTime, - name: name.present ? name.value : this.name, - description: description.present ? description.value : this.description, - color: color.present ? color.value : this.color, - ); - Annotation copyWithCompanion(AnnotationsCompanion data) { - return Annotation( - id: data.id.present ? data.id.value : this.id, - sessionId: data.sessionId.present ? data.sessionId.value : this.sessionId, - startTime: data.startTime.present ? data.startTime.value : this.startTime, - endTime: data.endTime.present ? data.endTime.value : this.endTime, - name: data.name.present ? data.name.value : this.name, - description: data.description.present - ? data.description.value - : this.description, - color: data.color.present ? data.color.value : this.color, - ); - } - - @override - String toString() { - return (StringBuffer('Annotation(') - ..write('id: $id, ') - ..write('sessionId: $sessionId, ') - ..write('startTime: $startTime, ') - ..write('endTime: $endTime, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('color: $color') - ..write(')')) - .toString(); - } - - @override - int get hashCode => - Object.hash(id, sessionId, startTime, endTime, name, description, color); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is Annotation && - other.id == this.id && - other.sessionId == this.sessionId && - other.startTime == this.startTime && - other.endTime == this.endTime && - other.name == this.name && - other.description == this.description && - other.color == this.color); -} - -class AnnotationsCompanion extends UpdateCompanion { - final Value id; - final Value sessionId; - final Value startTime; - final Value endTime; - final Value name; - final Value description; - final Value color; - final Value rowid; - const AnnotationsCompanion({ - this.id = const Value.absent(), - this.sessionId = const Value.absent(), - this.startTime = const Value.absent(), - this.endTime = const Value.absent(), - this.name = const Value.absent(), - this.description = const Value.absent(), - this.color = const Value.absent(), - this.rowid = const Value.absent(), - }); - AnnotationsCompanion.insert({ - required String id, - required String sessionId, - required double startTime, - required double endTime, - this.name = const Value.absent(), - this.description = const Value.absent(), - this.color = const Value.absent(), - this.rowid = const Value.absent(), - }) : id = Value(id), - sessionId = Value(sessionId), - startTime = Value(startTime), - endTime = Value(endTime); - static Insertable custom({ - Expression? id, - Expression? sessionId, - Expression? startTime, - Expression? endTime, - Expression? name, - Expression? description, - Expression? color, - Expression? rowid, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (sessionId != null) 'session_id': sessionId, - if (startTime != null) 'start_time': startTime, - if (endTime != null) 'end_time': endTime, - if (name != null) 'name': name, - if (description != null) 'description': description, - if (color != null) 'color': color, - if (rowid != null) 'rowid': rowid, - }); - } - - AnnotationsCompanion copyWith({ - Value? id, - Value? sessionId, - Value? startTime, - Value? endTime, - Value? name, - Value? description, - Value? color, - Value? rowid, - }) { - return AnnotationsCompanion( - id: id ?? this.id, - sessionId: sessionId ?? this.sessionId, - startTime: startTime ?? this.startTime, - endTime: endTime ?? this.endTime, - name: name ?? this.name, - description: description ?? this.description, - color: color ?? this.color, - rowid: rowid ?? this.rowid, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (sessionId.present) { - map['session_id'] = Variable(sessionId.value); - } - if (startTime.present) { - map['start_time'] = Variable(startTime.value); - } - if (endTime.present) { - map['end_time'] = Variable(endTime.value); - } - if (name.present) { - map['name'] = Variable(name.value); - } - if (description.present) { - map['description'] = Variable(description.value); - } - if (color.present) { - map['color'] = Variable(color.value); - } - if (rowid.present) { - map['rowid'] = Variable(rowid.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('AnnotationsCompanion(') - ..write('id: $id, ') - ..write('sessionId: $sessionId, ') - ..write('startTime: $startTime, ') - ..write('endTime: $endTime, ') - ..write('name: $name, ') - ..write('description: $description, ') - ..write('color: $color, ') - ..write('rowid: $rowid') - ..write(')')) - .toString(); - } -} - -class $ChatSessionsTable extends ChatSessions - with TableInfo<$ChatSessionsTable, ChatSession> { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - $ChatSessionsTable(this.attachedDatabase, [this._alias]); - static const VerificationMeta _idMeta = const VerificationMeta('id'); - @override - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - static const VerificationMeta _titleMeta = const VerificationMeta('title'); - @override - late final GeneratedColumn title = GeneratedColumn( - 'title', - aliasedName, - true, - type: DriftSqlType.string, - requiredDuringInsert: false, - ); - static const VerificationMeta _createdAtMeta = const VerificationMeta( - 'createdAt', - ); - @override - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - static const VerificationMeta _updatedAtMeta = const VerificationMeta( - 'updatedAt', - ); - @override - late final GeneratedColumn updatedAt = GeneratedColumn( - 'updated_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [id, title, createdAt, updatedAt]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'chat_sessions'; - @override - VerificationContext validateIntegrity( - Insertable instance, { - bool isInserting = false, - }) { - final context = VerificationContext(); - final data = instance.toColumns(true); - if (data.containsKey('id')) { - context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); - } else if (isInserting) { - context.missing(_idMeta); - } - if (data.containsKey('title')) { - context.handle( - _titleMeta, - title.isAcceptableOrUnknown(data['title']!, _titleMeta), - ); - } - if (data.containsKey('created_at')) { - context.handle( - _createdAtMeta, - createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta), - ); - } else if (isInserting) { - context.missing(_createdAtMeta); - } - if (data.containsKey('updated_at')) { - context.handle( - _updatedAtMeta, - updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta), - ); - } else if (isInserting) { - context.missing(_updatedAtMeta); - } - return context; - } - - @override - Set get $primaryKey => {id}; - @override - ChatSession map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return ChatSession( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - title: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}title'], - ), - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - updatedAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}updated_at'], - )!, - ); - } - - @override - $ChatSessionsTable createAlias(String alias) { - return $ChatSessionsTable(attachedDatabase, alias); - } -} - -class ChatSession extends DataClass implements Insertable { - final String id; - final String? title; - final String createdAt; - final String updatedAt; - const ChatSession({ - required this.id, - this.title, - required this.createdAt, - required this.updatedAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - if (!nullToAbsent || title != null) { - map['title'] = Variable(title); - } - map['created_at'] = Variable(createdAt); - map['updated_at'] = Variable(updatedAt); - return map; - } - - ChatSessionsCompanion toCompanion(bool nullToAbsent) { - return ChatSessionsCompanion( - id: Value(id), - title: title == null && nullToAbsent - ? const Value.absent() - : Value(title), - createdAt: Value(createdAt), - updatedAt: Value(updatedAt), - ); - } - - factory ChatSession.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return ChatSession( - id: serializer.fromJson(json['id']), - title: serializer.fromJson(json['title']), - createdAt: serializer.fromJson(json['createdAt']), - updatedAt: serializer.fromJson(json['updatedAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'title': serializer.toJson(title), - 'createdAt': serializer.toJson(createdAt), - 'updatedAt': serializer.toJson(updatedAt), - }; - } - - ChatSession copyWith({ - String? id, - Value title = const Value.absent(), - String? createdAt, - String? updatedAt, - }) => ChatSession( - id: id ?? this.id, - title: title.present ? title.value : this.title, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - ); - ChatSession copyWithCompanion(ChatSessionsCompanion data) { - return ChatSession( - id: data.id.present ? data.id.value : this.id, - title: data.title.present ? data.title.value : this.title, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, - ); - } - - @override - String toString() { - return (StringBuffer('ChatSession(') - ..write('id: $id, ') - ..write('title: $title, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(id, title, createdAt, updatedAt); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is ChatSession && - other.id == this.id && - other.title == this.title && - other.createdAt == this.createdAt && - other.updatedAt == this.updatedAt); -} - -class ChatSessionsCompanion extends UpdateCompanion { - final Value id; - final Value title; - final Value createdAt; - final Value updatedAt; - final Value rowid; - const ChatSessionsCompanion({ - this.id = const Value.absent(), - this.title = const Value.absent(), - this.createdAt = const Value.absent(), - this.updatedAt = const Value.absent(), - this.rowid = const Value.absent(), - }); - ChatSessionsCompanion.insert({ - required String id, - this.title = const Value.absent(), - required String createdAt, - required String updatedAt, - this.rowid = const Value.absent(), - }) : id = Value(id), - createdAt = Value(createdAt), - updatedAt = Value(updatedAt); - static Insertable custom({ - Expression? id, - Expression? title, - Expression? createdAt, - Expression? updatedAt, - Expression? rowid, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (title != null) 'title': title, - if (createdAt != null) 'created_at': createdAt, - if (updatedAt != null) 'updated_at': updatedAt, - if (rowid != null) 'rowid': rowid, - }); - } - - ChatSessionsCompanion copyWith({ - Value? id, - Value? title, - Value? createdAt, - Value? updatedAt, - Value? rowid, - }) { - return ChatSessionsCompanion( - id: id ?? this.id, - title: title ?? this.title, - createdAt: createdAt ?? this.createdAt, - updatedAt: updatedAt ?? this.updatedAt, - rowid: rowid ?? this.rowid, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (title.present) { - map['title'] = Variable(title.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (updatedAt.present) { - map['updated_at'] = Variable(updatedAt.value); - } - if (rowid.present) { - map['rowid'] = Variable(rowid.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('ChatSessionsCompanion(') - ..write('id: $id, ') - ..write('title: $title, ') - ..write('createdAt: $createdAt, ') - ..write('updatedAt: $updatedAt, ') - ..write('rowid: $rowid') - ..write(')')) - .toString(); - } -} - -class $ChatMessagesTable extends ChatMessages - with TableInfo<$ChatMessagesTable, ChatMessage> { - @override - final GeneratedDatabase attachedDatabase; - final String? _alias; - $ChatMessagesTable(this.attachedDatabase, [this._alias]); - static const VerificationMeta _idMeta = const VerificationMeta('id'); - @override - late final GeneratedColumn id = GeneratedColumn( - 'id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - static const VerificationMeta _sessionIdMeta = const VerificationMeta( - 'sessionId', - ); - @override - late final GeneratedColumn sessionId = GeneratedColumn( - 'session_id', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - defaultConstraints: GeneratedColumn.constraintIsAlways( - 'REFERENCES chat_sessions (id) ON DELETE CASCADE', - ), - ); - static const VerificationMeta _roleMeta = const VerificationMeta('role'); - @override - late final GeneratedColumn role = GeneratedColumn( - 'role', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - static const VerificationMeta _contentMeta = const VerificationMeta( - 'content', - ); - @override - late final GeneratedColumn content = GeneratedColumn( - 'content', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - static const VerificationMeta _createdAtMeta = const VerificationMeta( - 'createdAt', - ); - @override - late final GeneratedColumn createdAt = GeneratedColumn( - 'created_at', - aliasedName, - false, - type: DriftSqlType.string, - requiredDuringInsert: true, - ); - @override - List get $columns => [ - id, - sessionId, - role, - content, - createdAt, - ]; - @override - String get aliasedName => _alias ?? actualTableName; - @override - String get actualTableName => $name; - static const String $name = 'chat_messages'; - @override - VerificationContext validateIntegrity( - Insertable instance, { - bool isInserting = false, - }) { - final context = VerificationContext(); - final data = instance.toColumns(true); - if (data.containsKey('id')) { - context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); - } else if (isInserting) { - context.missing(_idMeta); - } - if (data.containsKey('session_id')) { - context.handle( - _sessionIdMeta, - sessionId.isAcceptableOrUnknown(data['session_id']!, _sessionIdMeta), - ); - } else if (isInserting) { - context.missing(_sessionIdMeta); - } - if (data.containsKey('role')) { - context.handle( - _roleMeta, - role.isAcceptableOrUnknown(data['role']!, _roleMeta), - ); - } else if (isInserting) { - context.missing(_roleMeta); - } - if (data.containsKey('content')) { - context.handle( - _contentMeta, - content.isAcceptableOrUnknown(data['content']!, _contentMeta), - ); - } else if (isInserting) { - context.missing(_contentMeta); - } - if (data.containsKey('created_at')) { - context.handle( - _createdAtMeta, - createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta), - ); - } else if (isInserting) { - context.missing(_createdAtMeta); - } - return context; - } - - @override - Set get $primaryKey => {id}; - @override - ChatMessage map(Map data, {String? tablePrefix}) { - final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; - return ChatMessage( - id: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}id'], - )!, - sessionId: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}session_id'], - )!, - role: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}role'], - )!, - content: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}content'], - )!, - createdAt: attachedDatabase.typeMapping.read( - DriftSqlType.string, - data['${effectivePrefix}created_at'], - )!, - ); - } - - @override - $ChatMessagesTable createAlias(String alias) { - return $ChatMessagesTable(attachedDatabase, alias); - } -} - -class ChatMessage extends DataClass implements Insertable { - final String id; - final String sessionId; - final String role; - final String content; - final String createdAt; - const ChatMessage({ - required this.id, - required this.sessionId, - required this.role, - required this.content, - required this.createdAt, - }); - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - map['id'] = Variable(id); - map['session_id'] = Variable(sessionId); - map['role'] = Variable(role); - map['content'] = Variable(content); - map['created_at'] = Variable(createdAt); - return map; - } - - ChatMessagesCompanion toCompanion(bool nullToAbsent) { - return ChatMessagesCompanion( - id: Value(id), - sessionId: Value(sessionId), - role: Value(role), - content: Value(content), - createdAt: Value(createdAt), - ); - } - - factory ChatMessage.fromJson( - Map json, { - ValueSerializer? serializer, - }) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return ChatMessage( - id: serializer.fromJson(json['id']), - sessionId: serializer.fromJson(json['sessionId']), - role: serializer.fromJson(json['role']), - content: serializer.fromJson(json['content']), - createdAt: serializer.fromJson(json['createdAt']), - ); - } - @override - Map toJson({ValueSerializer? serializer}) { - serializer ??= driftRuntimeOptions.defaultSerializer; - return { - 'id': serializer.toJson(id), - 'sessionId': serializer.toJson(sessionId), - 'role': serializer.toJson(role), - 'content': serializer.toJson(content), - 'createdAt': serializer.toJson(createdAt), - }; - } - - ChatMessage copyWith({ - String? id, - String? sessionId, - String? role, - String? content, - String? createdAt, - }) => ChatMessage( - id: id ?? this.id, - sessionId: sessionId ?? this.sessionId, - role: role ?? this.role, - content: content ?? this.content, - createdAt: createdAt ?? this.createdAt, - ); - ChatMessage copyWithCompanion(ChatMessagesCompanion data) { - return ChatMessage( - id: data.id.present ? data.id.value : this.id, - sessionId: data.sessionId.present ? data.sessionId.value : this.sessionId, - role: data.role.present ? data.role.value : this.role, - content: data.content.present ? data.content.value : this.content, - createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, - ); - } - - @override - String toString() { - return (StringBuffer('ChatMessage(') - ..write('id: $id, ') - ..write('sessionId: $sessionId, ') - ..write('role: $role, ') - ..write('content: $content, ') - ..write('createdAt: $createdAt') - ..write(')')) - .toString(); - } - - @override - int get hashCode => Object.hash(id, sessionId, role, content, createdAt); - @override - bool operator ==(Object other) => - identical(this, other) || - (other is ChatMessage && - other.id == this.id && - other.sessionId == this.sessionId && - other.role == this.role && - other.content == this.content && - other.createdAt == this.createdAt); -} - -class ChatMessagesCompanion extends UpdateCompanion { - final Value id; - final Value sessionId; - final Value role; - final Value content; - final Value createdAt; - final Value rowid; - const ChatMessagesCompanion({ - this.id = const Value.absent(), - this.sessionId = const Value.absent(), - this.role = const Value.absent(), - this.content = const Value.absent(), - this.createdAt = const Value.absent(), - this.rowid = const Value.absent(), - }); - ChatMessagesCompanion.insert({ - required String id, - required String sessionId, - required String role, - required String content, - required String createdAt, - this.rowid = const Value.absent(), - }) : id = Value(id), - sessionId = Value(sessionId), - role = Value(role), - content = Value(content), - createdAt = Value(createdAt); - static Insertable custom({ - Expression? id, - Expression? sessionId, - Expression? role, - Expression? content, - Expression? createdAt, - Expression? rowid, - }) { - return RawValuesInsertable({ - if (id != null) 'id': id, - if (sessionId != null) 'session_id': sessionId, - if (role != null) 'role': role, - if (content != null) 'content': content, - if (createdAt != null) 'created_at': createdAt, - if (rowid != null) 'rowid': rowid, - }); - } - - ChatMessagesCompanion copyWith({ - Value? id, - Value? sessionId, - Value? role, - Value? content, - Value? createdAt, - Value? rowid, - }) { - return ChatMessagesCompanion( - id: id ?? this.id, - sessionId: sessionId ?? this.sessionId, - role: role ?? this.role, - content: content ?? this.content, - createdAt: createdAt ?? this.createdAt, - rowid: rowid ?? this.rowid, - ); - } - - @override - Map toColumns(bool nullToAbsent) { - final map = {}; - if (id.present) { - map['id'] = Variable(id.value); - } - if (sessionId.present) { - map['session_id'] = Variable(sessionId.value); - } - if (role.present) { - map['role'] = Variable(role.value); - } - if (content.present) { - map['content'] = Variable(content.value); - } - if (createdAt.present) { - map['created_at'] = Variable(createdAt.value); - } - if (rowid.present) { - map['rowid'] = Variable(rowid.value); - } - return map; - } - - @override - String toString() { - return (StringBuffer('ChatMessagesCompanion(') - ..write('id: $id, ') - ..write('sessionId: $sessionId, ') - ..write('role: $role, ') - ..write('content: $content, ') - ..write('createdAt: $createdAt, ') - ..write('rowid: $rowid') - ..write(')')) - .toString(); - } -} - -abstract class _$AppDatabase extends GeneratedDatabase { - _$AppDatabase(QueryExecutor e) : super(e); - $AppDatabaseManager get managers => $AppDatabaseManager(this); - late final $ExercisesTable exercises = $ExercisesTable(this); - late final $TrainingPlansTable trainingPlans = $TrainingPlansTable(this); - late final $ProgramsTable programs = $ProgramsTable(this); - late final $ProgramWeeksTable programWeeks = $ProgramWeeksTable(this); - late final $ProgramWorkoutsTable programWorkouts = $ProgramWorkoutsTable( - this, - ); - late final $AnalysisSessionsTable analysisSessions = $AnalysisSessionsTable( - this, - ); - late final $AnnotationsTable annotations = $AnnotationsTable(this); - late final $ChatSessionsTable chatSessions = $ChatSessionsTable(this); - late final $ChatMessagesTable chatMessages = $ChatMessagesTable(this); - @override - Iterable> get allTables => - allSchemaEntities.whereType>(); - @override - List get allSchemaEntities => [ - exercises, - trainingPlans, - programs, - programWeeks, - programWorkouts, - analysisSessions, - annotations, - chatSessions, - chatMessages, - ]; - @override - StreamQueryUpdateRules get streamUpdateRules => const StreamQueryUpdateRules([ - WritePropagation( - on: TableUpdateQuery.onTableName( - 'programs', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('program_weeks', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'program_weeks', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('program_workouts', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'programs', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('program_workouts', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'analysis_sessions', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('annotations', kind: UpdateKind.delete)], - ), - WritePropagation( - on: TableUpdateQuery.onTableName( - 'chat_sessions', - limitUpdateKind: UpdateKind.delete, - ), - result: [TableUpdate('chat_messages', kind: UpdateKind.delete)], - ), - ]); -} - -typedef $$ExercisesTableCreateCompanionBuilder = - ExercisesCompanion Function({ - required String id, - required String name, - Value instructions, - Value enrichment, - Value tags, - Value videoUrl, - Value rowid, - }); -typedef $$ExercisesTableUpdateCompanionBuilder = - ExercisesCompanion Function({ - Value id, - Value name, - Value instructions, - Value enrichment, - Value tags, - Value videoUrl, - Value rowid, - }); - -class $$ExercisesTableFilterComposer - extends Composer<_$AppDatabase, $ExercisesTable> { - $$ExercisesTableFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnFilters get id => $composableBuilder( - column: $table.id, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get name => $composableBuilder( - column: $table.name, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get instructions => $composableBuilder( - column: $table.instructions, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get enrichment => $composableBuilder( - column: $table.enrichment, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get tags => $composableBuilder( - column: $table.tags, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get videoUrl => $composableBuilder( - column: $table.videoUrl, - builder: (column) => ColumnFilters(column), - ); -} - -class $$ExercisesTableOrderingComposer - extends Composer<_$AppDatabase, $ExercisesTable> { - $$ExercisesTableOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnOrderings get id => $composableBuilder( - column: $table.id, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get name => $composableBuilder( - column: $table.name, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get instructions => $composableBuilder( - column: $table.instructions, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get enrichment => $composableBuilder( - column: $table.enrichment, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get tags => $composableBuilder( - column: $table.tags, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get videoUrl => $composableBuilder( - column: $table.videoUrl, - builder: (column) => ColumnOrderings(column), - ); -} - -class $$ExercisesTableAnnotationComposer - extends Composer<_$AppDatabase, $ExercisesTable> { - $$ExercisesTableAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); - - GeneratedColumn get name => - $composableBuilder(column: $table.name, builder: (column) => column); - - GeneratedColumn get instructions => $composableBuilder( - column: $table.instructions, - builder: (column) => column, - ); - - GeneratedColumn get enrichment => $composableBuilder( - column: $table.enrichment, - builder: (column) => column, - ); - - GeneratedColumn get tags => - $composableBuilder(column: $table.tags, builder: (column) => column); - - GeneratedColumn get videoUrl => - $composableBuilder(column: $table.videoUrl, builder: (column) => column); -} - -class $$ExercisesTableTableManager - extends - RootTableManager< - _$AppDatabase, - $ExercisesTable, - Exercise, - $$ExercisesTableFilterComposer, - $$ExercisesTableOrderingComposer, - $$ExercisesTableAnnotationComposer, - $$ExercisesTableCreateCompanionBuilder, - $$ExercisesTableUpdateCompanionBuilder, - (Exercise, BaseReferences<_$AppDatabase, $ExercisesTable, Exercise>), - Exercise, - PrefetchHooks Function() - > { - $$ExercisesTableTableManager(_$AppDatabase db, $ExercisesTable table) - : super( - TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - $$ExercisesTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $$ExercisesTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $$ExercisesTableAnnotationComposer($db: db, $table: table), - updateCompanionCallback: - ({ - Value id = const Value.absent(), - Value name = const Value.absent(), - Value instructions = const Value.absent(), - Value enrichment = const Value.absent(), - Value tags = const Value.absent(), - Value videoUrl = const Value.absent(), - Value rowid = const Value.absent(), - }) => ExercisesCompanion( - id: id, - name: name, - instructions: instructions, - enrichment: enrichment, - tags: tags, - videoUrl: videoUrl, - rowid: rowid, - ), - createCompanionCallback: - ({ - required String id, - required String name, - Value instructions = const Value.absent(), - Value enrichment = const Value.absent(), - Value tags = const Value.absent(), - Value videoUrl = const Value.absent(), - Value rowid = const Value.absent(), - }) => ExercisesCompanion.insert( - id: id, - name: name, - instructions: instructions, - enrichment: enrichment, - tags: tags, - videoUrl: videoUrl, - rowid: rowid, - ), - withReferenceMapper: (p0) => p0 - .map((e) => (e.readTable(table), BaseReferences(db, table, e))) - .toList(), - prefetchHooksCallback: null, - ), - ); -} - -typedef $$ExercisesTableProcessedTableManager = - ProcessedTableManager< - _$AppDatabase, - $ExercisesTable, - Exercise, - $$ExercisesTableFilterComposer, - $$ExercisesTableOrderingComposer, - $$ExercisesTableAnnotationComposer, - $$ExercisesTableCreateCompanionBuilder, - $$ExercisesTableUpdateCompanionBuilder, - (Exercise, BaseReferences<_$AppDatabase, $ExercisesTable, Exercise>), - Exercise, - PrefetchHooks Function() - >; -typedef $$TrainingPlansTableCreateCompanionBuilder = - TrainingPlansCompanion Function({ - required String id, - required String name, - Value sections, - Value rowid, - }); -typedef $$TrainingPlansTableUpdateCompanionBuilder = - TrainingPlansCompanion Function({ - Value id, - Value name, - Value sections, - Value rowid, - }); - -class $$TrainingPlansTableFilterComposer - extends Composer<_$AppDatabase, $TrainingPlansTable> { - $$TrainingPlansTableFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnFilters get id => $composableBuilder( - column: $table.id, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get name => $composableBuilder( - column: $table.name, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get sections => $composableBuilder( - column: $table.sections, - builder: (column) => ColumnFilters(column), - ); -} - -class $$TrainingPlansTableOrderingComposer - extends Composer<_$AppDatabase, $TrainingPlansTable> { - $$TrainingPlansTableOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnOrderings get id => $composableBuilder( - column: $table.id, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get name => $composableBuilder( - column: $table.name, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get sections => $composableBuilder( - column: $table.sections, - builder: (column) => ColumnOrderings(column), - ); -} - -class $$TrainingPlansTableAnnotationComposer - extends Composer<_$AppDatabase, $TrainingPlansTable> { - $$TrainingPlansTableAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); - - GeneratedColumn get name => - $composableBuilder(column: $table.name, builder: (column) => column); - - GeneratedColumn get sections => - $composableBuilder(column: $table.sections, builder: (column) => column); -} - -class $$TrainingPlansTableTableManager - extends - RootTableManager< - _$AppDatabase, - $TrainingPlansTable, - TrainingPlan, - $$TrainingPlansTableFilterComposer, - $$TrainingPlansTableOrderingComposer, - $$TrainingPlansTableAnnotationComposer, - $$TrainingPlansTableCreateCompanionBuilder, - $$TrainingPlansTableUpdateCompanionBuilder, - ( - TrainingPlan, - BaseReferences<_$AppDatabase, $TrainingPlansTable, TrainingPlan>, - ), - TrainingPlan, - PrefetchHooks Function() - > { - $$TrainingPlansTableTableManager(_$AppDatabase db, $TrainingPlansTable table) - : super( - TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - $$TrainingPlansTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $$TrainingPlansTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $$TrainingPlansTableAnnotationComposer($db: db, $table: table), - updateCompanionCallback: - ({ - Value id = const Value.absent(), - Value name = const Value.absent(), - Value sections = const Value.absent(), - Value rowid = const Value.absent(), - }) => TrainingPlansCompanion( - id: id, - name: name, - sections: sections, - rowid: rowid, - ), - createCompanionCallback: - ({ - required String id, - required String name, - Value sections = const Value.absent(), - Value rowid = const Value.absent(), - }) => TrainingPlansCompanion.insert( - id: id, - name: name, - sections: sections, - rowid: rowid, - ), - withReferenceMapper: (p0) => p0 - .map((e) => (e.readTable(table), BaseReferences(db, table, e))) - .toList(), - prefetchHooksCallback: null, - ), - ); -} - -typedef $$TrainingPlansTableProcessedTableManager = - ProcessedTableManager< - _$AppDatabase, - $TrainingPlansTable, - TrainingPlan, - $$TrainingPlansTableFilterComposer, - $$TrainingPlansTableOrderingComposer, - $$TrainingPlansTableAnnotationComposer, - $$TrainingPlansTableCreateCompanionBuilder, - $$TrainingPlansTableUpdateCompanionBuilder, - ( - TrainingPlan, - BaseReferences<_$AppDatabase, $TrainingPlansTable, TrainingPlan>, - ), - TrainingPlan, - PrefetchHooks Function() - >; -typedef $$ProgramsTableCreateCompanionBuilder = - ProgramsCompanion Function({ - required String id, - required String name, - required String createdAt, - Value rowid, - }); -typedef $$ProgramsTableUpdateCompanionBuilder = - ProgramsCompanion Function({ - Value id, - Value name, - Value createdAt, - Value rowid, - }); - -final class $$ProgramsTableReferences - extends BaseReferences<_$AppDatabase, $ProgramsTable, Program> { - $$ProgramsTableReferences(super.$_db, super.$_table, super.$_typedResult); - - static MultiTypedResultKey<$ProgramWeeksTable, List> - _programWeeksRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable( - db.programWeeks, - aliasName: $_aliasNameGenerator(db.programs.id, db.programWeeks.programId), - ); - - $$ProgramWeeksTableProcessedTableManager get programWeeksRefs { - final manager = $$ProgramWeeksTableTableManager( - $_db, - $_db.programWeeks, - ).filter((f) => f.programId.id.sqlEquals($_itemColumn('id')!)); - - final cache = $_typedResult.readTableOrNull(_programWeeksRefsTable($_db)); - return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: cache), - ); - } - - static MultiTypedResultKey<$ProgramWorkoutsTable, List> - _programWorkoutsRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable( - db.programWorkouts, - aliasName: $_aliasNameGenerator( - db.programs.id, - db.programWorkouts.programId, - ), - ); - - $$ProgramWorkoutsTableProcessedTableManager get programWorkoutsRefs { - final manager = $$ProgramWorkoutsTableTableManager( - $_db, - $_db.programWorkouts, - ).filter((f) => f.programId.id.sqlEquals($_itemColumn('id')!)); - - final cache = $_typedResult.readTableOrNull( - _programWorkoutsRefsTable($_db), - ); - return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: cache), - ); - } -} - -class $$ProgramsTableFilterComposer - extends Composer<_$AppDatabase, $ProgramsTable> { - $$ProgramsTableFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnFilters get id => $composableBuilder( - column: $table.id, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get name => $composableBuilder( - column: $table.name, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get createdAt => $composableBuilder( - column: $table.createdAt, - builder: (column) => ColumnFilters(column), - ); - - Expression programWeeksRefs( - Expression Function($$ProgramWeeksTableFilterComposer f) f, - ) { - final $$ProgramWeeksTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.programWeeks, - getReferencedColumn: (t) => t.programId, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $$ProgramWeeksTableFilterComposer( - $db: $db, - $table: $db.programWeeks, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return f(composer); - } - - Expression programWorkoutsRefs( - Expression Function($$ProgramWorkoutsTableFilterComposer f) f, - ) { - final $$ProgramWorkoutsTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.programWorkouts, - getReferencedColumn: (t) => t.programId, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $$ProgramWorkoutsTableFilterComposer( - $db: $db, - $table: $db.programWorkouts, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return f(composer); - } -} - -class $$ProgramsTableOrderingComposer - extends Composer<_$AppDatabase, $ProgramsTable> { - $$ProgramsTableOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnOrderings get id => $composableBuilder( - column: $table.id, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get name => $composableBuilder( - column: $table.name, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get createdAt => $composableBuilder( - column: $table.createdAt, - builder: (column) => ColumnOrderings(column), - ); -} - -class $$ProgramsTableAnnotationComposer - extends Composer<_$AppDatabase, $ProgramsTable> { - $$ProgramsTableAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); - - GeneratedColumn get name => - $composableBuilder(column: $table.name, builder: (column) => column); - - GeneratedColumn get createdAt => - $composableBuilder(column: $table.createdAt, builder: (column) => column); - - Expression programWeeksRefs( - Expression Function($$ProgramWeeksTableAnnotationComposer a) f, - ) { - final $$ProgramWeeksTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.programWeeks, - getReferencedColumn: (t) => t.programId, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $$ProgramWeeksTableAnnotationComposer( - $db: $db, - $table: $db.programWeeks, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return f(composer); - } - - Expression programWorkoutsRefs( - Expression Function($$ProgramWorkoutsTableAnnotationComposer a) f, - ) { - final $$ProgramWorkoutsTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.programWorkouts, - getReferencedColumn: (t) => t.programId, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $$ProgramWorkoutsTableAnnotationComposer( - $db: $db, - $table: $db.programWorkouts, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return f(composer); - } -} - -class $$ProgramsTableTableManager - extends - RootTableManager< - _$AppDatabase, - $ProgramsTable, - Program, - $$ProgramsTableFilterComposer, - $$ProgramsTableOrderingComposer, - $$ProgramsTableAnnotationComposer, - $$ProgramsTableCreateCompanionBuilder, - $$ProgramsTableUpdateCompanionBuilder, - (Program, $$ProgramsTableReferences), - Program, - PrefetchHooks Function({ - bool programWeeksRefs, - bool programWorkoutsRefs, - }) - > { - $$ProgramsTableTableManager(_$AppDatabase db, $ProgramsTable table) - : super( - TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - $$ProgramsTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $$ProgramsTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $$ProgramsTableAnnotationComposer($db: db, $table: table), - updateCompanionCallback: - ({ - Value id = const Value.absent(), - Value name = const Value.absent(), - Value createdAt = const Value.absent(), - Value rowid = const Value.absent(), - }) => ProgramsCompanion( - id: id, - name: name, - createdAt: createdAt, - rowid: rowid, - ), - createCompanionCallback: - ({ - required String id, - required String name, - required String createdAt, - Value rowid = const Value.absent(), - }) => ProgramsCompanion.insert( - id: id, - name: name, - createdAt: createdAt, - rowid: rowid, - ), - withReferenceMapper: (p0) => p0 - .map( - (e) => ( - e.readTable(table), - $$ProgramsTableReferences(db, table, e), - ), - ) - .toList(), - prefetchHooksCallback: - ({programWeeksRefs = false, programWorkoutsRefs = false}) { - return PrefetchHooks( - db: db, - explicitlyWatchedTables: [ - if (programWeeksRefs) db.programWeeks, - if (programWorkoutsRefs) db.programWorkouts, - ], - addJoins: null, - getPrefetchedDataCallback: (items) async { - return [ - if (programWeeksRefs) - await $_getPrefetchedData< - Program, - $ProgramsTable, - ProgramWeek - >( - currentTable: table, - referencedTable: $$ProgramsTableReferences - ._programWeeksRefsTable(db), - managerFromTypedResult: (p0) => - $$ProgramsTableReferences( - db, - table, - p0, - ).programWeeksRefs, - referencedItemsForCurrentItem: - (item, referencedItems) => referencedItems.where( - (e) => e.programId == item.id, - ), - typedResults: items, - ), - if (programWorkoutsRefs) - await $_getPrefetchedData< - Program, - $ProgramsTable, - ProgramWorkout - >( - currentTable: table, - referencedTable: $$ProgramsTableReferences - ._programWorkoutsRefsTable(db), - managerFromTypedResult: (p0) => - $$ProgramsTableReferences( - db, - table, - p0, - ).programWorkoutsRefs, - referencedItemsForCurrentItem: - (item, referencedItems) => referencedItems.where( - (e) => e.programId == item.id, - ), - typedResults: items, - ), - ]; - }, - ); - }, - ), - ); -} - -typedef $$ProgramsTableProcessedTableManager = - ProcessedTableManager< - _$AppDatabase, - $ProgramsTable, - Program, - $$ProgramsTableFilterComposer, - $$ProgramsTableOrderingComposer, - $$ProgramsTableAnnotationComposer, - $$ProgramsTableCreateCompanionBuilder, - $$ProgramsTableUpdateCompanionBuilder, - (Program, $$ProgramsTableReferences), - Program, - PrefetchHooks Function({bool programWeeksRefs, bool programWorkoutsRefs}) - >; -typedef $$ProgramWeeksTableCreateCompanionBuilder = - ProgramWeeksCompanion Function({ - required String id, - required String programId, - required int position, - Value notes, - Value rowid, - }); -typedef $$ProgramWeeksTableUpdateCompanionBuilder = - ProgramWeeksCompanion Function({ - Value id, - Value programId, - Value position, - Value notes, - Value rowid, - }); - -final class $$ProgramWeeksTableReferences - extends BaseReferences<_$AppDatabase, $ProgramWeeksTable, ProgramWeek> { - $$ProgramWeeksTableReferences(super.$_db, super.$_table, super.$_typedResult); - - static $ProgramsTable _programIdTable(_$AppDatabase db) => - db.programs.createAlias( - $_aliasNameGenerator(db.programWeeks.programId, db.programs.id), - ); - - $$ProgramsTableProcessedTableManager get programId { - final $_column = $_itemColumn('program_id')!; - - final manager = $$ProgramsTableTableManager( - $_db, - $_db.programs, - ).filter((f) => f.id.sqlEquals($_column)); - final item = $_typedResult.readTableOrNull(_programIdTable($_db)); - if (item == null) return manager; - return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item]), - ); - } - - static MultiTypedResultKey<$ProgramWorkoutsTable, List> - _programWorkoutsRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable( - db.programWorkouts, - aliasName: $_aliasNameGenerator( - db.programWeeks.id, - db.programWorkouts.weekId, - ), - ); - - $$ProgramWorkoutsTableProcessedTableManager get programWorkoutsRefs { - final manager = $$ProgramWorkoutsTableTableManager( - $_db, - $_db.programWorkouts, - ).filter((f) => f.weekId.id.sqlEquals($_itemColumn('id')!)); - - final cache = $_typedResult.readTableOrNull( - _programWorkoutsRefsTable($_db), - ); - return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: cache), - ); - } -} - -class $$ProgramWeeksTableFilterComposer - extends Composer<_$AppDatabase, $ProgramWeeksTable> { - $$ProgramWeeksTableFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnFilters get id => $composableBuilder( - column: $table.id, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get position => $composableBuilder( - column: $table.position, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get notes => $composableBuilder( - column: $table.notes, - builder: (column) => ColumnFilters(column), - ); - - $$ProgramsTableFilterComposer get programId { - final $$ProgramsTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.programId, - referencedTable: $db.programs, - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $$ProgramsTableFilterComposer( - $db: $db, - $table: $db.programs, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } - - Expression programWorkoutsRefs( - Expression Function($$ProgramWorkoutsTableFilterComposer f) f, - ) { - final $$ProgramWorkoutsTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.programWorkouts, - getReferencedColumn: (t) => t.weekId, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $$ProgramWorkoutsTableFilterComposer( - $db: $db, - $table: $db.programWorkouts, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return f(composer); - } -} - -class $$ProgramWeeksTableOrderingComposer - extends Composer<_$AppDatabase, $ProgramWeeksTable> { - $$ProgramWeeksTableOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnOrderings get id => $composableBuilder( - column: $table.id, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get position => $composableBuilder( - column: $table.position, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get notes => $composableBuilder( - column: $table.notes, - builder: (column) => ColumnOrderings(column), - ); - - $$ProgramsTableOrderingComposer get programId { - final $$ProgramsTableOrderingComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.programId, - referencedTable: $db.programs, - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $$ProgramsTableOrderingComposer( - $db: $db, - $table: $db.programs, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$ProgramWeeksTableAnnotationComposer - extends Composer<_$AppDatabase, $ProgramWeeksTable> { - $$ProgramWeeksTableAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); - - GeneratedColumn get position => - $composableBuilder(column: $table.position, builder: (column) => column); - - GeneratedColumn get notes => - $composableBuilder(column: $table.notes, builder: (column) => column); - - $$ProgramsTableAnnotationComposer get programId { - final $$ProgramsTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.programId, - referencedTable: $db.programs, - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $$ProgramsTableAnnotationComposer( - $db: $db, - $table: $db.programs, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } - - Expression programWorkoutsRefs( - Expression Function($$ProgramWorkoutsTableAnnotationComposer a) f, - ) { - final $$ProgramWorkoutsTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.programWorkouts, - getReferencedColumn: (t) => t.weekId, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $$ProgramWorkoutsTableAnnotationComposer( - $db: $db, - $table: $db.programWorkouts, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return f(composer); - } -} - -class $$ProgramWeeksTableTableManager - extends - RootTableManager< - _$AppDatabase, - $ProgramWeeksTable, - ProgramWeek, - $$ProgramWeeksTableFilterComposer, - $$ProgramWeeksTableOrderingComposer, - $$ProgramWeeksTableAnnotationComposer, - $$ProgramWeeksTableCreateCompanionBuilder, - $$ProgramWeeksTableUpdateCompanionBuilder, - (ProgramWeek, $$ProgramWeeksTableReferences), - ProgramWeek, - PrefetchHooks Function({bool programId, bool programWorkoutsRefs}) - > { - $$ProgramWeeksTableTableManager(_$AppDatabase db, $ProgramWeeksTable table) - : super( - TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - $$ProgramWeeksTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $$ProgramWeeksTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $$ProgramWeeksTableAnnotationComposer($db: db, $table: table), - updateCompanionCallback: - ({ - Value id = const Value.absent(), - Value programId = const Value.absent(), - Value position = const Value.absent(), - Value notes = const Value.absent(), - Value rowid = const Value.absent(), - }) => ProgramWeeksCompanion( - id: id, - programId: programId, - position: position, - notes: notes, - rowid: rowid, - ), - createCompanionCallback: - ({ - required String id, - required String programId, - required int position, - Value notes = const Value.absent(), - Value rowid = const Value.absent(), - }) => ProgramWeeksCompanion.insert( - id: id, - programId: programId, - position: position, - notes: notes, - rowid: rowid, - ), - withReferenceMapper: (p0) => p0 - .map( - (e) => ( - e.readTable(table), - $$ProgramWeeksTableReferences(db, table, e), - ), - ) - .toList(), - prefetchHooksCallback: - ({programId = false, programWorkoutsRefs = false}) { - return PrefetchHooks( - db: db, - explicitlyWatchedTables: [ - if (programWorkoutsRefs) db.programWorkouts, - ], - addJoins: - < - T extends TableManagerState< - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic - > - >(state) { - if (programId) { - state = - state.withJoin( - currentTable: table, - currentColumn: table.programId, - referencedTable: - $$ProgramWeeksTableReferences - ._programIdTable(db), - referencedColumn: - $$ProgramWeeksTableReferences - ._programIdTable(db) - .id, - ) - as T; - } - - return state; - }, - getPrefetchedDataCallback: (items) async { - return [ - if (programWorkoutsRefs) - await $_getPrefetchedData< - ProgramWeek, - $ProgramWeeksTable, - ProgramWorkout - >( - currentTable: table, - referencedTable: $$ProgramWeeksTableReferences - ._programWorkoutsRefsTable(db), - managerFromTypedResult: (p0) => - $$ProgramWeeksTableReferences( - db, - table, - p0, - ).programWorkoutsRefs, - referencedItemsForCurrentItem: - (item, referencedItems) => referencedItems.where( - (e) => e.weekId == item.id, - ), - typedResults: items, - ), - ]; - }, - ); - }, - ), - ); -} - -typedef $$ProgramWeeksTableProcessedTableManager = - ProcessedTableManager< - _$AppDatabase, - $ProgramWeeksTable, - ProgramWeek, - $$ProgramWeeksTableFilterComposer, - $$ProgramWeeksTableOrderingComposer, - $$ProgramWeeksTableAnnotationComposer, - $$ProgramWeeksTableCreateCompanionBuilder, - $$ProgramWeeksTableUpdateCompanionBuilder, - (ProgramWeek, $$ProgramWeeksTableReferences), - ProgramWeek, - PrefetchHooks Function({bool programId, bool programWorkoutsRefs}) - >; -typedef $$ProgramWorkoutsTableCreateCompanionBuilder = - ProgramWorkoutsCompanion Function({ - required String id, - required String weekId, - required String programId, - required String day, - required String type, - Value refId, - Value name, - Value description, - Value completed, - Value rowid, - }); -typedef $$ProgramWorkoutsTableUpdateCompanionBuilder = - ProgramWorkoutsCompanion Function({ - Value id, - Value weekId, - Value programId, - Value day, - Value type, - Value refId, - Value name, - Value description, - Value completed, - Value rowid, - }); - -final class $$ProgramWorkoutsTableReferences - extends - BaseReferences<_$AppDatabase, $ProgramWorkoutsTable, ProgramWorkout> { - $$ProgramWorkoutsTableReferences( - super.$_db, - super.$_table, - super.$_typedResult, - ); - - static $ProgramWeeksTable _weekIdTable(_$AppDatabase db) => - db.programWeeks.createAlias( - $_aliasNameGenerator(db.programWorkouts.weekId, db.programWeeks.id), - ); - - $$ProgramWeeksTableProcessedTableManager get weekId { - final $_column = $_itemColumn('week_id')!; - - final manager = $$ProgramWeeksTableTableManager( - $_db, - $_db.programWeeks, - ).filter((f) => f.id.sqlEquals($_column)); - final item = $_typedResult.readTableOrNull(_weekIdTable($_db)); - if (item == null) return manager; - return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item]), - ); - } - - static $ProgramsTable _programIdTable(_$AppDatabase db) => - db.programs.createAlias( - $_aliasNameGenerator(db.programWorkouts.programId, db.programs.id), - ); - - $$ProgramsTableProcessedTableManager get programId { - final $_column = $_itemColumn('program_id')!; - - final manager = $$ProgramsTableTableManager( - $_db, - $_db.programs, - ).filter((f) => f.id.sqlEquals($_column)); - final item = $_typedResult.readTableOrNull(_programIdTable($_db)); - if (item == null) return manager; - return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item]), - ); - } -} - -class $$ProgramWorkoutsTableFilterComposer - extends Composer<_$AppDatabase, $ProgramWorkoutsTable> { - $$ProgramWorkoutsTableFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnFilters get id => $composableBuilder( - column: $table.id, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get day => $composableBuilder( - column: $table.day, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get type => $composableBuilder( - column: $table.type, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get refId => $composableBuilder( - column: $table.refId, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get name => $composableBuilder( - column: $table.name, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get description => $composableBuilder( - column: $table.description, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get completed => $composableBuilder( - column: $table.completed, - builder: (column) => ColumnFilters(column), - ); - - $$ProgramWeeksTableFilterComposer get weekId { - final $$ProgramWeeksTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.weekId, - referencedTable: $db.programWeeks, - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $$ProgramWeeksTableFilterComposer( - $db: $db, - $table: $db.programWeeks, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } - - $$ProgramsTableFilterComposer get programId { - final $$ProgramsTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.programId, - referencedTable: $db.programs, - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $$ProgramsTableFilterComposer( - $db: $db, - $table: $db.programs, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$ProgramWorkoutsTableOrderingComposer - extends Composer<_$AppDatabase, $ProgramWorkoutsTable> { - $$ProgramWorkoutsTableOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnOrderings get id => $composableBuilder( - column: $table.id, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get day => $composableBuilder( - column: $table.day, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get type => $composableBuilder( - column: $table.type, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get refId => $composableBuilder( - column: $table.refId, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get name => $composableBuilder( - column: $table.name, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get description => $composableBuilder( - column: $table.description, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get completed => $composableBuilder( - column: $table.completed, - builder: (column) => ColumnOrderings(column), - ); - - $$ProgramWeeksTableOrderingComposer get weekId { - final $$ProgramWeeksTableOrderingComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.weekId, - referencedTable: $db.programWeeks, - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $$ProgramWeeksTableOrderingComposer( - $db: $db, - $table: $db.programWeeks, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } - - $$ProgramsTableOrderingComposer get programId { - final $$ProgramsTableOrderingComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.programId, - referencedTable: $db.programs, - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $$ProgramsTableOrderingComposer( - $db: $db, - $table: $db.programs, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$ProgramWorkoutsTableAnnotationComposer - extends Composer<_$AppDatabase, $ProgramWorkoutsTable> { - $$ProgramWorkoutsTableAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); - - GeneratedColumn get day => - $composableBuilder(column: $table.day, builder: (column) => column); - - GeneratedColumn get type => - $composableBuilder(column: $table.type, builder: (column) => column); - - GeneratedColumn get refId => - $composableBuilder(column: $table.refId, builder: (column) => column); - - GeneratedColumn get name => - $composableBuilder(column: $table.name, builder: (column) => column); - - GeneratedColumn get description => $composableBuilder( - column: $table.description, - builder: (column) => column, - ); - - GeneratedColumn get completed => - $composableBuilder(column: $table.completed, builder: (column) => column); - - $$ProgramWeeksTableAnnotationComposer get weekId { - final $$ProgramWeeksTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.weekId, - referencedTable: $db.programWeeks, - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $$ProgramWeeksTableAnnotationComposer( - $db: $db, - $table: $db.programWeeks, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } - - $$ProgramsTableAnnotationComposer get programId { - final $$ProgramsTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.programId, - referencedTable: $db.programs, - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $$ProgramsTableAnnotationComposer( - $db: $db, - $table: $db.programs, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$ProgramWorkoutsTableTableManager - extends - RootTableManager< - _$AppDatabase, - $ProgramWorkoutsTable, - ProgramWorkout, - $$ProgramWorkoutsTableFilterComposer, - $$ProgramWorkoutsTableOrderingComposer, - $$ProgramWorkoutsTableAnnotationComposer, - $$ProgramWorkoutsTableCreateCompanionBuilder, - $$ProgramWorkoutsTableUpdateCompanionBuilder, - (ProgramWorkout, $$ProgramWorkoutsTableReferences), - ProgramWorkout, - PrefetchHooks Function({bool weekId, bool programId}) - > { - $$ProgramWorkoutsTableTableManager( - _$AppDatabase db, - $ProgramWorkoutsTable table, - ) : super( - TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - $$ProgramWorkoutsTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $$ProgramWorkoutsTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $$ProgramWorkoutsTableAnnotationComposer($db: db, $table: table), - updateCompanionCallback: - ({ - Value id = const Value.absent(), - Value weekId = const Value.absent(), - Value programId = const Value.absent(), - Value day = const Value.absent(), - Value type = const Value.absent(), - Value refId = const Value.absent(), - Value name = const Value.absent(), - Value description = const Value.absent(), - Value completed = const Value.absent(), - Value rowid = const Value.absent(), - }) => ProgramWorkoutsCompanion( - id: id, - weekId: weekId, - programId: programId, - day: day, - type: type, - refId: refId, - name: name, - description: description, - completed: completed, - rowid: rowid, - ), - createCompanionCallback: - ({ - required String id, - required String weekId, - required String programId, - required String day, - required String type, - Value refId = const Value.absent(), - Value name = const Value.absent(), - Value description = const Value.absent(), - Value completed = const Value.absent(), - Value rowid = const Value.absent(), - }) => ProgramWorkoutsCompanion.insert( - id: id, - weekId: weekId, - programId: programId, - day: day, - type: type, - refId: refId, - name: name, - description: description, - completed: completed, - rowid: rowid, - ), - withReferenceMapper: (p0) => p0 - .map( - (e) => ( - e.readTable(table), - $$ProgramWorkoutsTableReferences(db, table, e), - ), - ) - .toList(), - prefetchHooksCallback: ({weekId = false, programId = false}) { - return PrefetchHooks( - db: db, - explicitlyWatchedTables: [], - addJoins: - < - T extends TableManagerState< - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic - > - >(state) { - if (weekId) { - state = - state.withJoin( - currentTable: table, - currentColumn: table.weekId, - referencedTable: - $$ProgramWorkoutsTableReferences - ._weekIdTable(db), - referencedColumn: - $$ProgramWorkoutsTableReferences - ._weekIdTable(db) - .id, - ) - as T; - } - if (programId) { - state = - state.withJoin( - currentTable: table, - currentColumn: table.programId, - referencedTable: - $$ProgramWorkoutsTableReferences - ._programIdTable(db), - referencedColumn: - $$ProgramWorkoutsTableReferences - ._programIdTable(db) - .id, - ) - as T; - } - - return state; - }, - getPrefetchedDataCallback: (items) async { - return []; - }, - ); - }, - ), - ); -} - -typedef $$ProgramWorkoutsTableProcessedTableManager = - ProcessedTableManager< - _$AppDatabase, - $ProgramWorkoutsTable, - ProgramWorkout, - $$ProgramWorkoutsTableFilterComposer, - $$ProgramWorkoutsTableOrderingComposer, - $$ProgramWorkoutsTableAnnotationComposer, - $$ProgramWorkoutsTableCreateCompanionBuilder, - $$ProgramWorkoutsTableUpdateCompanionBuilder, - (ProgramWorkout, $$ProgramWorkoutsTableReferences), - ProgramWorkout, - PrefetchHooks Function({bool weekId, bool programId}) - >; -typedef $$AnalysisSessionsTableCreateCompanionBuilder = - AnalysisSessionsCompanion Function({ - required String id, - required String name, - required String date, - Value videoPath, - Value rowid, - }); -typedef $$AnalysisSessionsTableUpdateCompanionBuilder = - AnalysisSessionsCompanion Function({ - Value id, - Value name, - Value date, - Value videoPath, - Value rowid, - }); - -final class $$AnalysisSessionsTableReferences - extends - BaseReferences<_$AppDatabase, $AnalysisSessionsTable, AnalysisSession> { - $$AnalysisSessionsTableReferences( - super.$_db, - super.$_table, - super.$_typedResult, - ); - - static MultiTypedResultKey<$AnnotationsTable, List> - _annotationsRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable( - db.annotations, - aliasName: $_aliasNameGenerator( - db.analysisSessions.id, - db.annotations.sessionId, - ), - ); - - $$AnnotationsTableProcessedTableManager get annotationsRefs { - final manager = $$AnnotationsTableTableManager( - $_db, - $_db.annotations, - ).filter((f) => f.sessionId.id.sqlEquals($_itemColumn('id')!)); - - final cache = $_typedResult.readTableOrNull(_annotationsRefsTable($_db)); - return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: cache), - ); - } -} - -class $$AnalysisSessionsTableFilterComposer - extends Composer<_$AppDatabase, $AnalysisSessionsTable> { - $$AnalysisSessionsTableFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnFilters get id => $composableBuilder( - column: $table.id, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get name => $composableBuilder( - column: $table.name, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get date => $composableBuilder( - column: $table.date, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get videoPath => $composableBuilder( - column: $table.videoPath, - builder: (column) => ColumnFilters(column), - ); - - Expression annotationsRefs( - Expression Function($$AnnotationsTableFilterComposer f) f, - ) { - final $$AnnotationsTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.annotations, - getReferencedColumn: (t) => t.sessionId, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $$AnnotationsTableFilterComposer( - $db: $db, - $table: $db.annotations, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return f(composer); - } -} - -class $$AnalysisSessionsTableOrderingComposer - extends Composer<_$AppDatabase, $AnalysisSessionsTable> { - $$AnalysisSessionsTableOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnOrderings get id => $composableBuilder( - column: $table.id, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get name => $composableBuilder( - column: $table.name, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get date => $composableBuilder( - column: $table.date, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get videoPath => $composableBuilder( - column: $table.videoPath, - builder: (column) => ColumnOrderings(column), - ); -} - -class $$AnalysisSessionsTableAnnotationComposer - extends Composer<_$AppDatabase, $AnalysisSessionsTable> { - $$AnalysisSessionsTableAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); - - GeneratedColumn get name => - $composableBuilder(column: $table.name, builder: (column) => column); - - GeneratedColumn get date => - $composableBuilder(column: $table.date, builder: (column) => column); - - GeneratedColumn get videoPath => - $composableBuilder(column: $table.videoPath, builder: (column) => column); - - Expression annotationsRefs( - Expression Function($$AnnotationsTableAnnotationComposer a) f, - ) { - final $$AnnotationsTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.annotations, - getReferencedColumn: (t) => t.sessionId, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $$AnnotationsTableAnnotationComposer( - $db: $db, - $table: $db.annotations, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return f(composer); - } -} - -class $$AnalysisSessionsTableTableManager - extends - RootTableManager< - _$AppDatabase, - $AnalysisSessionsTable, - AnalysisSession, - $$AnalysisSessionsTableFilterComposer, - $$AnalysisSessionsTableOrderingComposer, - $$AnalysisSessionsTableAnnotationComposer, - $$AnalysisSessionsTableCreateCompanionBuilder, - $$AnalysisSessionsTableUpdateCompanionBuilder, - (AnalysisSession, $$AnalysisSessionsTableReferences), - AnalysisSession, - PrefetchHooks Function({bool annotationsRefs}) - > { - $$AnalysisSessionsTableTableManager( - _$AppDatabase db, - $AnalysisSessionsTable table, - ) : super( - TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - $$AnalysisSessionsTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $$AnalysisSessionsTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $$AnalysisSessionsTableAnnotationComposer($db: db, $table: table), - updateCompanionCallback: - ({ - Value id = const Value.absent(), - Value name = const Value.absent(), - Value date = const Value.absent(), - Value videoPath = const Value.absent(), - Value rowid = const Value.absent(), - }) => AnalysisSessionsCompanion( - id: id, - name: name, - date: date, - videoPath: videoPath, - rowid: rowid, - ), - createCompanionCallback: - ({ - required String id, - required String name, - required String date, - Value videoPath = const Value.absent(), - Value rowid = const Value.absent(), - }) => AnalysisSessionsCompanion.insert( - id: id, - name: name, - date: date, - videoPath: videoPath, - rowid: rowid, - ), - withReferenceMapper: (p0) => p0 - .map( - (e) => ( - e.readTable(table), - $$AnalysisSessionsTableReferences(db, table, e), - ), - ) - .toList(), - prefetchHooksCallback: ({annotationsRefs = false}) { - return PrefetchHooks( - db: db, - explicitlyWatchedTables: [if (annotationsRefs) db.annotations], - addJoins: null, - getPrefetchedDataCallback: (items) async { - return [ - if (annotationsRefs) - await $_getPrefetchedData< - AnalysisSession, - $AnalysisSessionsTable, - Annotation - >( - currentTable: table, - referencedTable: $$AnalysisSessionsTableReferences - ._annotationsRefsTable(db), - managerFromTypedResult: (p0) => - $$AnalysisSessionsTableReferences( - db, - table, - p0, - ).annotationsRefs, - referencedItemsForCurrentItem: (item, referencedItems) => - referencedItems.where((e) => e.sessionId == item.id), - typedResults: items, - ), - ]; - }, - ); - }, - ), - ); -} - -typedef $$AnalysisSessionsTableProcessedTableManager = - ProcessedTableManager< - _$AppDatabase, - $AnalysisSessionsTable, - AnalysisSession, - $$AnalysisSessionsTableFilterComposer, - $$AnalysisSessionsTableOrderingComposer, - $$AnalysisSessionsTableAnnotationComposer, - $$AnalysisSessionsTableCreateCompanionBuilder, - $$AnalysisSessionsTableUpdateCompanionBuilder, - (AnalysisSession, $$AnalysisSessionsTableReferences), - AnalysisSession, - PrefetchHooks Function({bool annotationsRefs}) - >; -typedef $$AnnotationsTableCreateCompanionBuilder = - AnnotationsCompanion Function({ - required String id, - required String sessionId, - required double startTime, - required double endTime, - Value name, - Value description, - Value color, - Value rowid, - }); -typedef $$AnnotationsTableUpdateCompanionBuilder = - AnnotationsCompanion Function({ - Value id, - Value sessionId, - Value startTime, - Value endTime, - Value name, - Value description, - Value color, - Value rowid, - }); - -final class $$AnnotationsTableReferences - extends BaseReferences<_$AppDatabase, $AnnotationsTable, Annotation> { - $$AnnotationsTableReferences(super.$_db, super.$_table, super.$_typedResult); - - static $AnalysisSessionsTable _sessionIdTable(_$AppDatabase db) => - db.analysisSessions.createAlias( - $_aliasNameGenerator(db.annotations.sessionId, db.analysisSessions.id), - ); - - $$AnalysisSessionsTableProcessedTableManager get sessionId { - final $_column = $_itemColumn('session_id')!; - - final manager = $$AnalysisSessionsTableTableManager( - $_db, - $_db.analysisSessions, - ).filter((f) => f.id.sqlEquals($_column)); - final item = $_typedResult.readTableOrNull(_sessionIdTable($_db)); - if (item == null) return manager; - return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item]), - ); - } -} - -class $$AnnotationsTableFilterComposer - extends Composer<_$AppDatabase, $AnnotationsTable> { - $$AnnotationsTableFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnFilters get id => $composableBuilder( - column: $table.id, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get startTime => $composableBuilder( - column: $table.startTime, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get endTime => $composableBuilder( - column: $table.endTime, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get name => $composableBuilder( - column: $table.name, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get description => $composableBuilder( - column: $table.description, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get color => $composableBuilder( - column: $table.color, - builder: (column) => ColumnFilters(column), - ); - - $$AnalysisSessionsTableFilterComposer get sessionId { - final $$AnalysisSessionsTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.sessionId, - referencedTable: $db.analysisSessions, - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $$AnalysisSessionsTableFilterComposer( - $db: $db, - $table: $db.analysisSessions, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$AnnotationsTableOrderingComposer - extends Composer<_$AppDatabase, $AnnotationsTable> { - $$AnnotationsTableOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnOrderings get id => $composableBuilder( - column: $table.id, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get startTime => $composableBuilder( - column: $table.startTime, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get endTime => $composableBuilder( - column: $table.endTime, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get name => $composableBuilder( - column: $table.name, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get description => $composableBuilder( - column: $table.description, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get color => $composableBuilder( - column: $table.color, - builder: (column) => ColumnOrderings(column), - ); - - $$AnalysisSessionsTableOrderingComposer get sessionId { - final $$AnalysisSessionsTableOrderingComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.sessionId, - referencedTable: $db.analysisSessions, - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $$AnalysisSessionsTableOrderingComposer( - $db: $db, - $table: $db.analysisSessions, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$AnnotationsTableAnnotationComposer - extends Composer<_$AppDatabase, $AnnotationsTable> { - $$AnnotationsTableAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); - - GeneratedColumn get startTime => - $composableBuilder(column: $table.startTime, builder: (column) => column); - - GeneratedColumn get endTime => - $composableBuilder(column: $table.endTime, builder: (column) => column); - - GeneratedColumn get name => - $composableBuilder(column: $table.name, builder: (column) => column); - - GeneratedColumn get description => $composableBuilder( - column: $table.description, - builder: (column) => column, - ); - - GeneratedColumn get color => - $composableBuilder(column: $table.color, builder: (column) => column); - - $$AnalysisSessionsTableAnnotationComposer get sessionId { - final $$AnalysisSessionsTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.sessionId, - referencedTable: $db.analysisSessions, - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $$AnalysisSessionsTableAnnotationComposer( - $db: $db, - $table: $db.analysisSessions, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$AnnotationsTableTableManager - extends - RootTableManager< - _$AppDatabase, - $AnnotationsTable, - Annotation, - $$AnnotationsTableFilterComposer, - $$AnnotationsTableOrderingComposer, - $$AnnotationsTableAnnotationComposer, - $$AnnotationsTableCreateCompanionBuilder, - $$AnnotationsTableUpdateCompanionBuilder, - (Annotation, $$AnnotationsTableReferences), - Annotation, - PrefetchHooks Function({bool sessionId}) - > { - $$AnnotationsTableTableManager(_$AppDatabase db, $AnnotationsTable table) - : super( - TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - $$AnnotationsTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $$AnnotationsTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $$AnnotationsTableAnnotationComposer($db: db, $table: table), - updateCompanionCallback: - ({ - Value id = const Value.absent(), - Value sessionId = const Value.absent(), - Value startTime = const Value.absent(), - Value endTime = const Value.absent(), - Value name = const Value.absent(), - Value description = const Value.absent(), - Value color = const Value.absent(), - Value rowid = const Value.absent(), - }) => AnnotationsCompanion( - id: id, - sessionId: sessionId, - startTime: startTime, - endTime: endTime, - name: name, - description: description, - color: color, - rowid: rowid, - ), - createCompanionCallback: - ({ - required String id, - required String sessionId, - required double startTime, - required double endTime, - Value name = const Value.absent(), - Value description = const Value.absent(), - Value color = const Value.absent(), - Value rowid = const Value.absent(), - }) => AnnotationsCompanion.insert( - id: id, - sessionId: sessionId, - startTime: startTime, - endTime: endTime, - name: name, - description: description, - color: color, - rowid: rowid, - ), - withReferenceMapper: (p0) => p0 - .map( - (e) => ( - e.readTable(table), - $$AnnotationsTableReferences(db, table, e), - ), - ) - .toList(), - prefetchHooksCallback: ({sessionId = false}) { - return PrefetchHooks( - db: db, - explicitlyWatchedTables: [], - addJoins: - < - T extends TableManagerState< - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic - > - >(state) { - if (sessionId) { - state = - state.withJoin( - currentTable: table, - currentColumn: table.sessionId, - referencedTable: $$AnnotationsTableReferences - ._sessionIdTable(db), - referencedColumn: $$AnnotationsTableReferences - ._sessionIdTable(db) - .id, - ) - as T; - } - - return state; - }, - getPrefetchedDataCallback: (items) async { - return []; - }, - ); - }, - ), - ); -} - -typedef $$AnnotationsTableProcessedTableManager = - ProcessedTableManager< - _$AppDatabase, - $AnnotationsTable, - Annotation, - $$AnnotationsTableFilterComposer, - $$AnnotationsTableOrderingComposer, - $$AnnotationsTableAnnotationComposer, - $$AnnotationsTableCreateCompanionBuilder, - $$AnnotationsTableUpdateCompanionBuilder, - (Annotation, $$AnnotationsTableReferences), - Annotation, - PrefetchHooks Function({bool sessionId}) - >; -typedef $$ChatSessionsTableCreateCompanionBuilder = - ChatSessionsCompanion Function({ - required String id, - Value title, - required String createdAt, - required String updatedAt, - Value rowid, - }); -typedef $$ChatSessionsTableUpdateCompanionBuilder = - ChatSessionsCompanion Function({ - Value id, - Value title, - Value createdAt, - Value updatedAt, - Value rowid, - }); - -final class $$ChatSessionsTableReferences - extends BaseReferences<_$AppDatabase, $ChatSessionsTable, ChatSession> { - $$ChatSessionsTableReferences(super.$_db, super.$_table, super.$_typedResult); - - static MultiTypedResultKey<$ChatMessagesTable, List> - _chatMessagesRefsTable(_$AppDatabase db) => MultiTypedResultKey.fromTable( - db.chatMessages, - aliasName: $_aliasNameGenerator( - db.chatSessions.id, - db.chatMessages.sessionId, - ), - ); - - $$ChatMessagesTableProcessedTableManager get chatMessagesRefs { - final manager = $$ChatMessagesTableTableManager( - $_db, - $_db.chatMessages, - ).filter((f) => f.sessionId.id.sqlEquals($_itemColumn('id')!)); - - final cache = $_typedResult.readTableOrNull(_chatMessagesRefsTable($_db)); - return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: cache), - ); - } -} - -class $$ChatSessionsTableFilterComposer - extends Composer<_$AppDatabase, $ChatSessionsTable> { - $$ChatSessionsTableFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnFilters get id => $composableBuilder( - column: $table.id, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get title => $composableBuilder( - column: $table.title, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get createdAt => $composableBuilder( - column: $table.createdAt, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get updatedAt => $composableBuilder( - column: $table.updatedAt, - builder: (column) => ColumnFilters(column), - ); - - Expression chatMessagesRefs( - Expression Function($$ChatMessagesTableFilterComposer f) f, - ) { - final $$ChatMessagesTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.chatMessages, - getReferencedColumn: (t) => t.sessionId, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $$ChatMessagesTableFilterComposer( - $db: $db, - $table: $db.chatMessages, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return f(composer); - } -} - -class $$ChatSessionsTableOrderingComposer - extends Composer<_$AppDatabase, $ChatSessionsTable> { - $$ChatSessionsTableOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnOrderings get id => $composableBuilder( - column: $table.id, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get title => $composableBuilder( - column: $table.title, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get createdAt => $composableBuilder( - column: $table.createdAt, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get updatedAt => $composableBuilder( - column: $table.updatedAt, - builder: (column) => ColumnOrderings(column), - ); -} - -class $$ChatSessionsTableAnnotationComposer - extends Composer<_$AppDatabase, $ChatSessionsTable> { - $$ChatSessionsTableAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); - - GeneratedColumn get title => - $composableBuilder(column: $table.title, builder: (column) => column); - - GeneratedColumn get createdAt => - $composableBuilder(column: $table.createdAt, builder: (column) => column); - - GeneratedColumn get updatedAt => - $composableBuilder(column: $table.updatedAt, builder: (column) => column); - - Expression chatMessagesRefs( - Expression Function($$ChatMessagesTableAnnotationComposer a) f, - ) { - final $$ChatMessagesTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.id, - referencedTable: $db.chatMessages, - getReferencedColumn: (t) => t.sessionId, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $$ChatMessagesTableAnnotationComposer( - $db: $db, - $table: $db.chatMessages, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return f(composer); - } -} - -class $$ChatSessionsTableTableManager - extends - RootTableManager< - _$AppDatabase, - $ChatSessionsTable, - ChatSession, - $$ChatSessionsTableFilterComposer, - $$ChatSessionsTableOrderingComposer, - $$ChatSessionsTableAnnotationComposer, - $$ChatSessionsTableCreateCompanionBuilder, - $$ChatSessionsTableUpdateCompanionBuilder, - (ChatSession, $$ChatSessionsTableReferences), - ChatSession, - PrefetchHooks Function({bool chatMessagesRefs}) - > { - $$ChatSessionsTableTableManager(_$AppDatabase db, $ChatSessionsTable table) - : super( - TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - $$ChatSessionsTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $$ChatSessionsTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $$ChatSessionsTableAnnotationComposer($db: db, $table: table), - updateCompanionCallback: - ({ - Value id = const Value.absent(), - Value title = const Value.absent(), - Value createdAt = const Value.absent(), - Value updatedAt = const Value.absent(), - Value rowid = const Value.absent(), - }) => ChatSessionsCompanion( - id: id, - title: title, - createdAt: createdAt, - updatedAt: updatedAt, - rowid: rowid, - ), - createCompanionCallback: - ({ - required String id, - Value title = const Value.absent(), - required String createdAt, - required String updatedAt, - Value rowid = const Value.absent(), - }) => ChatSessionsCompanion.insert( - id: id, - title: title, - createdAt: createdAt, - updatedAt: updatedAt, - rowid: rowid, - ), - withReferenceMapper: (p0) => p0 - .map( - (e) => ( - e.readTable(table), - $$ChatSessionsTableReferences(db, table, e), - ), - ) - .toList(), - prefetchHooksCallback: ({chatMessagesRefs = false}) { - return PrefetchHooks( - db: db, - explicitlyWatchedTables: [if (chatMessagesRefs) db.chatMessages], - addJoins: null, - getPrefetchedDataCallback: (items) async { - return [ - if (chatMessagesRefs) - await $_getPrefetchedData< - ChatSession, - $ChatSessionsTable, - ChatMessage - >( - currentTable: table, - referencedTable: $$ChatSessionsTableReferences - ._chatMessagesRefsTable(db), - managerFromTypedResult: (p0) => - $$ChatSessionsTableReferences( - db, - table, - p0, - ).chatMessagesRefs, - referencedItemsForCurrentItem: (item, referencedItems) => - referencedItems.where((e) => e.sessionId == item.id), - typedResults: items, - ), - ]; - }, - ); - }, - ), - ); -} - -typedef $$ChatSessionsTableProcessedTableManager = - ProcessedTableManager< - _$AppDatabase, - $ChatSessionsTable, - ChatSession, - $$ChatSessionsTableFilterComposer, - $$ChatSessionsTableOrderingComposer, - $$ChatSessionsTableAnnotationComposer, - $$ChatSessionsTableCreateCompanionBuilder, - $$ChatSessionsTableUpdateCompanionBuilder, - (ChatSession, $$ChatSessionsTableReferences), - ChatSession, - PrefetchHooks Function({bool chatMessagesRefs}) - >; -typedef $$ChatMessagesTableCreateCompanionBuilder = - ChatMessagesCompanion Function({ - required String id, - required String sessionId, - required String role, - required String content, - required String createdAt, - Value rowid, - }); -typedef $$ChatMessagesTableUpdateCompanionBuilder = - ChatMessagesCompanion Function({ - Value id, - Value sessionId, - Value role, - Value content, - Value createdAt, - Value rowid, - }); - -final class $$ChatMessagesTableReferences - extends BaseReferences<_$AppDatabase, $ChatMessagesTable, ChatMessage> { - $$ChatMessagesTableReferences(super.$_db, super.$_table, super.$_typedResult); - - static $ChatSessionsTable _sessionIdTable(_$AppDatabase db) => - db.chatSessions.createAlias( - $_aliasNameGenerator(db.chatMessages.sessionId, db.chatSessions.id), - ); - - $$ChatSessionsTableProcessedTableManager get sessionId { - final $_column = $_itemColumn('session_id')!; - - final manager = $$ChatSessionsTableTableManager( - $_db, - $_db.chatSessions, - ).filter((f) => f.id.sqlEquals($_column)); - final item = $_typedResult.readTableOrNull(_sessionIdTable($_db)); - if (item == null) return manager; - return ProcessedTableManager( - manager.$state.copyWith(prefetchedData: [item]), - ); - } -} - -class $$ChatMessagesTableFilterComposer - extends Composer<_$AppDatabase, $ChatMessagesTable> { - $$ChatMessagesTableFilterComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnFilters get id => $composableBuilder( - column: $table.id, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get role => $composableBuilder( - column: $table.role, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get content => $composableBuilder( - column: $table.content, - builder: (column) => ColumnFilters(column), - ); - - ColumnFilters get createdAt => $composableBuilder( - column: $table.createdAt, - builder: (column) => ColumnFilters(column), - ); - - $$ChatSessionsTableFilterComposer get sessionId { - final $$ChatSessionsTableFilterComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.sessionId, - referencedTable: $db.chatSessions, - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $$ChatSessionsTableFilterComposer( - $db: $db, - $table: $db.chatSessions, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$ChatMessagesTableOrderingComposer - extends Composer<_$AppDatabase, $ChatMessagesTable> { - $$ChatMessagesTableOrderingComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - ColumnOrderings get id => $composableBuilder( - column: $table.id, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get role => $composableBuilder( - column: $table.role, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get content => $composableBuilder( - column: $table.content, - builder: (column) => ColumnOrderings(column), - ); - - ColumnOrderings get createdAt => $composableBuilder( - column: $table.createdAt, - builder: (column) => ColumnOrderings(column), - ); - - $$ChatSessionsTableOrderingComposer get sessionId { - final $$ChatSessionsTableOrderingComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.sessionId, - referencedTable: $db.chatSessions, - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $$ChatSessionsTableOrderingComposer( - $db: $db, - $table: $db.chatSessions, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$ChatMessagesTableAnnotationComposer - extends Composer<_$AppDatabase, $ChatMessagesTable> { - $$ChatMessagesTableAnnotationComposer({ - required super.$db, - required super.$table, - super.joinBuilder, - super.$addJoinBuilderToRootComposer, - super.$removeJoinBuilderFromRootComposer, - }); - GeneratedColumn get id => - $composableBuilder(column: $table.id, builder: (column) => column); - - GeneratedColumn get role => - $composableBuilder(column: $table.role, builder: (column) => column); - - GeneratedColumn get content => - $composableBuilder(column: $table.content, builder: (column) => column); - - GeneratedColumn get createdAt => - $composableBuilder(column: $table.createdAt, builder: (column) => column); - - $$ChatSessionsTableAnnotationComposer get sessionId { - final $$ChatSessionsTableAnnotationComposer composer = $composerBuilder( - composer: this, - getCurrentColumn: (t) => t.sessionId, - referencedTable: $db.chatSessions, - getReferencedColumn: (t) => t.id, - builder: - ( - joinBuilder, { - $addJoinBuilderToRootComposer, - $removeJoinBuilderFromRootComposer, - }) => $$ChatSessionsTableAnnotationComposer( - $db: $db, - $table: $db.chatSessions, - $addJoinBuilderToRootComposer: $addJoinBuilderToRootComposer, - joinBuilder: joinBuilder, - $removeJoinBuilderFromRootComposer: - $removeJoinBuilderFromRootComposer, - ), - ); - return composer; - } -} - -class $$ChatMessagesTableTableManager - extends - RootTableManager< - _$AppDatabase, - $ChatMessagesTable, - ChatMessage, - $$ChatMessagesTableFilterComposer, - $$ChatMessagesTableOrderingComposer, - $$ChatMessagesTableAnnotationComposer, - $$ChatMessagesTableCreateCompanionBuilder, - $$ChatMessagesTableUpdateCompanionBuilder, - (ChatMessage, $$ChatMessagesTableReferences), - ChatMessage, - PrefetchHooks Function({bool sessionId}) - > { - $$ChatMessagesTableTableManager(_$AppDatabase db, $ChatMessagesTable table) - : super( - TableManagerState( - db: db, - table: table, - createFilteringComposer: () => - $$ChatMessagesTableFilterComposer($db: db, $table: table), - createOrderingComposer: () => - $$ChatMessagesTableOrderingComposer($db: db, $table: table), - createComputedFieldComposer: () => - $$ChatMessagesTableAnnotationComposer($db: db, $table: table), - updateCompanionCallback: - ({ - Value id = const Value.absent(), - Value sessionId = const Value.absent(), - Value role = const Value.absent(), - Value content = const Value.absent(), - Value createdAt = const Value.absent(), - Value rowid = const Value.absent(), - }) => ChatMessagesCompanion( - id: id, - sessionId: sessionId, - role: role, - content: content, - createdAt: createdAt, - rowid: rowid, - ), - createCompanionCallback: - ({ - required String id, - required String sessionId, - required String role, - required String content, - required String createdAt, - Value rowid = const Value.absent(), - }) => ChatMessagesCompanion.insert( - id: id, - sessionId: sessionId, - role: role, - content: content, - createdAt: createdAt, - rowid: rowid, - ), - withReferenceMapper: (p0) => p0 - .map( - (e) => ( - e.readTable(table), - $$ChatMessagesTableReferences(db, table, e), - ), - ) - .toList(), - prefetchHooksCallback: ({sessionId = false}) { - return PrefetchHooks( - db: db, - explicitlyWatchedTables: [], - addJoins: - < - T extends TableManagerState< - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic, - dynamic - > - >(state) { - if (sessionId) { - state = - state.withJoin( - currentTable: table, - currentColumn: table.sessionId, - referencedTable: $$ChatMessagesTableReferences - ._sessionIdTable(db), - referencedColumn: $$ChatMessagesTableReferences - ._sessionIdTable(db) - .id, - ) - as T; - } - - return state; - }, - getPrefetchedDataCallback: (items) async { - return []; - }, - ); - }, - ), - ); -} - -typedef $$ChatMessagesTableProcessedTableManager = - ProcessedTableManager< - _$AppDatabase, - $ChatMessagesTable, - ChatMessage, - $$ChatMessagesTableFilterComposer, - $$ChatMessagesTableOrderingComposer, - $$ChatMessagesTableAnnotationComposer, - $$ChatMessagesTableCreateCompanionBuilder, - $$ChatMessagesTableUpdateCompanionBuilder, - (ChatMessage, $$ChatMessagesTableReferences), - ChatMessage, - PrefetchHooks Function({bool sessionId}) - >; - -class $AppDatabaseManager { - final _$AppDatabase _db; - $AppDatabaseManager(this._db); - $$ExercisesTableTableManager get exercises => - $$ExercisesTableTableManager(_db, _db.exercises); - $$TrainingPlansTableTableManager get trainingPlans => - $$TrainingPlansTableTableManager(_db, _db.trainingPlans); - $$ProgramsTableTableManager get programs => - $$ProgramsTableTableManager(_db, _db.programs); - $$ProgramWeeksTableTableManager get programWeeks => - $$ProgramWeeksTableTableManager(_db, _db.programWeeks); - $$ProgramWorkoutsTableTableManager get programWorkouts => - $$ProgramWorkoutsTableTableManager(_db, _db.programWorkouts); - $$AnalysisSessionsTableTableManager get analysisSessions => - $$AnalysisSessionsTableTableManager(_db, _db.analysisSessions); - $$AnnotationsTableTableManager get annotations => - $$AnnotationsTableTableManager(_db, _db.annotations); - $$ChatSessionsTableTableManager get chatSessions => - $$ChatSessionsTableTableManager(_db, _db.chatSessions); - $$ChatMessagesTableTableManager get chatMessages => - $$ChatMessagesTableTableManager(_db, _db.chatMessages); -} diff --git a/lib/models/training_models.dart b/lib/models/training_models.dart deleted file mode 100644 index c094792..0000000 --- a/lib/models/training_models.dart +++ /dev/null @@ -1,107 +0,0 @@ -class TrainingPlanModel { - String id; - String name; - List sections; - - TrainingPlanModel({ - required this.id, - required this.name, - required this.sections, - }); - - factory TrainingPlanModel.fromJson(Map json) { - return TrainingPlanModel( - id: json['id'] ?? '', - name: json['name'] ?? '', - sections: - (json['sections'] as List?) - ?.map((e) => TrainingSectionModel.fromJson(e)) - .toList() ?? - [], - ); - } - - Map toJson() { - return { - 'id': id, - 'name': name, - 'sections': sections.map((e) => e.toJson()).toList(), - }; - } -} - -class TrainingSectionModel { - String id; - String name; - List exercises; - - TrainingSectionModel({ - required this.id, - required this.name, - required this.exercises, - }); - - factory TrainingSectionModel.fromJson(Map json) { - return TrainingSectionModel( - id: json['id'] ?? '', - name: json['name'] ?? '', - exercises: - (json['exercises'] as List?) - ?.map((e) => TrainingExerciseModel.fromJson(e)) - .toList() ?? - [], - ); - } - - Map toJson() { - return { - 'id': id, - 'name': name, - 'exercises': exercises.map((e) => e.toJson()).toList(), - }; - } -} - -class TrainingExerciseModel { - String instanceId; - String exerciseId; - String name; - int sets; - int value; // Reps or Seconds - bool isTime; - int rest; - - TrainingExerciseModel({ - required this.instanceId, - required this.exerciseId, - required this.name, - required this.sets, - required this.value, - required this.isTime, - required this.rest, - }); - - factory TrainingExerciseModel.fromJson(Map json) { - return TrainingExerciseModel( - instanceId: json['instanceId'] ?? '', - exerciseId: json['exerciseId'] ?? '', - name: json['name'] ?? '', - sets: json['sets'] ?? 3, - value: json['value'] ?? 10, - isTime: json['isTime'] ?? false, - rest: json['rest'] ?? 60, - ); - } - - Map toJson() { - return { - 'instanceId': instanceId, - 'exerciseId': exerciseId, - 'name': name, - 'sets': sets, - 'value': value, - 'isTime': isTime, - 'rest': rest, - }; - } -} diff --git a/lib/presentation/analysis/analysis_controller.dart b/lib/presentation/analysis/analysis_controller.dart index f3f2497..acafbb1 100644 --- a/lib/presentation/analysis/analysis_controller.dart +++ b/lib/presentation/analysis/analysis_controller.dart @@ -7,7 +7,7 @@ part 'analysis_controller.g.dart'; @riverpod class AnalysisController extends _$AnalysisController { - late final AnalysisRepository _repo; + late AnalysisRepository _repo; @override Future build() async { diff --git a/lib/presentation/analysis/widgets/analysis_session_list.dart b/lib/presentation/analysis/widgets/analysis_session_list.dart index 541b735..f673e0c 100644 --- a/lib/presentation/analysis/widgets/analysis_session_list.dart +++ b/lib/presentation/analysis/widgets/analysis_session_list.dart @@ -1,4 +1,6 @@ import 'package:flutter/material.dart'; +import 'package:trainhub_flutter/core/theme/app_colors.dart'; +import 'package:trainhub_flutter/core/constants/ui_constants.dart'; import 'package:trainhub_flutter/domain/entities/analysis_session.dart'; class AnalysisSessionList extends StatelessWidget { @@ -15,26 +17,148 @@ class AnalysisSessionList extends StatelessWidget { @override Widget build(BuildContext context) { - if (sessions.isEmpty) { - return const Center( - child: Text('No analysis sessions yet. Tap + to create one.'), - ); - } return ListView.builder( + padding: const EdgeInsets.all(UIConstants.spacing24), itemCount: sessions.length, itemBuilder: (context, index) { final session = sessions[index]; - return ListTile( - leading: const CircleAvatar(child: Icon(Icons.video_library)), - title: Text(session.name), - subtitle: Text(session.date), - trailing: IconButton( - icon: const Icon(Icons.delete_outline), - onPressed: () => onDeleteSession(session), - ), + return _SessionCard( + session: session, onTap: () => onSessionSelected(session), + onDelete: () => onDeleteSession(session), ); }, ); } } + +class _SessionCard extends StatefulWidget { + final AnalysisSessionEntity session; + final VoidCallback onTap; + final VoidCallback onDelete; + + const _SessionCard({ + required this.session, + required this.onTap, + required this.onDelete, + }); + + @override + State<_SessionCard> createState() => _SessionCardState(); +} + +class _SessionCardState extends State<_SessionCard> { + bool _isHovered = false; + + @override + Widget build(BuildContext context) { + return MouseRegion( + onEnter: (_) => setState(() => _isHovered = true), + onExit: (_) => setState(() => _isHovered = false), + child: AnimatedContainer( + duration: UIConstants.animationDuration, + margin: const EdgeInsets.only(bottom: UIConstants.spacing12), + decoration: BoxDecoration( + color: _isHovered ? AppColors.surfaceContainerHigh : AppColors.surfaceContainer, + borderRadius: UIConstants.cardBorderRadius, + border: Border.all( + color: _isHovered ? AppColors.zinc600 : AppColors.border, + ), + ), + child: Material( + color: Colors.transparent, + child: InkWell( + onTap: widget.onTap, + borderRadius: UIConstants.cardBorderRadius, + child: Padding( + padding: const EdgeInsets.all(UIConstants.cardPadding), + child: Row( + children: [ + Container( + width: 44, + height: 44, + decoration: BoxDecoration( + color: AppColors.purpleMuted, + borderRadius: BorderRadius.circular(10), + ), + child: const Icon( + Icons.play_circle_outline, + color: AppColors.purple, + size: 24, + ), + ), + const SizedBox(width: UIConstants.spacing16), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + widget.session.name, + style: const TextStyle( + color: AppColors.textPrimary, + fontSize: 15, + fontWeight: FontWeight.w600, + ), + ), + const SizedBox(height: 4), + Row( + children: [ + const Icon( + Icons.calendar_today_outlined, + size: 12, + color: AppColors.textMuted, + ), + const SizedBox(width: 4), + Text( + widget.session.date, + style: const TextStyle( + color: AppColors.textMuted, + fontSize: 12, + ), + ), + if (widget.session.videoPath != null) ...[ + const SizedBox(width: UIConstants.spacing12), + const Icon( + Icons.videocam_outlined, + size: 12, + color: AppColors.info, + ), + const SizedBox(width: 4), + const Text( + 'Video', + style: TextStyle( + color: AppColors.info, + fontSize: 12, + ), + ), + ], + ], + ), + ], + ), + ), + if (_isHovered) + IconButton( + icon: const Icon( + Icons.delete_outline, + size: 18, + color: AppColors.destructive, + ), + onPressed: widget.onDelete, + tooltip: 'Delete', + ) + else + const Icon( + Icons.chevron_right, + size: 20, + color: AppColors.textMuted, + ), + ], + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/presentation/calendar/calendar_controller.dart b/lib/presentation/calendar/calendar_controller.dart index 739a15b..952d9b1 100644 --- a/lib/presentation/calendar/calendar_controller.dart +++ b/lib/presentation/calendar/calendar_controller.dart @@ -10,9 +10,9 @@ part 'calendar_controller.g.dart'; @riverpod class CalendarController extends _$CalendarController { - late final ProgramRepository _programRepo; - late final TrainingPlanRepository _planRepo; - late final ExerciseRepository _exerciseRepo; + late ProgramRepository _programRepo; + late TrainingPlanRepository _planRepo; + late ExerciseRepository _exerciseRepo; @override Future build() async { diff --git a/lib/presentation/calendar/calendar_page.dart b/lib/presentation/calendar/calendar_page.dart index 5e68c79..e57509b 100644 --- a/lib/presentation/calendar/calendar_page.dart +++ b/lib/presentation/calendar/calendar_page.dart @@ -1,9 +1,14 @@ import 'package:auto_route/auto_route.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; +import 'package:trainhub_flutter/core/theme/app_colors.dart'; +import 'package:trainhub_flutter/core/constants/ui_constants.dart'; import 'package:trainhub_flutter/presentation/calendar/calendar_controller.dart'; import 'package:trainhub_flutter/presentation/calendar/widgets/program_selector.dart'; import 'package:trainhub_flutter/presentation/calendar/widgets/program_week_view.dart'; +import 'package:trainhub_flutter/presentation/common/widgets/app_empty_state.dart'; +import 'package:trainhub_flutter/presentation/common/dialogs/text_input_dialog.dart'; +import 'package:trainhub_flutter/presentation/common/dialogs/confirm_dialog.dart'; @RoutePage() class CalendarPage extends ConsumerWidget { @@ -14,103 +19,111 @@ class CalendarPage extends ConsumerWidget { final state = ref.watch(calendarControllerProvider); final controller = ref.read(calendarControllerProvider.notifier); - return Scaffold( - appBar: AppBar(title: const Text('Program & Schedule')), - body: state.when( - data: (data) { - if (data.programs.isEmpty) { - return Center( - child: ElevatedButton( - onPressed: () => _showCreateProgramDialog(context, controller), - child: const Text('Create First Program'), - ), - ); - } - - return Column( - children: [ - ProgramSelector( - programs: data.programs, - activeProgram: data.activeProgram, - onProgramSelected: (p) => controller.loadProgram(p.id), - onCreateProgram: () => - _showCreateProgramDialog(context, controller), - ), - Expanded( - child: data.activeProgram == null - ? const Center(child: Text("Select a program")) - : ListView.builder( - padding: const EdgeInsets.all(16), - itemCount: data.weeks.length + 1, - itemBuilder: (context, index) { - if (index == data.weeks.length) { - return Padding( - padding: const EdgeInsets.symmetric( - vertical: 24.0, - ), - child: Center( - child: OutlinedButton.icon( - onPressed: controller.addWeek, - icon: const Icon(Icons.add), - label: const Text("Add Week"), - ), - ), - ); - } - final week = data.weeks[index]; - final weekWorkouts = data.workouts - .where((w) => w.weekId == week.id) - .toList(); - return ProgramWeekView( - week: week, - workouts: weekWorkouts, - availablePlans: data.plans, - onAddWorkout: (workout) => controller.addWorkout( - workout, - ), // logic needs refined params - onDeleteWorkout: controller.deleteWorkout, - ); - }, - ), - ), - ], + return state.when( + data: (data) { + if (data.programs.isEmpty) { + return AppEmptyState( + icon: Icons.calendar_month_outlined, + title: 'No programs yet', + subtitle: 'Create your first training program to start scheduling workouts', + actionLabel: 'Create Program', + onAction: () => _showCreateProgramDialog(context, controller), ); - }, - error: (e, s) => Center(child: Text('Error: $e')), - loading: () => const Center(child: CircularProgressIndicator()), + } + + return Column( + children: [ + ProgramSelector( + programs: data.programs, + activeProgram: data.activeProgram, + onProgramSelected: (p) => controller.loadProgram(p.id), + onCreateProgram: () => + _showCreateProgramDialog(context, controller), + onDuplicateProgram: () { + if (data.activeProgram != null) { + controller.duplicateProgram(data.activeProgram!.id); + } + }, + onDeleteProgram: () async { + if (data.activeProgram != null) { + final confirmed = await ConfirmDialog.show( + context, + title: 'Delete Program?', + message: + 'Are you sure you want to delete "${data.activeProgram!.name}"? This cannot be undone.', + ); + if (confirmed == true) { + controller.deleteProgram(data.activeProgram!.id); + } + } + }, + ), + Expanded( + child: data.activeProgram == null + ? const Center( + child: Text( + 'Select a program to view its schedule', + style: TextStyle( + color: AppColors.textMuted, + fontSize: 14, + ), + ), + ) + : ListView.builder( + padding: const EdgeInsets.all(UIConstants.spacing24), + itemCount: data.weeks.length + 1, + itemBuilder: (context, index) { + if (index == data.weeks.length) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: UIConstants.spacing24), + child: Center( + child: OutlinedButton.icon( + onPressed: controller.addWeek, + icon: const Icon(Icons.add, size: 18), + label: const Text('Add Week'), + ), + ), + ); + } + final week = data.weeks[index]; + final weekWorkouts = data.workouts + .where((w) => w.weekId == week.id) + .toList(); + return ProgramWeekView( + week: week, + workouts: weekWorkouts, + availablePlans: data.plans, + onAddWorkout: (workout) => + controller.addWorkout(workout), + onDeleteWorkout: controller.deleteWorkout, + ); + }, + ), + ), + ], + ); + }, + error: (e, s) => Center( + child: Text( + 'Error: $e', + style: const TextStyle(color: AppColors.destructive), + ), ), + loading: () => const Center(child: CircularProgressIndicator()), ); } - void _showCreateProgramDialog( + Future _showCreateProgramDialog( BuildContext context, CalendarController controller, - ) { - final textController = TextEditingController(); - showDialog( - context: context, - builder: (context) => AlertDialog( - title: const Text('New Program'), - content: TextField( - controller: textController, - decoration: const InputDecoration(labelText: 'Program Name'), - ), - actions: [ - TextButton( - onPressed: () => Navigator.pop(context), - child: const Text('Cancel'), - ), - FilledButton( - onPressed: () { - if (textController.text.isNotEmpty) { - controller.createProgram(textController.text); - Navigator.pop(context); - } - }, - child: const Text('Create'), - ), - ], - ), + ) async { + final name = await TextInputDialog.show( + context, + title: 'New Program', + hintText: 'e.g. 12 Week Strength', ); + if (name != null && name.isNotEmpty) { + controller.createProgram(name); + } } } diff --git a/lib/presentation/chat/chat_controller.dart b/lib/presentation/chat/chat_controller.dart index 6e6f3a3..81ae674 100644 --- a/lib/presentation/chat/chat_controller.dart +++ b/lib/presentation/chat/chat_controller.dart @@ -7,7 +7,7 @@ part 'chat_controller.g.dart'; @riverpod class ChatController extends _$ChatController { - late final ChatRepository _repo; + late ChatRepository _repo; @override Future build() async { diff --git a/lib/presentation/plan_editor/plan_editor_controller.dart b/lib/presentation/plan_editor/plan_editor_controller.dart index 05a2ba6..6f2edd5 100644 --- a/lib/presentation/plan_editor/plan_editor_controller.dart +++ b/lib/presentation/plan_editor/plan_editor_controller.dart @@ -13,7 +13,7 @@ part 'plan_editor_controller.g.dart'; @riverpod class PlanEditorController extends _$PlanEditorController { - late final TrainingPlanRepository _planRepo; + late TrainingPlanRepository _planRepo; @override Future build(String planId) async { diff --git a/lib/presentation/trainings/trainings_controller.dart b/lib/presentation/trainings/trainings_controller.dart index a594c78..38cd946 100644 --- a/lib/presentation/trainings/trainings_controller.dart +++ b/lib/presentation/trainings/trainings_controller.dart @@ -10,8 +10,8 @@ part 'trainings_controller.g.dart'; @riverpod class TrainingsController extends _$TrainingsController { - late final TrainingPlanRepository _planRepo; - late final ExerciseRepository _exerciseRepo; + late TrainingPlanRepository _planRepo; + late ExerciseRepository _exerciseRepo; @override Future build() async { diff --git a/lib/presentation/workout_session/widgets/activity_card.dart b/lib/presentation/workout_session/widgets/activity_card.dart index d4b8fa6..c212faa 100644 --- a/lib/presentation/workout_session/widgets/activity_card.dart +++ b/lib/presentation/workout_session/widgets/activity_card.dart @@ -1,4 +1,6 @@ import 'package:flutter/material.dart'; +import 'package:trainhub_flutter/core/theme/app_colors.dart'; +import 'package:trainhub_flutter/core/constants/ui_constants.dart'; import 'package:trainhub_flutter/domain/entities/workout_activity.dart'; class ActivityCard extends StatelessWidget { @@ -8,65 +10,127 @@ class ActivityCard extends StatelessWidget { @override Widget build(BuildContext context) { - final isRest = activity.type == 'rest'; + final isRest = activity.isRest; + final accentColor = isRest ? AppColors.info : AppColors.accent; - return Card( - elevation: 4, - shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)), - child: Padding( - padding: const EdgeInsets.all(24.0), - child: Column( - children: [ - Text( - activity.name, - style: Theme.of(context).textTheme.headlineMedium, - textAlign: TextAlign.center, - ), - const SizedBox(height: 8), - if (!isRest) ...[ - Text( - "${activity.sectionName} • Set ${activity.setIndex}/${activity.totalSets}", - style: Theme.of(context).textTheme.titleMedium?.copyWith( - color: Theme.of(context).colorScheme.secondary, - ), - ), - const SizedBox(height: 16), - if (activity.originalExercise != null) - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - _buildInfo( - context, - "Sets", - "${activity.originalExercise!.sets}", - ), - const SizedBox(width: 24), - _buildInfo( - context, - activity.originalExercise!.isTime ? "Secs" : "Reps", - "${activity.originalExercise!.value}", - ), - ], - ), - ] else - Text( - "Resting...", - style: Theme.of(context).textTheme.titleMedium?.copyWith( - color: Theme.of(context).colorScheme.secondary, - ), - ), - ], + return Container( + padding: const EdgeInsets.symmetric( + horizontal: UIConstants.spacing24, + vertical: UIConstants.spacing16, + ), + decoration: BoxDecoration( + color: AppColors.surfaceContainer.withValues(alpha: 0.6), + borderRadius: UIConstants.cardBorderRadius, + border: Border.all( + color: accentColor.withValues(alpha: 0.2), ), ), + child: Column( + children: [ + // Activity type badge + Container( + padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 4), + decoration: BoxDecoration( + color: accentColor.withValues(alpha: 0.12), + borderRadius: BorderRadius.circular(12), + ), + child: Text( + isRest ? 'REST' : 'WORK', + style: TextStyle( + color: accentColor, + fontSize: 10, + fontWeight: FontWeight.w700, + letterSpacing: 1.5, + ), + ), + ), + const SizedBox(height: UIConstants.spacing12), + // Activity name + Text( + activity.name, + style: const TextStyle( + color: AppColors.textPrimary, + fontSize: 22, + fontWeight: FontWeight.w600, + ), + textAlign: TextAlign.center, + ), + if (!isRest) ...[ + const SizedBox(height: UIConstants.spacing8), + Text( + '${activity.sectionName ?? ''} \u00B7 Set ${activity.setIndex}/${activity.totalSets}', + style: const TextStyle( + color: AppColors.textMuted, + fontSize: 13, + ), + ), + if (activity.originalExercise != null) ...[ + const SizedBox(height: UIConstants.spacing16), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + _InfoChip( + label: 'Sets', + value: '${activity.originalExercise!.sets}', + ), + const SizedBox(width: UIConstants.spacing16), + _InfoChip( + label: activity.originalExercise!.isTime ? 'Secs' : 'Reps', + value: '${activity.originalExercise!.value}', + ), + ], + ), + ], + ] else + Padding( + padding: const EdgeInsets.only(top: UIConstants.spacing8), + child: Text( + 'Take a break', + style: TextStyle( + color: AppColors.textMuted, + fontSize: 14, + ), + ), + ), + ], + ), ); } +} - Widget _buildInfo(BuildContext context, String label, String value) { - return Column( - children: [ - Text(value, style: Theme.of(context).textTheme.headlineSmall), - Text(label, style: Theme.of(context).textTheme.labelMedium), - ], +class _InfoChip extends StatelessWidget { + final String label; + final String value; + + const _InfoChip({required this.label, required this.value}); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8), + decoration: BoxDecoration( + color: AppColors.zinc800.withValues(alpha: 0.5), + borderRadius: BorderRadius.circular(8), + ), + child: Column( + children: [ + Text( + value, + style: const TextStyle( + color: AppColors.textPrimary, + fontSize: 20, + fontWeight: FontWeight.w600, + ), + ), + Text( + label, + style: const TextStyle( + color: AppColors.textMuted, + fontSize: 11, + ), + ), + ], + ), ); } } diff --git a/lib/presentation/workout_session/widgets/session_controls.dart b/lib/presentation/workout_session/widgets/session_controls.dart index b479e1d..ec3442a 100644 --- a/lib/presentation/workout_session/widgets/session_controls.dart +++ b/lib/presentation/workout_session/widgets/session_controls.dart @@ -1,4 +1,6 @@ import 'package:flutter/material.dart'; +import 'package:trainhub_flutter/core/theme/app_colors.dart'; +import 'package:trainhub_flutter/core/constants/ui_constants.dart'; class SessionControls extends StatelessWidget { final bool isRunning; @@ -20,35 +22,109 @@ class SessionControls extends StatelessWidget { @override Widget build(BuildContext context) { - if (isFinished) { - return ElevatedButton( - onPressed: () => Navigator.of(context).pop(), - child: const Text('Finish Workout'), - ); - } + if (isFinished) return const SizedBox.shrink(); - return Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - IconButton.filledTonal( - onPressed: onPrevious, - icon: const Icon(Icons.skip_previous), - iconSize: 32, - ), - const SizedBox(width: 24), - IconButton.filled( - onPressed: isRunning ? onPause : onPlay, - icon: Icon(isRunning ? Icons.pause : Icons.play_arrow), - iconSize: 48, - style: IconButton.styleFrom(padding: const EdgeInsets.all(16)), - ), - const SizedBox(width: 24), - IconButton.filledTonal( - onPressed: onNext, - icon: const Icon(Icons.skip_next), - iconSize: 32, - ), - ], + return Container( + margin: const EdgeInsets.symmetric(horizontal: UIConstants.spacing24), + padding: const EdgeInsets.symmetric( + horizontal: UIConstants.spacing24, + vertical: UIConstants.spacing12, + ), + decoration: BoxDecoration( + color: AppColors.surfaceContainer.withValues(alpha: 0.7), + borderRadius: BorderRadius.circular(40), + border: Border.all(color: AppColors.border.withValues(alpha: 0.5)), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.min, + children: [ + _ControlButton( + icon: Icons.skip_previous_rounded, + onTap: onPrevious, + size: 28, + ), + const SizedBox(width: UIConstants.spacing24), + // Play/Pause - larger main button + Container( + width: 56, + height: 56, + decoration: BoxDecoration( + color: AppColors.zinc50, + shape: BoxShape.circle, + boxShadow: [ + BoxShadow( + color: AppColors.zinc50.withValues(alpha: 0.15), + blurRadius: 16, + spreadRadius: 2, + ), + ], + ), + child: Material( + color: Colors.transparent, + child: InkWell( + onTap: isRunning ? onPause : onPlay, + borderRadius: BorderRadius.circular(28), + child: Icon( + isRunning ? Icons.pause_rounded : Icons.play_arrow_rounded, + color: AppColors.zinc950, + size: 32, + ), + ), + ), + ), + const SizedBox(width: UIConstants.spacing24), + _ControlButton( + icon: Icons.skip_next_rounded, + onTap: onNext, + size: 28, + ), + ], + ), + ); + } +} + +class _ControlButton extends StatefulWidget { + final IconData icon; + final VoidCallback onTap; + final double size; + + const _ControlButton({ + required this.icon, + required this.onTap, + this.size = 24, + }); + + @override + State<_ControlButton> createState() => _ControlButtonState(); +} + +class _ControlButtonState extends State<_ControlButton> { + bool _isHovered = false; + + @override + Widget build(BuildContext context) { + return MouseRegion( + onEnter: (_) => setState(() => _isHovered = true), + onExit: (_) => setState(() => _isHovered = false), + child: GestureDetector( + onTap: widget.onTap, + child: AnimatedContainer( + duration: UIConstants.animationDuration, + width: 44, + height: 44, + decoration: BoxDecoration( + color: _isHovered ? AppColors.zinc700 : Colors.transparent, + shape: BoxShape.circle, + ), + child: Icon( + widget.icon, + color: _isHovered ? AppColors.textPrimary : AppColors.textSecondary, + size: widget.size, + ), + ), + ), ); } } diff --git a/lib/presentation/workout_session/widgets/session_progress_bar.dart b/lib/presentation/workout_session/widgets/session_progress_bar.dart index ab70ebd..d72a38c 100644 --- a/lib/presentation/workout_session/widgets/session_progress_bar.dart +++ b/lib/presentation/workout_session/widgets/session_progress_bar.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:trainhub_flutter/core/theme/app_colors.dart'; class SessionProgressBar extends StatelessWidget { final double progress; @@ -7,10 +8,23 @@ class SessionProgressBar extends StatelessWidget { @override Widget build(BuildContext context) { - return LinearProgressIndicator( - value: progress, - minHeight: 8, - backgroundColor: Theme.of(context).colorScheme.surfaceContainerHighest, + return Container( + height: 4, + color: AppColors.zinc800, + child: FractionallySizedBox( + alignment: Alignment.centerLeft, + widthFactor: progress.clamp(0.0, 1.0), + child: Container( + decoration: BoxDecoration( + gradient: LinearGradient( + colors: [ + AppColors.accent, + AppColors.accent.withValues(alpha: 0.7), + ], + ), + ), + ), + ), ); } } diff --git a/lib/providers/analysis_provider.dart b/lib/providers/analysis_provider.dart deleted file mode 100644 index bdc5145..0000000 --- a/lib/providers/analysis_provider.dart +++ /dev/null @@ -1,117 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:drift/drift.dart'; -import 'package:trainhub_flutter/database/database.dart'; - -class AnalysisProvider extends ChangeNotifier { - final AppDatabase database; - - List _sessions = []; - List _currentAnnotations = []; - AnalysisSession? _activeSession; - - List get sessions => _sessions; - List get currentAnnotations => _currentAnnotations; - AnalysisSession? get activeSession => _activeSession; - - AnalysisProvider(this.database) { - _loadSessions(); - } - - Future _loadSessions() async { - _sessions = await database.select(database.analysisSessions).get(); - notifyListeners(); - } - - Future createSession(String name, String videoPath) async { - final id = DateTime.now().toIso8601String(); - final session = AnalysisSessionsCompanion.insert( - id: id, - name: name, - videoPath: Value(videoPath), - date: DateTime.now().toIso8601String(), - ); - await database.into(database.analysisSessions).insert(session); - await _loadSessions(); - await loadSession(id); - } - - Future deleteSession(String id) async { - await (database.delete( - database.analysisSessions, - )..where((t) => t.id.equals(id))).go(); - if (_activeSession?.id == id) { - _activeSession = null; - _currentAnnotations = []; - } - await _loadSessions(); - } - - Future loadSession(String id) async { - final session = await (database.select( - database.analysisSessions, - )..where((t) => t.id.equals(id))).getSingleOrNull(); - if (session != null) { - _activeSession = session; - await _loadAnnotations(id); - } - } - - Future _loadAnnotations(String sessionId) async { - _currentAnnotations = await (database.select( - database.annotations, - )..where((t) => t.sessionId.equals(sessionId))).get(); - notifyListeners(); - } - - Future addAnnotation({ - required String name, - required String description, - required double startTime, - required double endTime, - required String color, - }) async { - if (_activeSession == null) return; - - final id = DateTime.now().toIso8601String(); - await database - .into(database.annotations) - .insert( - AnnotationsCompanion.insert( - id: id, - sessionId: _activeSession!.id, - name: Value(name), - description: Value(description), - startTime: startTime, - endTime: endTime, - color: Value(color), - ), - ); - await _loadAnnotations(_activeSession!.id); - } - - Future updateAnnotation(Annotation annotation) async { - await (database.update( - database.annotations, - )..where((t) => t.id.equals(annotation.id))).write( - AnnotationsCompanion( - name: Value(annotation.name), - description: Value(annotation.description), - startTime: Value(annotation.startTime), - endTime: Value(annotation.endTime), - color: Value(annotation.color), - ), - ); - if (_activeSession != null) { - await _loadAnnotations(_activeSession!.id); - } - } - - Future deleteAnnotation(String id) async { - await (database.delete( - database.annotations, - )..where((t) => t.id.equals(id))).go(); - if (_activeSession != null) { - await _loadAnnotations(_activeSession!.id); - } - } -} diff --git a/lib/providers/chat_provider.dart b/lib/providers/chat_provider.dart deleted file mode 100644 index 4bfdab0..0000000 --- a/lib/providers/chat_provider.dart +++ /dev/null @@ -1,151 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:drift/drift.dart'; -import 'package:trainhub_flutter/database/database.dart'; - -class ChatProvider extends ChangeNotifier { - final AppDatabase database; - - List _sessions = []; - List _currentMessages = []; - ChatSession? _activeSession; - - List get sessions => _sessions; - List get currentMessages => _currentMessages; - ChatSession? get activeSession => _activeSession; - - bool _isTyping = false; - bool get isTyping => _isTyping; - - ChatProvider(this.database) { - _loadSessions(); - } - - Future _loadSessions() async { - _sessions = - await (database.select(database.chatSessions)..orderBy([ - (t) => OrderingTerm( - expression: t.createdAt, - mode: OrderingMode.desc, - ), - ])) - .get(); - notifyListeners(); - } - - Future createSession() async { - final id = DateTime.now().toIso8601String(); - final session = ChatSessionsCompanion.insert( - id: id, - title: const Value('New Chat'), - createdAt: DateTime.now().toIso8601String(), - updatedAt: DateTime.now().toIso8601String(), - ); - await database.into(database.chatSessions).insert(session); - await _loadSessions(); - await loadSession(id); - } - - Future deleteSession(String id) async { - await (database.delete( - database.chatSessions, - )..where((t) => t.id.equals(id))).go(); - if (_activeSession?.id == id) { - _activeSession = null; - _currentMessages = []; - } - await _loadSessions(); - } - - Future loadSession(String id) async { - final session = await (database.select( - database.chatSessions, - )..where((t) => t.id.equals(id))).getSingleOrNull(); - if (session != null) { - _activeSession = session; - await _loadMessages(id); - } - } - - Future _loadMessages(String sessionId) async { - _currentMessages = - await (database.select(database.chatMessages) - ..where((t) => t.sessionId.equals(sessionId)) - ..orderBy([ - (t) => OrderingTerm( - expression: t.createdAt, - mode: OrderingMode.asc, - ), - ])) - .get(); - notifyListeners(); - } - - Future sendMessage(String content) async { - if (_activeSession == null) { - await createSession(); - } - final sessionId = _activeSession!.id; - - // User Message - final userMsgId = DateTime.now().toIso8601String(); - await database - .into(database.chatMessages) - .insert( - ChatMessagesCompanion.insert( - id: userMsgId, - sessionId: sessionId, - role: 'user', - content: content, - createdAt: DateTime.now().toIso8601String(), - ), - ); - await _loadMessages(sessionId); - - // AI Response (Mock) - _isTyping = true; - notifyListeners(); - - await Future.delayed(const Duration(seconds: 1)); // Simulate latency - - final aiMsgId = DateTime.now().toIso8601String(); - final response = _getMockResponse(content); - - await database - .into(database.chatMessages) - .insert( - ChatMessagesCompanion.insert( - id: aiMsgId, - sessionId: sessionId, - role: 'assistant', - content: response, - createdAt: DateTime.now().toIso8601String(), - ), - ); - - // Update session title if it's the first message - if (_currentMessages.length <= 2) { - final newTitle = content.length > 30 - ? '${content.substring(0, 30)}...' - : content; - await (database.update(database.chatSessions) - ..where((t) => t.id.equals(sessionId))) - .write(ChatSessionsCompanion(title: Value(newTitle))); - await _loadSessions(); - } - - _isTyping = false; - await _loadMessages(sessionId); - } - - String _getMockResponse(String input) { - input = input.toLowerCase(); - if (input.contains('plan') || input.contains('program')) { - return "I can help you design a training plan! What are your goals? Strength, hypertrophy, or endurance?"; - } else if (input.contains('squat') || input.contains('bench')) { - return "Compound movements are great. Remember to maintain proper form. For squats, keep your chest up and knees tracking over toes."; - } else if (input.contains('nutrition') || input.contains('eat')) { - return "Nutrition is key. Aim for 1.6-2.2g of protein per kg of bodyweight if you're training hard."; - } - return "I'm your AI training assistant. How can I help you today?"; - } -} diff --git a/lib/providers/program_provider.dart b/lib/providers/program_provider.dart deleted file mode 100644 index 9ff7b20..0000000 --- a/lib/providers/program_provider.dart +++ /dev/null @@ -1,235 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:drift/drift.dart'; -import 'package:trainhub_flutter/database/database.dart'; - -class ProgramProvider extends ChangeNotifier { - final AppDatabase database; - - List _programs = []; - Program? _activeProgram; - List _activeWeeks = []; - List _activeWorkouts = []; - - List get programs => _programs; - Program? get activeProgram => _activeProgram; - List get activeWeeks => _activeWeeks; - List get activeWorkouts => _activeWorkouts; - - ProgramProvider(this.database) { - _loadPrograms(); - } - - Future _loadPrograms() async { - _programs = - await (database.select(database.programs)..orderBy([ - (t) => OrderingTerm( - expression: t.createdAt, - mode: OrderingMode.desc, - ), - ])) - .get(); - - // Auto-select most recent if none selected, or re-verify active one - if (_activeProgram == null && _programs.isNotEmpty) { - await loadProgram(_programs.first.id); - } else if (_activeProgram != null) { - // Refresh active program data - await loadProgram(_activeProgram!.id); - } else { - notifyListeners(); - } - } - - Future loadProgram(String id) async { - final program = await (database.select( - database.programs, - )..where((t) => t.id.equals(id))).getSingleOrNull(); - if (program != null) { - _activeProgram = program; - await _loadProgramDetails(id); - } else { - _activeProgram = null; - _activeWeeks = []; - _activeWorkouts = []; - notifyListeners(); - } - } - - Future _loadProgramDetails(String programId) async { - _activeWeeks = - await (database.select(database.programWeeks) - ..where((t) => t.programId.equals(programId)) - ..orderBy([(t) => OrderingTerm(expression: t.position)])) - .get(); - - _activeWorkouts = await (database.select( - database.programWorkouts, - )..where((t) => t.programId.equals(programId))).get(); - notifyListeners(); - } - - // --- Program Actions --- - - Future createProgram(String name) async { - final id = DateTime.now().toIso8601String(); - await database - .into(database.programs) - .insert( - ProgramsCompanion.insert( - id: id, - name: name, - createdAt: DateTime.now().toIso8601String(), - ), - ); - await _loadPrograms(); - await loadProgram(id); - } - - Future deleteProgram(String id) async { - await (database.delete( - database.programs, - )..where((t) => t.id.equals(id))).go(); - if (_activeProgram?.id == id) { - _activeProgram = null; - } - await _loadPrograms(); - } - - Future duplicateProgram(String sourceId) async { - final sourceProgram = await (database.select( - database.programs, - )..where((t) => t.id.equals(sourceId))).getSingle(); - - final newId = DateTime.now().toIso8601String(); - await database - .into(database.programs) - .insert( - ProgramsCompanion.insert( - id: newId, - name: '${sourceProgram.name} (Copy)', - createdAt: DateTime.now().toIso8601String(), - ), - ); - - // Duplicate Weeks and Workouts - // Note: implementing deep copy logic - final weeks = await (database.select( - database.programWeeks, - )..where((t) => t.programId.equals(sourceId))).get(); - final workouts = await (database.select( - database.programWorkouts, - )..where((t) => t.programId.equals(sourceId))).get(); - - for (var week in weeks) { - final newWeekId = '${newId}_${week.position}'; // Simple ID gen - await database - .into(database.programWeeks) - .insert( - ProgramWeeksCompanion.insert( - id: newWeekId, - programId: newId, - position: week.position, - notes: Value(week.notes), - ), - ); - - final weekWorkouts = workouts.where((w) => w.weekId == week.id); - for (var workout in weekWorkouts) { - final newWorkoutId = - DateTime.now().toIso8601String() + workout.id; // ensure uniqueness - await database - .into(database.programWorkouts) - .insert( - ProgramWorkoutsCompanion.insert( - id: newWorkoutId, - weekId: newWeekId, - programId: newId, - day: workout.day, - type: workout.type, - refId: Value(workout.refId), - name: Value(workout.name), - description: Value(workout.description), - completed: const Value(false), - ), - ); - } - } - - await _loadPrograms(); - await loadProgram(newId); - } - - // --- Week Actions --- - - Future addWeek() async { - if (_activeProgram == null) return; - final nextPosition = _activeWeeks.isEmpty - ? 1 - : _activeWeeks.last.position + 1; - final id = DateTime.now().toIso8601String(); - - await database - .into(database.programWeeks) - .insert( - ProgramWeeksCompanion.insert( - id: id, - programId: _activeProgram!.id, - position: nextPosition, - ), - ); - await _loadProgramDetails(_activeProgram!.id); - } - - Future deleteWeek(String id) async { - if (_activeProgram == null) return; - await (database.delete( - database.programWeeks, - )..where((t) => t.id.equals(id))).go(); - await _loadProgramDetails(_activeProgram!.id); - } - - Future updateWeekNote(String weekId, String note) async { - await (database.update(database.programWeeks) - ..where((t) => t.id.equals(weekId))) - .write(ProgramWeeksCompanion(notes: Value(note))); - if (_activeProgram != null) await _loadProgramDetails(_activeProgram!.id); - } - - // --- Workout Actions --- - - Future addWorkout(ProgramWorkoutsCompanion workout) async { - await database.into(database.programWorkouts).insert(workout); - if (_activeProgram != null) await _loadProgramDetails(_activeProgram!.id); - } - - Future updateWorkout(ProgramWorkout workout) async { - await (database.update( - database.programWorkouts, - )..where((t) => t.id.equals(workout.id))).write( - ProgramWorkoutsCompanion( - day: Value(workout.day), - type: Value(workout.type), - refId: Value(workout.refId), - name: Value(workout.name), - description: Value(workout.description), - completed: Value(workout.completed), - weekId: Value(workout.weekId), - ), - ); - if (_activeProgram != null) await _loadProgramDetails(_activeProgram!.id); - } - - Future deleteWorkout(String id) async { - await (database.delete( - database.programWorkouts, - )..where((t) => t.id.equals(id))).go(); - if (_activeProgram != null) await _loadProgramDetails(_activeProgram!.id); - } - - Future toggleWorkoutComplete(String id, bool currentStatus) async { - await (database.update(database.programWorkouts) - ..where((t) => t.id.equals(id))) - .write(ProgramWorkoutsCompanion(completed: Value(!currentStatus))); - if (_activeProgram != null) await _loadProgramDetails(_activeProgram!.id); - } -} diff --git a/lib/providers/trainings_provider.dart b/lib/providers/trainings_provider.dart deleted file mode 100644 index 69cafe6..0000000 --- a/lib/providers/trainings_provider.dart +++ /dev/null @@ -1,116 +0,0 @@ -import 'dart:convert'; -import 'package:flutter/material.dart'; -import 'package:drift/drift.dart'; -import 'package:trainhub_flutter/database/database.dart'; -import 'package:trainhub_flutter/models/training_models.dart'; - -class TrainingsProvider extends ChangeNotifier { - final AppDatabase database; - - List _plans = []; - List _exercises = []; - - List get plans => _plans; - List get exercises => _exercises; - - TrainingsProvider(this.database) { - _loadData(); - } - - Future _loadData() async { - final dbPlans = await database.select(database.trainingPlans).get(); - _plans = dbPlans.map((p) { - final sectionsJson = p.sections != null && p.sections!.isNotEmpty - ? jsonDecode(p.sections!) - : []; - // Manual mapping or just pass to model - return TrainingPlanModel.fromJson({ - 'id': p.id, - 'name': p.name, - 'sections': sectionsJson, - }); - }).toList(); - - _exercises = await database.select(database.exercises).get(); - notifyListeners(); - } - - Future createPlan(String name) async { - final id = DateTime.now().toIso8601String(); - await database - .into(database.trainingPlans) - .insert( - TrainingPlansCompanion.insert( - id: id, - name: name, - sections: const Value('[]'), - ), - ); - await _loadData(); - return _plans.firstWhere((p) => p.id == id); - } - - Future updatePlan(TrainingPlanModel plan) async { - await (database.update( - database.trainingPlans, - )..where((t) => t.id.equals(plan.id))).write( - TrainingPlansCompanion( - name: Value(plan.name), - sections: Value( - jsonEncode(plan.sections.map((s) => s.toJson()).toList()), - ), - ), - ); - await _loadData(); - } - - Future deletePlan(String id) async { - await (database.delete( - database.trainingPlans, - )..where((t) => t.id.equals(id))).go(); - await _loadData(); - } - - Future addExercise( - String name, - String instructions, - String tags, - String videoUrl, - ) async { - final id = DateTime.now().toIso8601String(); - await database - .into(database.exercises) - .insert( - ExercisesCompanion.insert( - id: id, - name: name, - instructions: Value(instructions), - tags: Value(tags), // Storing as JSON string - videoUrl: Value(videoUrl), - ), - ); - await _loadData(); - return _exercises.firstWhere((e) => e.id == id); - } - - Future updateExercise(Exercise exercise) async { - await (database.update( - database.exercises, - )..where((t) => t.id.equals(exercise.id))).write( - ExercisesCompanion( - name: Value(exercise.name), - instructions: Value(exercise.instructions), - tags: Value(exercise.tags), - videoUrl: Value(exercise.videoUrl), - ), - ); - await _loadData(); - } - - Future deleteExercise(String id) async { - await (database.delete( - database.exercises, - )..where((t) => t.id.equals(id))).go(); - await _loadData(); - } -} diff --git a/lib/theme.dart b/lib/theme.dart deleted file mode 100644 index 0c7c0e2..0000000 --- a/lib/theme.dart +++ /dev/null @@ -1,38 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:google_fonts/google_fonts.dart'; - -class HTheme { - static final darkTheme = ThemeData( - useMaterial3: true, - brightness: Brightness.dark, - colorScheme: const ColorScheme.dark( - primary: Color(0xFFFAFAFA), // Zinc 50 - onPrimary: Color(0xFF09090B), // Zinc 950 - secondary: Color(0xFFE4E4E7), // Zinc 200 - onSecondary: Color(0xFF09090B), - surface: Color(0xFF09090B), // Zinc 950 - onSurface: Color(0xFFFAFAFA), // Zinc 50 - surfaceContainer: Color(0xFF18181B), // Zinc 900 - ), - scaffoldBackgroundColor: const Color(0xFF09090B), // Zinc 950 - cardTheme: CardThemeData( - color: const Color(0xFF18181B), // Zinc 900 - elevation: 0, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12), - side: BorderSide(color: const Color(0xFF27272A), width: 1), // Zinc 800 - ), - ), - dividerTheme: const DividerThemeData( - color: Color(0xFF27272A), // Zinc 800 - thickness: 1, - ), - textTheme: GoogleFonts.interTextTheme(ThemeData.dark().textTheme).apply( - bodyColor: const Color(0xFFFAFAFA), - displayColor: const Color(0xFFFAFAFA), - ), - iconTheme: const IconThemeData( - color: Color(0xFFA1A1AA), // Zinc 400 - ), - ); -} diff --git a/pubspec.lock b/pubspec.lock index c5d8681..b3c086d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -437,14 +437,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.3" - go_router: - dependency: "direct main" - description: - name: go_router - sha256: c5fa45fa502ee880839e3b2152d987c44abae26d064a2376d4aad434cf0f7b15 - url: "https://pub.dev" - source: hosted - version: "12.1.3" google_fonts: dependency: "direct main" description: @@ -637,14 +629,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.17.4" - nested: - dependency: transitive - description: - name: nested - sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" - url: "https://pub.dev" - source: hosted - version: "1.0.0" objective_c: dependency: transitive description: @@ -757,14 +741,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.5.2" - provider: - dependency: "direct main" - description: - name: provider - sha256: "4e82183fa20e5ca25703ead7e05de9e4cceed1fbd1eadc1ac3cb6f565a09f272" - url: "https://pub.dev" - source: hosted - version: "6.1.5+1" pub_semver: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 0fd3b94..a47d015 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -49,9 +49,6 @@ dependencies: window_manager: ^0.3.9 uuid: ^4.5.1 - # Keep temporarily during migration - provider: ^6.1.1 - go_router: ^12.1.0 dev_dependencies: flutter_test: