mobile bluesky app made with flutter lazurite.stormlightlabs.org/
mobile bluesky flutter
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: post actions (like, repost), saved posts, and profile actions

+4099 -509
+58 -2
lib/core/database/app_database.dart
··· 6 6 7 7 part 'app_database.g.dart'; 8 8 9 - @DriftDatabase(tables: [Accounts, CachedProfiles, CachedPosts, Settings, SavedFeeds, SearchHistory, Drafts]) 9 + @DriftDatabase(tables: [Accounts, CachedProfiles, CachedPosts, Settings, SavedFeeds, SearchHistory, Drafts, SavedPosts]) 10 10 class AppDatabase extends _$AppDatabase { 11 11 AppDatabase({QueryExecutor? executor}) : super(executor ?? _openConnection()); 12 12 13 13 @override 14 - int get schemaVersion => 5; 14 + int get schemaVersion => 6; 15 15 16 16 @override 17 17 MigrationStrategy get migration => MigrationStrategy( ··· 34 34 } 35 35 if (from < 5) { 36 36 await migrator.createTable(drafts); 37 + } 38 + if (from < 6) { 39 + await migrator.createTable(savedPosts); 37 40 } 38 41 }, 39 42 ); ··· 213 216 214 217 Future<int> deleteAllDrafts(String accountDid) async { 215 218 return (delete(drafts)..where((d) => d.accountDid.equals(accountDid))).go(); 219 + } 220 + 221 + Future<List<SavedPostEntry>> getSavedPosts(String accountDid) async { 222 + return (select(savedPosts) 223 + ..where((s) => s.accountDid.equals(accountDid)) 224 + ..orderBy([(s) => OrderingTerm.desc(s.savedAt)])) 225 + .get(); 226 + } 227 + 228 + Future<SavedPostEntry?> getSavedPost(String accountDid, String postUri) async { 229 + return (select( 230 + savedPosts, 231 + )..where((s) => s.accountDid.equals(accountDid) & s.postUri.equals(postUri))).getSingleOrNull(); 232 + } 233 + 234 + Future<bool> isPostSaved(String accountDid, String postUri) async { 235 + final saved = await getSavedPost(accountDid, postUri); 236 + return saved != null; 237 + } 238 + 239 + Future<int> savePost(SavedPostsCompanion post) async { 240 + return into(savedPosts).insert(post); 241 + } 242 + 243 + Future<int> unsavePost(String accountDid, String postUri) async { 244 + return (delete(savedPosts)..where((s) => s.accountDid.equals(accountDid) & s.postUri.equals(postUri))).go(); 245 + } 246 + 247 + Future<int> unsavePostById(int id) async { 248 + return (delete(savedPosts)..where((s) => s.id.equals(id))).go(); 249 + } 250 + 251 + Future<int> deleteAllSavedPosts(String accountDid) async { 252 + return (delete(savedPosts)..where((s) => s.accountDid.equals(accountDid))).go(); 253 + } 254 + 255 + Stream<List<SavedPostEntry>> watchSavedPosts(String accountDid) { 256 + return (select(savedPosts) 257 + ..where((s) => s.accountDid.equals(accountDid)) 258 + ..orderBy([(s) => OrderingTerm.desc(s.savedAt)])) 259 + .watch(); 260 + } 261 + 262 + Stream<bool> watchIsPostSaved(String accountDid, String postUri) { 263 + return (select(savedPosts)..where((s) => s.accountDid.equals(accountDid) & s.postUri.equals(postUri))) 264 + .watchSingleOrNull() 265 + .map((saved) => saved != null); 266 + } 267 + 268 + Stream<Set<String>> watchSavedPostUris(String accountDid) { 269 + return (select( 270 + savedPosts, 271 + )..where((s) => s.accountDid.equals(accountDid))).watch().map((posts) => posts.map((p) => p.postUri).toSet()); 216 272 } 217 273 }
+1948 -501
lib/core/database/app_database.g.dart
··· 26 26 type: DriftSqlType.string, 27 27 requiredDuringInsert: true, 28 28 ); 29 - static const VerificationMeta _displayNameMeta = const VerificationMeta('displayName'); 29 + static const VerificationMeta _displayNameMeta = const VerificationMeta( 30 + 'displayName', 31 + ); 30 32 @override 31 33 late final GeneratedColumn<String> displayName = GeneratedColumn<String>( 32 34 'display_name', ··· 35 37 type: DriftSqlType.string, 36 38 requiredDuringInsert: false, 37 39 ); 38 - static const VerificationMeta _serviceMeta = const VerificationMeta('service'); 40 + static const VerificationMeta _serviceMeta = const VerificationMeta( 41 + 'service', 42 + ); 39 43 @override 40 44 late final GeneratedColumn<String> service = GeneratedColumn<String>( 41 45 'service', ··· 44 48 type: DriftSqlType.string, 45 49 requiredDuringInsert: false, 46 50 ); 47 - static const VerificationMeta _accessTokenMeta = const VerificationMeta('accessToken'); 51 + static const VerificationMeta _accessTokenMeta = const VerificationMeta( 52 + 'accessToken', 53 + ); 48 54 @override 49 55 late final GeneratedColumn<String> accessToken = GeneratedColumn<String>( 50 56 'access_token', ··· 53 59 type: DriftSqlType.string, 54 60 requiredDuringInsert: true, 55 61 ); 56 - static const VerificationMeta _refreshTokenMeta = const VerificationMeta('refreshToken'); 62 + static const VerificationMeta _refreshTokenMeta = const VerificationMeta( 63 + 'refreshToken', 64 + ); 57 65 @override 58 66 late final GeneratedColumn<String> refreshToken = GeneratedColumn<String>( 59 67 'refresh_token', ··· 62 70 type: DriftSqlType.string, 63 71 requiredDuringInsert: false, 64 72 ); 65 - static const VerificationMeta _dpopPublicKeyMeta = const VerificationMeta('dpopPublicKey'); 73 + static const VerificationMeta _dpopPublicKeyMeta = const VerificationMeta( 74 + 'dpopPublicKey', 75 + ); 66 76 @override 67 77 late final GeneratedColumn<String> dpopPublicKey = GeneratedColumn<String>( 68 78 'dpop_public_key', ··· 71 81 type: DriftSqlType.string, 72 82 requiredDuringInsert: false, 73 83 ); 74 - static const VerificationMeta _dpopPrivateKeyMeta = const VerificationMeta('dpopPrivateKey'); 84 + static const VerificationMeta _dpopPrivateKeyMeta = const VerificationMeta( 85 + 'dpopPrivateKey', 86 + ); 75 87 @override 76 88 late final GeneratedColumn<String> dpopPrivateKey = GeneratedColumn<String>( 77 89 'dpop_private_key', ··· 80 92 type: DriftSqlType.string, 81 93 requiredDuringInsert: false, 82 94 ); 83 - static const VerificationMeta _dpopNonceMeta = const VerificationMeta('dpopNonce'); 95 + static const VerificationMeta _dpopNonceMeta = const VerificationMeta( 96 + 'dpopNonce', 97 + ); 84 98 @override 85 99 late final GeneratedColumn<String> dpopNonce = GeneratedColumn<String>( 86 100 'dpop_nonce', ··· 89 103 type: DriftSqlType.string, 90 104 requiredDuringInsert: false, 91 105 ); 92 - static const VerificationMeta _expiresAtMeta = const VerificationMeta('expiresAt'); 106 + static const VerificationMeta _expiresAtMeta = const VerificationMeta( 107 + 'expiresAt', 108 + ); 93 109 @override 94 110 late final GeneratedColumn<DateTime> expiresAt = GeneratedColumn<DateTime>( 95 111 'expires_at', ··· 98 114 type: DriftSqlType.dateTime, 99 115 requiredDuringInsert: false, 100 116 ); 101 - static const VerificationMeta _createdAtMeta = const VerificationMeta('createdAt'); 117 + static const VerificationMeta _createdAtMeta = const VerificationMeta( 118 + 'createdAt', 119 + ); 102 120 @override 103 121 late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>( 104 122 'created_at', ··· 108 126 requiredDuringInsert: false, 109 127 defaultValue: currentDateAndTime, 110 128 ); 111 - static const VerificationMeta _updatedAtMeta = const VerificationMeta('updatedAt'); 129 + static const VerificationMeta _updatedAtMeta = const VerificationMeta( 130 + 'updatedAt', 131 + ); 112 132 @override 113 133 late final GeneratedColumn<DateTime> updatedAt = GeneratedColumn<DateTime>( 114 134 'updated_at', ··· 139 159 String get actualTableName => $name; 140 160 static const String $name = 'accounts'; 141 161 @override 142 - VerificationContext validateIntegrity(Insertable<Account> instance, {bool isInserting = false}) { 162 + VerificationContext validateIntegrity( 163 + Insertable<Account> instance, { 164 + bool isInserting = false, 165 + }) { 143 166 final context = VerificationContext(); 144 167 final data = instance.toColumns(true); 145 168 if (data.containsKey('did')) { 146 - context.handle(_didMeta, did.isAcceptableOrUnknown(data['did']!, _didMeta)); 169 + context.handle( 170 + _didMeta, 171 + did.isAcceptableOrUnknown(data['did']!, _didMeta), 172 + ); 147 173 } else if (isInserting) { 148 174 context.missing(_didMeta); 149 175 } 150 176 if (data.containsKey('handle')) { 151 - context.handle(_handleMeta, handle.isAcceptableOrUnknown(data['handle']!, _handleMeta)); 177 + context.handle( 178 + _handleMeta, 179 + handle.isAcceptableOrUnknown(data['handle']!, _handleMeta), 180 + ); 152 181 } else if (isInserting) { 153 182 context.missing(_handleMeta); 154 183 } 155 184 if (data.containsKey('display_name')) { 156 - context.handle(_displayNameMeta, displayName.isAcceptableOrUnknown(data['display_name']!, _displayNameMeta)); 185 + context.handle( 186 + _displayNameMeta, 187 + displayName.isAcceptableOrUnknown( 188 + data['display_name']!, 189 + _displayNameMeta, 190 + ), 191 + ); 157 192 } 158 193 if (data.containsKey('service')) { 159 - context.handle(_serviceMeta, service.isAcceptableOrUnknown(data['service']!, _serviceMeta)); 194 + context.handle( 195 + _serviceMeta, 196 + service.isAcceptableOrUnknown(data['service']!, _serviceMeta), 197 + ); 160 198 } 161 199 if (data.containsKey('access_token')) { 162 - context.handle(_accessTokenMeta, accessToken.isAcceptableOrUnknown(data['access_token']!, _accessTokenMeta)); 200 + context.handle( 201 + _accessTokenMeta, 202 + accessToken.isAcceptableOrUnknown( 203 + data['access_token']!, 204 + _accessTokenMeta, 205 + ), 206 + ); 163 207 } else if (isInserting) { 164 208 context.missing(_accessTokenMeta); 165 209 } 166 210 if (data.containsKey('refresh_token')) { 167 - context.handle(_refreshTokenMeta, refreshToken.isAcceptableOrUnknown(data['refresh_token']!, _refreshTokenMeta)); 211 + context.handle( 212 + _refreshTokenMeta, 213 + refreshToken.isAcceptableOrUnknown( 214 + data['refresh_token']!, 215 + _refreshTokenMeta, 216 + ), 217 + ); 168 218 } 169 219 if (data.containsKey('dpop_public_key')) { 170 220 context.handle( 171 221 _dpopPublicKeyMeta, 172 - dpopPublicKey.isAcceptableOrUnknown(data['dpop_public_key']!, _dpopPublicKeyMeta), 222 + dpopPublicKey.isAcceptableOrUnknown( 223 + data['dpop_public_key']!, 224 + _dpopPublicKeyMeta, 225 + ), 173 226 ); 174 227 } 175 228 if (data.containsKey('dpop_private_key')) { 176 229 context.handle( 177 230 _dpopPrivateKeyMeta, 178 - dpopPrivateKey.isAcceptableOrUnknown(data['dpop_private_key']!, _dpopPrivateKeyMeta), 231 + dpopPrivateKey.isAcceptableOrUnknown( 232 + data['dpop_private_key']!, 233 + _dpopPrivateKeyMeta, 234 + ), 179 235 ); 180 236 } 181 237 if (data.containsKey('dpop_nonce')) { 182 - context.handle(_dpopNonceMeta, dpopNonce.isAcceptableOrUnknown(data['dpop_nonce']!, _dpopNonceMeta)); 238 + context.handle( 239 + _dpopNonceMeta, 240 + dpopNonce.isAcceptableOrUnknown(data['dpop_nonce']!, _dpopNonceMeta), 241 + ); 183 242 } 184 243 if (data.containsKey('expires_at')) { 185 - context.handle(_expiresAtMeta, expiresAt.isAcceptableOrUnknown(data['expires_at']!, _expiresAtMeta)); 244 + context.handle( 245 + _expiresAtMeta, 246 + expiresAt.isAcceptableOrUnknown(data['expires_at']!, _expiresAtMeta), 247 + ); 186 248 } 187 249 if (data.containsKey('created_at')) { 188 - context.handle(_createdAtMeta, createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta)); 250 + context.handle( 251 + _createdAtMeta, 252 + createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta), 253 + ); 189 254 } 190 255 if (data.containsKey('updated_at')) { 191 - context.handle(_updatedAtMeta, updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta)); 256 + context.handle( 257 + _updatedAtMeta, 258 + updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta), 259 + ); 192 260 } 193 261 return context; 194 262 } ··· 199 267 Account map(Map<String, dynamic> data, {String? tablePrefix}) { 200 268 final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; 201 269 return Account( 202 - did: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}did'])!, 203 - handle: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}handle'])!, 204 - displayName: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}display_name']), 205 - service: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}service']), 206 - accessToken: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}access_token'])!, 207 - refreshToken: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}refresh_token']), 208 - dpopPublicKey: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}dpop_public_key']), 270 + did: attachedDatabase.typeMapping.read( 271 + DriftSqlType.string, 272 + data['${effectivePrefix}did'], 273 + )!, 274 + handle: attachedDatabase.typeMapping.read( 275 + DriftSqlType.string, 276 + data['${effectivePrefix}handle'], 277 + )!, 278 + displayName: attachedDatabase.typeMapping.read( 279 + DriftSqlType.string, 280 + data['${effectivePrefix}display_name'], 281 + ), 282 + service: attachedDatabase.typeMapping.read( 283 + DriftSqlType.string, 284 + data['${effectivePrefix}service'], 285 + ), 286 + accessToken: attachedDatabase.typeMapping.read( 287 + DriftSqlType.string, 288 + data['${effectivePrefix}access_token'], 289 + )!, 290 + refreshToken: attachedDatabase.typeMapping.read( 291 + DriftSqlType.string, 292 + data['${effectivePrefix}refresh_token'], 293 + ), 294 + dpopPublicKey: attachedDatabase.typeMapping.read( 295 + DriftSqlType.string, 296 + data['${effectivePrefix}dpop_public_key'], 297 + ), 209 298 dpopPrivateKey: attachedDatabase.typeMapping.read( 210 299 DriftSqlType.string, 211 300 data['${effectivePrefix}dpop_private_key'], 212 301 ), 213 - dpopNonce: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}dpop_nonce']), 214 - expiresAt: attachedDatabase.typeMapping.read(DriftSqlType.dateTime, data['${effectivePrefix}expires_at']), 215 - createdAt: attachedDatabase.typeMapping.read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, 216 - updatedAt: attachedDatabase.typeMapping.read(DriftSqlType.dateTime, data['${effectivePrefix}updated_at'])!, 302 + dpopNonce: attachedDatabase.typeMapping.read( 303 + DriftSqlType.string, 304 + data['${effectivePrefix}dpop_nonce'], 305 + ), 306 + expiresAt: attachedDatabase.typeMapping.read( 307 + DriftSqlType.dateTime, 308 + data['${effectivePrefix}expires_at'], 309 + ), 310 + createdAt: attachedDatabase.typeMapping.read( 311 + DriftSqlType.dateTime, 312 + data['${effectivePrefix}created_at'], 313 + )!, 314 + updatedAt: attachedDatabase.typeMapping.read( 315 + DriftSqlType.dateTime, 316 + data['${effectivePrefix}updated_at'], 317 + )!, 217 318 ); 218 319 } 219 320 ··· 286 387 return AccountsCompanion( 287 388 did: Value(did), 288 389 handle: Value(handle), 289 - displayName: displayName == null && nullToAbsent ? const Value.absent() : Value(displayName), 290 - service: service == null && nullToAbsent ? const Value.absent() : Value(service), 390 + displayName: displayName == null && nullToAbsent 391 + ? const Value.absent() 392 + : Value(displayName), 393 + service: service == null && nullToAbsent 394 + ? const Value.absent() 395 + : Value(service), 291 396 accessToken: Value(accessToken), 292 - refreshToken: refreshToken == null && nullToAbsent ? const Value.absent() : Value(refreshToken), 293 - dpopPublicKey: dpopPublicKey == null && nullToAbsent ? const Value.absent() : Value(dpopPublicKey), 294 - dpopPrivateKey: dpopPrivateKey == null && nullToAbsent ? const Value.absent() : Value(dpopPrivateKey), 295 - dpopNonce: dpopNonce == null && nullToAbsent ? const Value.absent() : Value(dpopNonce), 296 - expiresAt: expiresAt == null && nullToAbsent ? const Value.absent() : Value(expiresAt), 397 + refreshToken: refreshToken == null && nullToAbsent 398 + ? const Value.absent() 399 + : Value(refreshToken), 400 + dpopPublicKey: dpopPublicKey == null && nullToAbsent 401 + ? const Value.absent() 402 + : Value(dpopPublicKey), 403 + dpopPrivateKey: dpopPrivateKey == null && nullToAbsent 404 + ? const Value.absent() 405 + : Value(dpopPrivateKey), 406 + dpopNonce: dpopNonce == null && nullToAbsent 407 + ? const Value.absent() 408 + : Value(dpopNonce), 409 + expiresAt: expiresAt == null && nullToAbsent 410 + ? const Value.absent() 411 + : Value(expiresAt), 297 412 createdAt: Value(createdAt), 298 413 updatedAt: Value(updatedAt), 299 414 ); 300 415 } 301 416 302 - factory Account.fromJson(Map<String, dynamic> json, {ValueSerializer? serializer}) { 417 + factory Account.fromJson( 418 + Map<String, dynamic> json, { 419 + ValueSerializer? serializer, 420 + }) { 303 421 serializer ??= driftRuntimeOptions.defaultSerializer; 304 422 return Account( 305 423 did: serializer.fromJson<String>(json['did']), ··· 355 473 service: service.present ? service.value : this.service, 356 474 accessToken: accessToken ?? this.accessToken, 357 475 refreshToken: refreshToken.present ? refreshToken.value : this.refreshToken, 358 - dpopPublicKey: dpopPublicKey.present ? dpopPublicKey.value : this.dpopPublicKey, 359 - dpopPrivateKey: dpopPrivateKey.present ? dpopPrivateKey.value : this.dpopPrivateKey, 476 + dpopPublicKey: dpopPublicKey.present 477 + ? dpopPublicKey.value 478 + : this.dpopPublicKey, 479 + dpopPrivateKey: dpopPrivateKey.present 480 + ? dpopPrivateKey.value 481 + : this.dpopPrivateKey, 360 482 dpopNonce: dpopNonce.present ? dpopNonce.value : this.dpopNonce, 361 483 expiresAt: expiresAt.present ? expiresAt.value : this.expiresAt, 362 484 createdAt: createdAt ?? this.createdAt, ··· 366 488 return Account( 367 489 did: data.did.present ? data.did.value : this.did, 368 490 handle: data.handle.present ? data.handle.value : this.handle, 369 - displayName: data.displayName.present ? data.displayName.value : this.displayName, 491 + displayName: data.displayName.present 492 + ? data.displayName.value 493 + : this.displayName, 370 494 service: data.service.present ? data.service.value : this.service, 371 - accessToken: data.accessToken.present ? data.accessToken.value : this.accessToken, 372 - refreshToken: data.refreshToken.present ? data.refreshToken.value : this.refreshToken, 373 - dpopPublicKey: data.dpopPublicKey.present ? data.dpopPublicKey.value : this.dpopPublicKey, 374 - dpopPrivateKey: data.dpopPrivateKey.present ? data.dpopPrivateKey.value : this.dpopPrivateKey, 495 + accessToken: data.accessToken.present 496 + ? data.accessToken.value 497 + : this.accessToken, 498 + refreshToken: data.refreshToken.present 499 + ? data.refreshToken.value 500 + : this.refreshToken, 501 + dpopPublicKey: data.dpopPublicKey.present 502 + ? data.dpopPublicKey.value 503 + : this.dpopPublicKey, 504 + dpopPrivateKey: data.dpopPrivateKey.present 505 + ? data.dpopPrivateKey.value 506 + : this.dpopPrivateKey, 375 507 dpopNonce: data.dpopNonce.present ? data.dpopNonce.value : this.dpopNonce, 376 508 expiresAt: data.expiresAt.present ? data.expiresAt.value : this.expiresAt, 377 509 createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, ··· 607 739 } 608 740 } 609 741 610 - class $CachedProfilesTable extends CachedProfiles with TableInfo<$CachedProfilesTable, CachedProfile> { 742 + class $CachedProfilesTable extends CachedProfiles 743 + with TableInfo<$CachedProfilesTable, CachedProfile> { 611 744 @override 612 745 final GeneratedDatabase attachedDatabase; 613 746 final String? _alias; ··· 630 763 type: DriftSqlType.string, 631 764 requiredDuringInsert: true, 632 765 ); 633 - static const VerificationMeta _payloadMeta = const VerificationMeta('payload'); 766 + static const VerificationMeta _payloadMeta = const VerificationMeta( 767 + 'payload', 768 + ); 634 769 @override 635 770 late final GeneratedColumn<String> payload = GeneratedColumn<String>( 636 771 'payload', ··· 639 774 type: DriftSqlType.string, 640 775 requiredDuringInsert: true, 641 776 ); 642 - static const VerificationMeta _fetchedAtMeta = const VerificationMeta('fetchedAt'); 777 + static const VerificationMeta _fetchedAtMeta = const VerificationMeta( 778 + 'fetchedAt', 779 + ); 643 780 @override 644 781 late final GeneratedColumn<DateTime> fetchedAt = GeneratedColumn<DateTime>( 645 782 'fetched_at', ··· 657 794 String get actualTableName => $name; 658 795 static const String $name = 'cached_profiles'; 659 796 @override 660 - VerificationContext validateIntegrity(Insertable<CachedProfile> instance, {bool isInserting = false}) { 797 + VerificationContext validateIntegrity( 798 + Insertable<CachedProfile> instance, { 799 + bool isInserting = false, 800 + }) { 661 801 final context = VerificationContext(); 662 802 final data = instance.toColumns(true); 663 803 if (data.containsKey('did')) { 664 - context.handle(_didMeta, did.isAcceptableOrUnknown(data['did']!, _didMeta)); 804 + context.handle( 805 + _didMeta, 806 + did.isAcceptableOrUnknown(data['did']!, _didMeta), 807 + ); 665 808 } else if (isInserting) { 666 809 context.missing(_didMeta); 667 810 } 668 811 if (data.containsKey('handle')) { 669 - context.handle(_handleMeta, handle.isAcceptableOrUnknown(data['handle']!, _handleMeta)); 812 + context.handle( 813 + _handleMeta, 814 + handle.isAcceptableOrUnknown(data['handle']!, _handleMeta), 815 + ); 670 816 } else if (isInserting) { 671 817 context.missing(_handleMeta); 672 818 } 673 819 if (data.containsKey('payload')) { 674 - context.handle(_payloadMeta, payload.isAcceptableOrUnknown(data['payload']!, _payloadMeta)); 820 + context.handle( 821 + _payloadMeta, 822 + payload.isAcceptableOrUnknown(data['payload']!, _payloadMeta), 823 + ); 675 824 } else if (isInserting) { 676 825 context.missing(_payloadMeta); 677 826 } 678 827 if (data.containsKey('fetched_at')) { 679 - context.handle(_fetchedAtMeta, fetchedAt.isAcceptableOrUnknown(data['fetched_at']!, _fetchedAtMeta)); 828 + context.handle( 829 + _fetchedAtMeta, 830 + fetchedAt.isAcceptableOrUnknown(data['fetched_at']!, _fetchedAtMeta), 831 + ); 680 832 } 681 833 return context; 682 834 } ··· 687 839 CachedProfile map(Map<String, dynamic> data, {String? tablePrefix}) { 688 840 final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; 689 841 return CachedProfile( 690 - did: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}did'])!, 691 - handle: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}handle'])!, 692 - payload: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}payload'])!, 693 - fetchedAt: attachedDatabase.typeMapping.read(DriftSqlType.dateTime, data['${effectivePrefix}fetched_at'])!, 842 + did: attachedDatabase.typeMapping.read( 843 + DriftSqlType.string, 844 + data['${effectivePrefix}did'], 845 + )!, 846 + handle: attachedDatabase.typeMapping.read( 847 + DriftSqlType.string, 848 + data['${effectivePrefix}handle'], 849 + )!, 850 + payload: attachedDatabase.typeMapping.read( 851 + DriftSqlType.string, 852 + data['${effectivePrefix}payload'], 853 + )!, 854 + fetchedAt: attachedDatabase.typeMapping.read( 855 + DriftSqlType.dateTime, 856 + data['${effectivePrefix}fetched_at'], 857 + )!, 694 858 ); 695 859 } 696 860 ··· 705 869 final String handle; 706 870 final String payload; 707 871 final DateTime fetchedAt; 708 - const CachedProfile({required this.did, required this.handle, required this.payload, required this.fetchedAt}); 872 + const CachedProfile({ 873 + required this.did, 874 + required this.handle, 875 + required this.payload, 876 + required this.fetchedAt, 877 + }); 709 878 @override 710 879 Map<String, Expression> toColumns(bool nullToAbsent) { 711 880 final map = <String, Expression>{}; ··· 725 894 ); 726 895 } 727 896 728 - factory CachedProfile.fromJson(Map<String, dynamic> json, {ValueSerializer? serializer}) { 897 + factory CachedProfile.fromJson( 898 + Map<String, dynamic> json, { 899 + ValueSerializer? serializer, 900 + }) { 729 901 serializer ??= driftRuntimeOptions.defaultSerializer; 730 902 return CachedProfile( 731 903 did: serializer.fromJson<String>(json['did']), ··· 745 917 }; 746 918 } 747 919 748 - CachedProfile copyWith({String? did, String? handle, String? payload, DateTime? fetchedAt}) => CachedProfile( 920 + CachedProfile copyWith({ 921 + String? did, 922 + String? handle, 923 + String? payload, 924 + DateTime? fetchedAt, 925 + }) => CachedProfile( 749 926 did: did ?? this.did, 750 927 handle: handle ?? this.handle, 751 928 payload: payload ?? this.payload, ··· 871 1048 } 872 1049 } 873 1050 874 - class $CachedPostsTable extends CachedPosts with TableInfo<$CachedPostsTable, CachedPost> { 1051 + class $CachedPostsTable extends CachedPosts 1052 + with TableInfo<$CachedPostsTable, CachedPost> { 875 1053 @override 876 1054 final GeneratedDatabase attachedDatabase; 877 1055 final String? _alias; ··· 885 1063 type: DriftSqlType.string, 886 1064 requiredDuringInsert: true, 887 1065 ); 888 - static const VerificationMeta _authorDidMeta = const VerificationMeta('authorDid'); 1066 + static const VerificationMeta _authorDidMeta = const VerificationMeta( 1067 + 'authorDid', 1068 + ); 889 1069 @override 890 1070 late final GeneratedColumn<String> authorDid = GeneratedColumn<String>( 891 1071 'author_did', ··· 894 1074 type: DriftSqlType.string, 895 1075 requiredDuringInsert: true, 896 1076 ); 897 - static const VerificationMeta _payloadMeta = const VerificationMeta('payload'); 1077 + static const VerificationMeta _payloadMeta = const VerificationMeta( 1078 + 'payload', 1079 + ); 898 1080 @override 899 1081 late final GeneratedColumn<String> payload = GeneratedColumn<String>( 900 1082 'payload', ··· 903 1085 type: DriftSqlType.string, 904 1086 requiredDuringInsert: true, 905 1087 ); 906 - static const VerificationMeta _createdAtMeta = const VerificationMeta('createdAt'); 1088 + static const VerificationMeta _createdAtMeta = const VerificationMeta( 1089 + 'createdAt', 1090 + ); 907 1091 @override 908 1092 late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>( 909 1093 'created_at', ··· 912 1096 type: DriftSqlType.dateTime, 913 1097 requiredDuringInsert: false, 914 1098 ); 915 - static const VerificationMeta _fetchedAtMeta = const VerificationMeta('fetchedAt'); 1099 + static const VerificationMeta _fetchedAtMeta = const VerificationMeta( 1100 + 'fetchedAt', 1101 + ); 916 1102 @override 917 1103 late final GeneratedColumn<DateTime> fetchedAt = GeneratedColumn<DateTime>( 918 1104 'fetched_at', ··· 923 1109 defaultValue: currentDateAndTime, 924 1110 ); 925 1111 @override 926 - List<GeneratedColumn> get $columns => [uri, authorDid, payload, createdAt, fetchedAt]; 1112 + List<GeneratedColumn> get $columns => [ 1113 + uri, 1114 + authorDid, 1115 + payload, 1116 + createdAt, 1117 + fetchedAt, 1118 + ]; 927 1119 @override 928 1120 String get aliasedName => _alias ?? actualTableName; 929 1121 @override 930 1122 String get actualTableName => $name; 931 1123 static const String $name = 'cached_posts'; 932 1124 @override 933 - VerificationContext validateIntegrity(Insertable<CachedPost> instance, {bool isInserting = false}) { 1125 + VerificationContext validateIntegrity( 1126 + Insertable<CachedPost> instance, { 1127 + bool isInserting = false, 1128 + }) { 934 1129 final context = VerificationContext(); 935 1130 final data = instance.toColumns(true); 936 1131 if (data.containsKey('uri')) { 937 - context.handle(_uriMeta, uri.isAcceptableOrUnknown(data['uri']!, _uriMeta)); 1132 + context.handle( 1133 + _uriMeta, 1134 + uri.isAcceptableOrUnknown(data['uri']!, _uriMeta), 1135 + ); 938 1136 } else if (isInserting) { 939 1137 context.missing(_uriMeta); 940 1138 } 941 1139 if (data.containsKey('author_did')) { 942 - context.handle(_authorDidMeta, authorDid.isAcceptableOrUnknown(data['author_did']!, _authorDidMeta)); 1140 + context.handle( 1141 + _authorDidMeta, 1142 + authorDid.isAcceptableOrUnknown(data['author_did']!, _authorDidMeta), 1143 + ); 943 1144 } else if (isInserting) { 944 1145 context.missing(_authorDidMeta); 945 1146 } 946 1147 if (data.containsKey('payload')) { 947 - context.handle(_payloadMeta, payload.isAcceptableOrUnknown(data['payload']!, _payloadMeta)); 1148 + context.handle( 1149 + _payloadMeta, 1150 + payload.isAcceptableOrUnknown(data['payload']!, _payloadMeta), 1151 + ); 948 1152 } else if (isInserting) { 949 1153 context.missing(_payloadMeta); 950 1154 } 951 1155 if (data.containsKey('created_at')) { 952 - context.handle(_createdAtMeta, createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta)); 1156 + context.handle( 1157 + _createdAtMeta, 1158 + createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta), 1159 + ); 953 1160 } 954 1161 if (data.containsKey('fetched_at')) { 955 - context.handle(_fetchedAtMeta, fetchedAt.isAcceptableOrUnknown(data['fetched_at']!, _fetchedAtMeta)); 1162 + context.handle( 1163 + _fetchedAtMeta, 1164 + fetchedAt.isAcceptableOrUnknown(data['fetched_at']!, _fetchedAtMeta), 1165 + ); 956 1166 } 957 1167 return context; 958 1168 } ··· 963 1173 CachedPost map(Map<String, dynamic> data, {String? tablePrefix}) { 964 1174 final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; 965 1175 return CachedPost( 966 - uri: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}uri'])!, 967 - authorDid: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}author_did'])!, 968 - payload: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}payload'])!, 969 - createdAt: attachedDatabase.typeMapping.read(DriftSqlType.dateTime, data['${effectivePrefix}created_at']), 970 - fetchedAt: attachedDatabase.typeMapping.read(DriftSqlType.dateTime, data['${effectivePrefix}fetched_at'])!, 1176 + uri: attachedDatabase.typeMapping.read( 1177 + DriftSqlType.string, 1178 + data['${effectivePrefix}uri'], 1179 + )!, 1180 + authorDid: attachedDatabase.typeMapping.read( 1181 + DriftSqlType.string, 1182 + data['${effectivePrefix}author_did'], 1183 + )!, 1184 + payload: attachedDatabase.typeMapping.read( 1185 + DriftSqlType.string, 1186 + data['${effectivePrefix}payload'], 1187 + )!, 1188 + createdAt: attachedDatabase.typeMapping.read( 1189 + DriftSqlType.dateTime, 1190 + data['${effectivePrefix}created_at'], 1191 + ), 1192 + fetchedAt: attachedDatabase.typeMapping.read( 1193 + DriftSqlType.dateTime, 1194 + data['${effectivePrefix}fetched_at'], 1195 + )!, 971 1196 ); 972 1197 } 973 1198 ··· 1008 1233 uri: Value(uri), 1009 1234 authorDid: Value(authorDid), 1010 1235 payload: Value(payload), 1011 - createdAt: createdAt == null && nullToAbsent ? const Value.absent() : Value(createdAt), 1236 + createdAt: createdAt == null && nullToAbsent 1237 + ? const Value.absent() 1238 + : Value(createdAt), 1012 1239 fetchedAt: Value(fetchedAt), 1013 1240 ); 1014 1241 } 1015 1242 1016 - factory CachedPost.fromJson(Map<String, dynamic> json, {ValueSerializer? serializer}) { 1243 + factory CachedPost.fromJson( 1244 + Map<String, dynamic> json, { 1245 + ValueSerializer? serializer, 1246 + }) { 1017 1247 serializer ??= driftRuntimeOptions.defaultSerializer; 1018 1248 return CachedPost( 1019 1249 uri: serializer.fromJson<String>(json['uri']), ··· 1071 1301 } 1072 1302 1073 1303 @override 1074 - int get hashCode => Object.hash(uri, authorDid, payload, createdAt, fetchedAt); 1304 + int get hashCode => 1305 + Object.hash(uri, authorDid, payload, createdAt, fetchedAt); 1075 1306 @override 1076 1307 bool operator ==(Object other) => 1077 1308 identical(this, other) || ··· 1182 1413 } 1183 1414 } 1184 1415 1185 - class $SettingsTable extends Settings with TableInfo<$SettingsTable, SettingsEntry> { 1416 + class $SettingsTable extends Settings 1417 + with TableInfo<$SettingsTable, SettingsEntry> { 1186 1418 @override 1187 1419 final GeneratedDatabase attachedDatabase; 1188 1420 final String? _alias; ··· 1205 1437 type: DriftSqlType.string, 1206 1438 requiredDuringInsert: true, 1207 1439 ); 1208 - static const VerificationMeta _updatedAtMeta = const VerificationMeta('updatedAt'); 1440 + static const VerificationMeta _updatedAtMeta = const VerificationMeta( 1441 + 'updatedAt', 1442 + ); 1209 1443 @override 1210 1444 late final GeneratedColumn<DateTime> updatedAt = GeneratedColumn<DateTime>( 1211 1445 'updated_at', ··· 1223 1457 String get actualTableName => $name; 1224 1458 static const String $name = 'settings'; 1225 1459 @override 1226 - VerificationContext validateIntegrity(Insertable<SettingsEntry> instance, {bool isInserting = false}) { 1460 + VerificationContext validateIntegrity( 1461 + Insertable<SettingsEntry> instance, { 1462 + bool isInserting = false, 1463 + }) { 1227 1464 final context = VerificationContext(); 1228 1465 final data = instance.toColumns(true); 1229 1466 if (data.containsKey('key')) { 1230 - context.handle(_keyMeta, key.isAcceptableOrUnknown(data['key']!, _keyMeta)); 1467 + context.handle( 1468 + _keyMeta, 1469 + key.isAcceptableOrUnknown(data['key']!, _keyMeta), 1470 + ); 1231 1471 } else if (isInserting) { 1232 1472 context.missing(_keyMeta); 1233 1473 } 1234 1474 if (data.containsKey('value')) { 1235 - context.handle(_valueMeta, value.isAcceptableOrUnknown(data['value']!, _valueMeta)); 1475 + context.handle( 1476 + _valueMeta, 1477 + value.isAcceptableOrUnknown(data['value']!, _valueMeta), 1478 + ); 1236 1479 } else if (isInserting) { 1237 1480 context.missing(_valueMeta); 1238 1481 } 1239 1482 if (data.containsKey('updated_at')) { 1240 - context.handle(_updatedAtMeta, updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta)); 1483 + context.handle( 1484 + _updatedAtMeta, 1485 + updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta), 1486 + ); 1241 1487 } 1242 1488 return context; 1243 1489 } ··· 1248 1494 SettingsEntry map(Map<String, dynamic> data, {String? tablePrefix}) { 1249 1495 final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; 1250 1496 return SettingsEntry( 1251 - key: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}key'])!, 1252 - value: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}value'])!, 1253 - updatedAt: attachedDatabase.typeMapping.read(DriftSqlType.dateTime, data['${effectivePrefix}updated_at'])!, 1497 + key: attachedDatabase.typeMapping.read( 1498 + DriftSqlType.string, 1499 + data['${effectivePrefix}key'], 1500 + )!, 1501 + value: attachedDatabase.typeMapping.read( 1502 + DriftSqlType.string, 1503 + data['${effectivePrefix}value'], 1504 + )!, 1505 + updatedAt: attachedDatabase.typeMapping.read( 1506 + DriftSqlType.dateTime, 1507 + data['${effectivePrefix}updated_at'], 1508 + )!, 1254 1509 ); 1255 1510 } 1256 1511 ··· 1264 1519 final String key; 1265 1520 final String value; 1266 1521 final DateTime updatedAt; 1267 - const SettingsEntry({required this.key, required this.value, required this.updatedAt}); 1522 + const SettingsEntry({ 1523 + required this.key, 1524 + required this.value, 1525 + required this.updatedAt, 1526 + }); 1268 1527 @override 1269 1528 Map<String, Expression> toColumns(bool nullToAbsent) { 1270 1529 final map = <String, Expression>{}; ··· 1275 1534 } 1276 1535 1277 1536 SettingsCompanion toCompanion(bool nullToAbsent) { 1278 - return SettingsCompanion(key: Value(key), value: Value(value), updatedAt: Value(updatedAt)); 1537 + return SettingsCompanion( 1538 + key: Value(key), 1539 + value: Value(value), 1540 + updatedAt: Value(updatedAt), 1541 + ); 1279 1542 } 1280 1543 1281 - factory SettingsEntry.fromJson(Map<String, dynamic> json, {ValueSerializer? serializer}) { 1544 + factory SettingsEntry.fromJson( 1545 + Map<String, dynamic> json, { 1546 + ValueSerializer? serializer, 1547 + }) { 1282 1548 serializer ??= driftRuntimeOptions.defaultSerializer; 1283 1549 return SettingsEntry( 1284 1550 key: serializer.fromJson<String>(json['key']), ··· 1297 1563 } 1298 1564 1299 1565 SettingsEntry copyWith({String? key, String? value, DateTime? updatedAt}) => 1300 - SettingsEntry(key: key ?? this.key, value: value ?? this.value, updatedAt: updatedAt ?? this.updatedAt); 1566 + SettingsEntry( 1567 + key: key ?? this.key, 1568 + value: value ?? this.value, 1569 + updatedAt: updatedAt ?? this.updatedAt, 1570 + ); 1301 1571 SettingsEntry copyWithCompanion(SettingsCompanion data) { 1302 1572 return SettingsEntry( 1303 1573 key: data.key.present ? data.key.value : this.key, ··· 1403 1673 } 1404 1674 } 1405 1675 1406 - class $SavedFeedsTable extends SavedFeeds with TableInfo<$SavedFeedsTable, SavedFeedEntry> { 1676 + class $SavedFeedsTable extends SavedFeeds 1677 + with TableInfo<$SavedFeedsTable, SavedFeedEntry> { 1407 1678 @override 1408 1679 final GeneratedDatabase attachedDatabase; 1409 1680 final String? _alias; ··· 1417 1688 type: DriftSqlType.string, 1418 1689 requiredDuringInsert: true, 1419 1690 ); 1420 - static const VerificationMeta _accountDidMeta = const VerificationMeta('accountDid'); 1691 + static const VerificationMeta _accountDidMeta = const VerificationMeta( 1692 + 'accountDid', 1693 + ); 1421 1694 @override 1422 1695 late final GeneratedColumn<String> accountDid = GeneratedColumn<String>( 1423 1696 'account_did', ··· 1452 1725 false, 1453 1726 type: DriftSqlType.bool, 1454 1727 requiredDuringInsert: false, 1455 - defaultConstraints: GeneratedColumn.constraintIsAlways('CHECK ("pinned" IN (0, 1))'), 1728 + defaultConstraints: GeneratedColumn.constraintIsAlways( 1729 + 'CHECK ("pinned" IN (0, 1))', 1730 + ), 1456 1731 defaultValue: const Constant(false), 1457 1732 ); 1458 - static const VerificationMeta _sortOrderMeta = const VerificationMeta('sortOrder'); 1733 + static const VerificationMeta _sortOrderMeta = const VerificationMeta( 1734 + 'sortOrder', 1735 + ); 1459 1736 @override 1460 1737 late final GeneratedColumn<int> sortOrder = GeneratedColumn<int>( 1461 1738 'sort_order', ··· 1465 1742 requiredDuringInsert: false, 1466 1743 defaultValue: const Constant(0), 1467 1744 ); 1468 - static const VerificationMeta _updatedAtMeta = const VerificationMeta('updatedAt'); 1745 + static const VerificationMeta _updatedAtMeta = const VerificationMeta( 1746 + 'updatedAt', 1747 + ); 1469 1748 @override 1470 1749 late final GeneratedColumn<DateTime> updatedAt = GeneratedColumn<DateTime>( 1471 1750 'updated_at', ··· 1476 1755 defaultValue: currentDateAndTime, 1477 1756 ); 1478 1757 @override 1479 - List<GeneratedColumn> get $columns => [id, accountDid, type, value, pinned, sortOrder, updatedAt]; 1758 + List<GeneratedColumn> get $columns => [ 1759 + id, 1760 + accountDid, 1761 + type, 1762 + value, 1763 + pinned, 1764 + sortOrder, 1765 + updatedAt, 1766 + ]; 1480 1767 @override 1481 1768 String get aliasedName => _alias ?? actualTableName; 1482 1769 @override 1483 1770 String get actualTableName => $name; 1484 1771 static const String $name = 'saved_feeds'; 1485 1772 @override 1486 - VerificationContext validateIntegrity(Insertable<SavedFeedEntry> instance, {bool isInserting = false}) { 1773 + VerificationContext validateIntegrity( 1774 + Insertable<SavedFeedEntry> instance, { 1775 + bool isInserting = false, 1776 + }) { 1487 1777 final context = VerificationContext(); 1488 1778 final data = instance.toColumns(true); 1489 1779 if (data.containsKey('id')) { ··· 1492 1782 context.missing(_idMeta); 1493 1783 } 1494 1784 if (data.containsKey('account_did')) { 1495 - context.handle(_accountDidMeta, accountDid.isAcceptableOrUnknown(data['account_did']!, _accountDidMeta)); 1785 + context.handle( 1786 + _accountDidMeta, 1787 + accountDid.isAcceptableOrUnknown(data['account_did']!, _accountDidMeta), 1788 + ); 1496 1789 } else if (isInserting) { 1497 1790 context.missing(_accountDidMeta); 1498 1791 } 1499 1792 if (data.containsKey('type')) { 1500 - context.handle(_typeMeta, type.isAcceptableOrUnknown(data['type']!, _typeMeta)); 1793 + context.handle( 1794 + _typeMeta, 1795 + type.isAcceptableOrUnknown(data['type']!, _typeMeta), 1796 + ); 1501 1797 } else if (isInserting) { 1502 1798 context.missing(_typeMeta); 1503 1799 } 1504 1800 if (data.containsKey('value')) { 1505 - context.handle(_valueMeta, value.isAcceptableOrUnknown(data['value']!, _valueMeta)); 1801 + context.handle( 1802 + _valueMeta, 1803 + value.isAcceptableOrUnknown(data['value']!, _valueMeta), 1804 + ); 1506 1805 } else if (isInserting) { 1507 1806 context.missing(_valueMeta); 1508 1807 } 1509 1808 if (data.containsKey('pinned')) { 1510 - context.handle(_pinnedMeta, pinned.isAcceptableOrUnknown(data['pinned']!, _pinnedMeta)); 1809 + context.handle( 1810 + _pinnedMeta, 1811 + pinned.isAcceptableOrUnknown(data['pinned']!, _pinnedMeta), 1812 + ); 1511 1813 } 1512 1814 if (data.containsKey('sort_order')) { 1513 - context.handle(_sortOrderMeta, sortOrder.isAcceptableOrUnknown(data['sort_order']!, _sortOrderMeta)); 1815 + context.handle( 1816 + _sortOrderMeta, 1817 + sortOrder.isAcceptableOrUnknown(data['sort_order']!, _sortOrderMeta), 1818 + ); 1514 1819 } 1515 1820 if (data.containsKey('updated_at')) { 1516 - context.handle(_updatedAtMeta, updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta)); 1821 + context.handle( 1822 + _updatedAtMeta, 1823 + updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta), 1824 + ); 1517 1825 } 1518 1826 return context; 1519 1827 } ··· 1524 1832 SavedFeedEntry map(Map<String, dynamic> data, {String? tablePrefix}) { 1525 1833 final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; 1526 1834 return SavedFeedEntry( 1527 - id: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}id'])!, 1528 - accountDid: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}account_did'])!, 1529 - type: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}type'])!, 1530 - value: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}value'])!, 1531 - pinned: attachedDatabase.typeMapping.read(DriftSqlType.bool, data['${effectivePrefix}pinned'])!, 1532 - sortOrder: attachedDatabase.typeMapping.read(DriftSqlType.int, data['${effectivePrefix}sort_order'])!, 1533 - updatedAt: attachedDatabase.typeMapping.read(DriftSqlType.dateTime, data['${effectivePrefix}updated_at'])!, 1835 + id: attachedDatabase.typeMapping.read( 1836 + DriftSqlType.string, 1837 + data['${effectivePrefix}id'], 1838 + )!, 1839 + accountDid: attachedDatabase.typeMapping.read( 1840 + DriftSqlType.string, 1841 + data['${effectivePrefix}account_did'], 1842 + )!, 1843 + type: attachedDatabase.typeMapping.read( 1844 + DriftSqlType.string, 1845 + data['${effectivePrefix}type'], 1846 + )!, 1847 + value: attachedDatabase.typeMapping.read( 1848 + DriftSqlType.string, 1849 + data['${effectivePrefix}value'], 1850 + )!, 1851 + pinned: attachedDatabase.typeMapping.read( 1852 + DriftSqlType.bool, 1853 + data['${effectivePrefix}pinned'], 1854 + )!, 1855 + sortOrder: attachedDatabase.typeMapping.read( 1856 + DriftSqlType.int, 1857 + data['${effectivePrefix}sort_order'], 1858 + )!, 1859 + updatedAt: attachedDatabase.typeMapping.read( 1860 + DriftSqlType.dateTime, 1861 + data['${effectivePrefix}updated_at'], 1862 + )!, 1534 1863 ); 1535 1864 } 1536 1865 ··· 1582 1911 ); 1583 1912 } 1584 1913 1585 - factory SavedFeedEntry.fromJson(Map<String, dynamic> json, {ValueSerializer? serializer}) { 1914 + factory SavedFeedEntry.fromJson( 1915 + Map<String, dynamic> json, { 1916 + ValueSerializer? serializer, 1917 + }) { 1586 1918 serializer ??= driftRuntimeOptions.defaultSerializer; 1587 1919 return SavedFeedEntry( 1588 1920 id: serializer.fromJson<String>(json['id']), ··· 1628 1960 SavedFeedEntry copyWithCompanion(SavedFeedsCompanion data) { 1629 1961 return SavedFeedEntry( 1630 1962 id: data.id.present ? data.id.value : this.id, 1631 - accountDid: data.accountDid.present ? data.accountDid.value : this.accountDid, 1963 + accountDid: data.accountDid.present 1964 + ? data.accountDid.value 1965 + : this.accountDid, 1632 1966 type: data.type.present ? data.type.value : this.type, 1633 1967 value: data.value.present ? data.value.value : this.value, 1634 1968 pinned: data.pinned.present ? data.pinned.value : this.pinned, ··· 1652 1986 } 1653 1987 1654 1988 @override 1655 - int get hashCode => Object.hash(id, accountDid, type, value, pinned, sortOrder, updatedAt); 1989 + int get hashCode => 1990 + Object.hash(id, accountDid, type, value, pinned, sortOrder, updatedAt); 1656 1991 @override 1657 1992 bool operator ==(Object other) => 1658 1993 identical(this, other) || ··· 1788 2123 } 1789 2124 } 1790 2125 1791 - class $SearchHistoryTable extends SearchHistory with TableInfo<$SearchHistoryTable, SearchHistoryEntry> { 2126 + class $SearchHistoryTable extends SearchHistory 2127 + with TableInfo<$SearchHistoryTable, SearchHistoryEntry> { 1792 2128 @override 1793 2129 final GeneratedDatabase attachedDatabase; 1794 2130 final String? _alias; ··· 1802 2138 hasAutoIncrement: true, 1803 2139 type: DriftSqlType.int, 1804 2140 requiredDuringInsert: false, 1805 - defaultConstraints: GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT'), 2141 + defaultConstraints: GeneratedColumn.constraintIsAlways( 2142 + 'PRIMARY KEY AUTOINCREMENT', 2143 + ), 1806 2144 ); 1807 2145 static const VerificationMeta _queryMeta = const VerificationMeta('query'); 1808 2146 @override ··· 1822 2160 type: DriftSqlType.string, 1823 2161 requiredDuringInsert: true, 1824 2162 ); 1825 - static const VerificationMeta _searchedAtMeta = const VerificationMeta('searchedAt'); 2163 + static const VerificationMeta _searchedAtMeta = const VerificationMeta( 2164 + 'searchedAt', 2165 + ); 1826 2166 @override 1827 2167 late final GeneratedColumn<DateTime> searchedAt = GeneratedColumn<DateTime>( 1828 2168 'searched_at', ··· 1832 2172 requiredDuringInsert: false, 1833 2173 defaultValue: currentDateAndTime, 1834 2174 ); 1835 - static const VerificationMeta _accountDidMeta = const VerificationMeta('accountDid'); 2175 + static const VerificationMeta _accountDidMeta = const VerificationMeta( 2176 + 'accountDid', 2177 + ); 1836 2178 @override 1837 2179 late final GeneratedColumn<String> accountDid = GeneratedColumn<String>( 1838 2180 'account_did', ··· 1842 2184 requiredDuringInsert: true, 1843 2185 ); 1844 2186 @override 1845 - List<GeneratedColumn> get $columns => [id, query, type, searchedAt, accountDid]; 2187 + List<GeneratedColumn> get $columns => [ 2188 + id, 2189 + query, 2190 + type, 2191 + searchedAt, 2192 + accountDid, 2193 + ]; 1846 2194 @override 1847 2195 String get aliasedName => _alias ?? actualTableName; 1848 2196 @override 1849 2197 String get actualTableName => $name; 1850 2198 static const String $name = 'search_history'; 1851 2199 @override 1852 - VerificationContext validateIntegrity(Insertable<SearchHistoryEntry> instance, {bool isInserting = false}) { 2200 + VerificationContext validateIntegrity( 2201 + Insertable<SearchHistoryEntry> instance, { 2202 + bool isInserting = false, 2203 + }) { 1853 2204 final context = VerificationContext(); 1854 2205 final data = instance.toColumns(true); 1855 2206 if (data.containsKey('id')) { 1856 2207 context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); 1857 2208 } 1858 2209 if (data.containsKey('query')) { 1859 - context.handle(_queryMeta, query.isAcceptableOrUnknown(data['query']!, _queryMeta)); 2210 + context.handle( 2211 + _queryMeta, 2212 + query.isAcceptableOrUnknown(data['query']!, _queryMeta), 2213 + ); 1860 2214 } else if (isInserting) { 1861 2215 context.missing(_queryMeta); 1862 2216 } 1863 2217 if (data.containsKey('type')) { 1864 - context.handle(_typeMeta, type.isAcceptableOrUnknown(data['type']!, _typeMeta)); 2218 + context.handle( 2219 + _typeMeta, 2220 + type.isAcceptableOrUnknown(data['type']!, _typeMeta), 2221 + ); 1865 2222 } else if (isInserting) { 1866 2223 context.missing(_typeMeta); 1867 2224 } 1868 2225 if (data.containsKey('searched_at')) { 1869 - context.handle(_searchedAtMeta, searchedAt.isAcceptableOrUnknown(data['searched_at']!, _searchedAtMeta)); 2226 + context.handle( 2227 + _searchedAtMeta, 2228 + searchedAt.isAcceptableOrUnknown(data['searched_at']!, _searchedAtMeta), 2229 + ); 1870 2230 } 1871 2231 if (data.containsKey('account_did')) { 1872 - context.handle(_accountDidMeta, accountDid.isAcceptableOrUnknown(data['account_did']!, _accountDidMeta)); 2232 + context.handle( 2233 + _accountDidMeta, 2234 + accountDid.isAcceptableOrUnknown(data['account_did']!, _accountDidMeta), 2235 + ); 1873 2236 } else if (isInserting) { 1874 2237 context.missing(_accountDidMeta); 1875 2238 } ··· 1882 2245 SearchHistoryEntry map(Map<String, dynamic> data, {String? tablePrefix}) { 1883 2246 final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; 1884 2247 return SearchHistoryEntry( 1885 - id: attachedDatabase.typeMapping.read(DriftSqlType.int, data['${effectivePrefix}id'])!, 1886 - query: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}query'])!, 1887 - type: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}type'])!, 1888 - searchedAt: attachedDatabase.typeMapping.read(DriftSqlType.dateTime, data['${effectivePrefix}searched_at'])!, 1889 - accountDid: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}account_did'])!, 2248 + id: attachedDatabase.typeMapping.read( 2249 + DriftSqlType.int, 2250 + data['${effectivePrefix}id'], 2251 + )!, 2252 + query: attachedDatabase.typeMapping.read( 2253 + DriftSqlType.string, 2254 + data['${effectivePrefix}query'], 2255 + )!, 2256 + type: attachedDatabase.typeMapping.read( 2257 + DriftSqlType.string, 2258 + data['${effectivePrefix}type'], 2259 + )!, 2260 + searchedAt: attachedDatabase.typeMapping.read( 2261 + DriftSqlType.dateTime, 2262 + data['${effectivePrefix}searched_at'], 2263 + )!, 2264 + accountDid: attachedDatabase.typeMapping.read( 2265 + DriftSqlType.string, 2266 + data['${effectivePrefix}account_did'], 2267 + )!, 1890 2268 ); 1891 2269 } 1892 2270 ··· 1896 2274 } 1897 2275 } 1898 2276 1899 - class SearchHistoryEntry extends DataClass implements Insertable<SearchHistoryEntry> { 2277 + class SearchHistoryEntry extends DataClass 2278 + implements Insertable<SearchHistoryEntry> { 1900 2279 final int id; 1901 2280 final String query; 1902 2281 final String type; ··· 1930 2309 ); 1931 2310 } 1932 2311 1933 - factory SearchHistoryEntry.fromJson(Map<String, dynamic> json, {ValueSerializer? serializer}) { 2312 + factory SearchHistoryEntry.fromJson( 2313 + Map<String, dynamic> json, { 2314 + ValueSerializer? serializer, 2315 + }) { 1934 2316 serializer ??= driftRuntimeOptions.defaultSerializer; 1935 2317 return SearchHistoryEntry( 1936 2318 id: serializer.fromJson<int>(json['id']), ··· 1952 2334 }; 1953 2335 } 1954 2336 1955 - SearchHistoryEntry copyWith({int? id, String? query, String? type, DateTime? searchedAt, String? accountDid}) => 1956 - SearchHistoryEntry( 1957 - id: id ?? this.id, 1958 - query: query ?? this.query, 1959 - type: type ?? this.type, 1960 - searchedAt: searchedAt ?? this.searchedAt, 1961 - accountDid: accountDid ?? this.accountDid, 1962 - ); 2337 + SearchHistoryEntry copyWith({ 2338 + int? id, 2339 + String? query, 2340 + String? type, 2341 + DateTime? searchedAt, 2342 + String? accountDid, 2343 + }) => SearchHistoryEntry( 2344 + id: id ?? this.id, 2345 + query: query ?? this.query, 2346 + type: type ?? this.type, 2347 + searchedAt: searchedAt ?? this.searchedAt, 2348 + accountDid: accountDid ?? this.accountDid, 2349 + ); 1963 2350 SearchHistoryEntry copyWithCompanion(SearchHistoryCompanion data) { 1964 2351 return SearchHistoryEntry( 1965 2352 id: data.id.present ? data.id.value : this.id, 1966 2353 query: data.query.present ? data.query.value : this.query, 1967 2354 type: data.type.present ? data.type.value : this.type, 1968 - searchedAt: data.searchedAt.present ? data.searchedAt.value : this.searchedAt, 1969 - accountDid: data.accountDid.present ? data.accountDid.value : this.accountDid, 2355 + searchedAt: data.searchedAt.present 2356 + ? data.searchedAt.value 2357 + : this.searchedAt, 2358 + accountDid: data.accountDid.present 2359 + ? data.accountDid.value 2360 + : this.accountDid, 1970 2361 ); 1971 2362 } 1972 2363 ··· 2097 2488 hasAutoIncrement: true, 2098 2489 type: DriftSqlType.int, 2099 2490 requiredDuringInsert: false, 2100 - defaultConstraints: GeneratedColumn.constraintIsAlways('PRIMARY KEY AUTOINCREMENT'), 2491 + defaultConstraints: GeneratedColumn.constraintIsAlways( 2492 + 'PRIMARY KEY AUTOINCREMENT', 2493 + ), 2494 + ); 2495 + static const VerificationMeta _accountDidMeta = const VerificationMeta( 2496 + 'accountDid', 2101 2497 ); 2102 - static const VerificationMeta _accountDidMeta = const VerificationMeta('accountDid'); 2103 2498 @override 2104 2499 late final GeneratedColumn<String> accountDid = GeneratedColumn<String>( 2105 2500 'account_did', ··· 2108 2503 type: DriftSqlType.string, 2109 2504 requiredDuringInsert: true, 2110 2505 ); 2111 - static const VerificationMeta _contentMeta = const VerificationMeta('content'); 2506 + static const VerificationMeta _contentMeta = const VerificationMeta( 2507 + 'content', 2508 + ); 2112 2509 @override 2113 2510 late final GeneratedColumn<String> content = GeneratedColumn<String>( 2114 2511 'content', ··· 2117 2514 type: DriftSqlType.string, 2118 2515 requiredDuringInsert: true, 2119 2516 ); 2120 - static const VerificationMeta _replyUriMeta = const VerificationMeta('replyUri'); 2517 + static const VerificationMeta _replyUriMeta = const VerificationMeta( 2518 + 'replyUri', 2519 + ); 2121 2520 @override 2122 2521 late final GeneratedColumn<String> replyUri = GeneratedColumn<String>( 2123 2522 'reply_uri', ··· 2126 2525 type: DriftSqlType.string, 2127 2526 requiredDuringInsert: false, 2128 2527 ); 2129 - static const VerificationMeta _replyCidMeta = const VerificationMeta('replyCid'); 2528 + static const VerificationMeta _replyCidMeta = const VerificationMeta( 2529 + 'replyCid', 2530 + ); 2130 2531 @override 2131 2532 late final GeneratedColumn<String> replyCid = GeneratedColumn<String>( 2132 2533 'reply_cid', ··· 2135 2536 type: DriftSqlType.string, 2136 2537 requiredDuringInsert: false, 2137 2538 ); 2138 - static const VerificationMeta _rootUriMeta = const VerificationMeta('rootUri'); 2539 + static const VerificationMeta _rootUriMeta = const VerificationMeta( 2540 + 'rootUri', 2541 + ); 2139 2542 @override 2140 2543 late final GeneratedColumn<String> rootUri = GeneratedColumn<String>( 2141 2544 'root_uri', ··· 2144 2547 type: DriftSqlType.string, 2145 2548 requiredDuringInsert: false, 2146 2549 ); 2147 - static const VerificationMeta _rootCidMeta = const VerificationMeta('rootCid'); 2550 + static const VerificationMeta _rootCidMeta = const VerificationMeta( 2551 + 'rootCid', 2552 + ); 2148 2553 @override 2149 2554 late final GeneratedColumn<String> rootCid = GeneratedColumn<String>( 2150 2555 'root_cid', ··· 2153 2558 type: DriftSqlType.string, 2154 2559 requiredDuringInsert: false, 2155 2560 ); 2156 - static const VerificationMeta _embedJsonMeta = const VerificationMeta('embedJson'); 2561 + static const VerificationMeta _embedJsonMeta = const VerificationMeta( 2562 + 'embedJson', 2563 + ); 2157 2564 @override 2158 2565 late final GeneratedColumn<String> embedJson = GeneratedColumn<String>( 2159 2566 'embed_json', ··· 2162 2569 type: DriftSqlType.string, 2163 2570 requiredDuringInsert: false, 2164 2571 ); 2165 - static const VerificationMeta _mediaPathsMeta = const VerificationMeta('mediaPaths'); 2572 + static const VerificationMeta _mediaPathsMeta = const VerificationMeta( 2573 + 'mediaPaths', 2574 + ); 2166 2575 @override 2167 2576 late final GeneratedColumn<String> mediaPaths = GeneratedColumn<String>( 2168 2577 'media_paths', ··· 2171 2580 type: DriftSqlType.string, 2172 2581 requiredDuringInsert: false, 2173 2582 ); 2174 - static const VerificationMeta _createdAtMeta = const VerificationMeta('createdAt'); 2583 + static const VerificationMeta _createdAtMeta = const VerificationMeta( 2584 + 'createdAt', 2585 + ); 2175 2586 @override 2176 2587 late final GeneratedColumn<DateTime> createdAt = GeneratedColumn<DateTime>( 2177 2588 'created_at', ··· 2181 2592 requiredDuringInsert: false, 2182 2593 defaultValue: currentDateAndTime, 2183 2594 ); 2184 - static const VerificationMeta _updatedAtMeta = const VerificationMeta('updatedAt'); 2595 + static const VerificationMeta _updatedAtMeta = const VerificationMeta( 2596 + 'updatedAt', 2597 + ); 2185 2598 @override 2186 2599 late final GeneratedColumn<DateTime> updatedAt = GeneratedColumn<DateTime>( 2187 2600 'updated_at', ··· 2191 2604 requiredDuringInsert: false, 2192 2605 defaultValue: currentDateAndTime, 2193 2606 ); 2194 - static const VerificationMeta _scheduledAtMeta = const VerificationMeta('scheduledAt'); 2607 + static const VerificationMeta _scheduledAtMeta = const VerificationMeta( 2608 + 'scheduledAt', 2609 + ); 2195 2610 @override 2196 2611 late final GeneratedColumn<DateTime> scheduledAt = GeneratedColumn<DateTime>( 2197 2612 'scheduled_at', ··· 2221 2636 String get actualTableName => $name; 2222 2637 static const String $name = 'drafts'; 2223 2638 @override 2224 - VerificationContext validateIntegrity(Insertable<DraftEntry> instance, {bool isInserting = false}) { 2639 + VerificationContext validateIntegrity( 2640 + Insertable<DraftEntry> instance, { 2641 + bool isInserting = false, 2642 + }) { 2225 2643 final context = VerificationContext(); 2226 2644 final data = instance.toColumns(true); 2227 2645 if (data.containsKey('id')) { 2228 2646 context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); 2229 2647 } 2230 2648 if (data.containsKey('account_did')) { 2231 - context.handle(_accountDidMeta, accountDid.isAcceptableOrUnknown(data['account_did']!, _accountDidMeta)); 2649 + context.handle( 2650 + _accountDidMeta, 2651 + accountDid.isAcceptableOrUnknown(data['account_did']!, _accountDidMeta), 2652 + ); 2232 2653 } else if (isInserting) { 2233 2654 context.missing(_accountDidMeta); 2234 2655 } 2235 2656 if (data.containsKey('content')) { 2236 - context.handle(_contentMeta, content.isAcceptableOrUnknown(data['content']!, _contentMeta)); 2657 + context.handle( 2658 + _contentMeta, 2659 + content.isAcceptableOrUnknown(data['content']!, _contentMeta), 2660 + ); 2237 2661 } else if (isInserting) { 2238 2662 context.missing(_contentMeta); 2239 2663 } 2240 2664 if (data.containsKey('reply_uri')) { 2241 - context.handle(_replyUriMeta, replyUri.isAcceptableOrUnknown(data['reply_uri']!, _replyUriMeta)); 2665 + context.handle( 2666 + _replyUriMeta, 2667 + replyUri.isAcceptableOrUnknown(data['reply_uri']!, _replyUriMeta), 2668 + ); 2242 2669 } 2243 2670 if (data.containsKey('reply_cid')) { 2244 - context.handle(_replyCidMeta, replyCid.isAcceptableOrUnknown(data['reply_cid']!, _replyCidMeta)); 2671 + context.handle( 2672 + _replyCidMeta, 2673 + replyCid.isAcceptableOrUnknown(data['reply_cid']!, _replyCidMeta), 2674 + ); 2245 2675 } 2246 2676 if (data.containsKey('root_uri')) { 2247 - context.handle(_rootUriMeta, rootUri.isAcceptableOrUnknown(data['root_uri']!, _rootUriMeta)); 2677 + context.handle( 2678 + _rootUriMeta, 2679 + rootUri.isAcceptableOrUnknown(data['root_uri']!, _rootUriMeta), 2680 + ); 2248 2681 } 2249 2682 if (data.containsKey('root_cid')) { 2250 - context.handle(_rootCidMeta, rootCid.isAcceptableOrUnknown(data['root_cid']!, _rootCidMeta)); 2683 + context.handle( 2684 + _rootCidMeta, 2685 + rootCid.isAcceptableOrUnknown(data['root_cid']!, _rootCidMeta), 2686 + ); 2251 2687 } 2252 2688 if (data.containsKey('embed_json')) { 2253 - context.handle(_embedJsonMeta, embedJson.isAcceptableOrUnknown(data['embed_json']!, _embedJsonMeta)); 2689 + context.handle( 2690 + _embedJsonMeta, 2691 + embedJson.isAcceptableOrUnknown(data['embed_json']!, _embedJsonMeta), 2692 + ); 2254 2693 } 2255 2694 if (data.containsKey('media_paths')) { 2256 - context.handle(_mediaPathsMeta, mediaPaths.isAcceptableOrUnknown(data['media_paths']!, _mediaPathsMeta)); 2695 + context.handle( 2696 + _mediaPathsMeta, 2697 + mediaPaths.isAcceptableOrUnknown(data['media_paths']!, _mediaPathsMeta), 2698 + ); 2257 2699 } 2258 2700 if (data.containsKey('created_at')) { 2259 - context.handle(_createdAtMeta, createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta)); 2701 + context.handle( 2702 + _createdAtMeta, 2703 + createdAt.isAcceptableOrUnknown(data['created_at']!, _createdAtMeta), 2704 + ); 2260 2705 } 2261 2706 if (data.containsKey('updated_at')) { 2262 - context.handle(_updatedAtMeta, updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta)); 2707 + context.handle( 2708 + _updatedAtMeta, 2709 + updatedAt.isAcceptableOrUnknown(data['updated_at']!, _updatedAtMeta), 2710 + ); 2263 2711 } 2264 2712 if (data.containsKey('scheduled_at')) { 2265 - context.handle(_scheduledAtMeta, scheduledAt.isAcceptableOrUnknown(data['scheduled_at']!, _scheduledAtMeta)); 2713 + context.handle( 2714 + _scheduledAtMeta, 2715 + scheduledAt.isAcceptableOrUnknown( 2716 + data['scheduled_at']!, 2717 + _scheduledAtMeta, 2718 + ), 2719 + ); 2266 2720 } 2267 2721 return context; 2268 2722 } ··· 2273 2727 DraftEntry map(Map<String, dynamic> data, {String? tablePrefix}) { 2274 2728 final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; 2275 2729 return DraftEntry( 2276 - id: attachedDatabase.typeMapping.read(DriftSqlType.int, data['${effectivePrefix}id'])!, 2277 - accountDid: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}account_did'])!, 2278 - content: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}content'])!, 2279 - replyUri: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}reply_uri']), 2280 - replyCid: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}reply_cid']), 2281 - rootUri: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}root_uri']), 2282 - rootCid: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}root_cid']), 2283 - embedJson: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}embed_json']), 2284 - mediaPaths: attachedDatabase.typeMapping.read(DriftSqlType.string, data['${effectivePrefix}media_paths']), 2285 - createdAt: attachedDatabase.typeMapping.read(DriftSqlType.dateTime, data['${effectivePrefix}created_at'])!, 2286 - updatedAt: attachedDatabase.typeMapping.read(DriftSqlType.dateTime, data['${effectivePrefix}updated_at'])!, 2287 - scheduledAt: attachedDatabase.typeMapping.read(DriftSqlType.dateTime, data['${effectivePrefix}scheduled_at']), 2730 + id: attachedDatabase.typeMapping.read( 2731 + DriftSqlType.int, 2732 + data['${effectivePrefix}id'], 2733 + )!, 2734 + accountDid: attachedDatabase.typeMapping.read( 2735 + DriftSqlType.string, 2736 + data['${effectivePrefix}account_did'], 2737 + )!, 2738 + content: attachedDatabase.typeMapping.read( 2739 + DriftSqlType.string, 2740 + data['${effectivePrefix}content'], 2741 + )!, 2742 + replyUri: attachedDatabase.typeMapping.read( 2743 + DriftSqlType.string, 2744 + data['${effectivePrefix}reply_uri'], 2745 + ), 2746 + replyCid: attachedDatabase.typeMapping.read( 2747 + DriftSqlType.string, 2748 + data['${effectivePrefix}reply_cid'], 2749 + ), 2750 + rootUri: attachedDatabase.typeMapping.read( 2751 + DriftSqlType.string, 2752 + data['${effectivePrefix}root_uri'], 2753 + ), 2754 + rootCid: attachedDatabase.typeMapping.read( 2755 + DriftSqlType.string, 2756 + data['${effectivePrefix}root_cid'], 2757 + ), 2758 + embedJson: attachedDatabase.typeMapping.read( 2759 + DriftSqlType.string, 2760 + data['${effectivePrefix}embed_json'], 2761 + ), 2762 + mediaPaths: attachedDatabase.typeMapping.read( 2763 + DriftSqlType.string, 2764 + data['${effectivePrefix}media_paths'], 2765 + ), 2766 + createdAt: attachedDatabase.typeMapping.read( 2767 + DriftSqlType.dateTime, 2768 + data['${effectivePrefix}created_at'], 2769 + )!, 2770 + updatedAt: attachedDatabase.typeMapping.read( 2771 + DriftSqlType.dateTime, 2772 + data['${effectivePrefix}updated_at'], 2773 + )!, 2774 + scheduledAt: attachedDatabase.typeMapping.read( 2775 + DriftSqlType.dateTime, 2776 + data['${effectivePrefix}scheduled_at'], 2777 + ), 2288 2778 ); 2289 2779 } 2290 2780 ··· 2358 2848 id: Value(id), 2359 2849 accountDid: Value(accountDid), 2360 2850 content: Value(content), 2361 - replyUri: replyUri == null && nullToAbsent ? const Value.absent() : Value(replyUri), 2362 - replyCid: replyCid == null && nullToAbsent ? const Value.absent() : Value(replyCid), 2363 - rootUri: rootUri == null && nullToAbsent ? const Value.absent() : Value(rootUri), 2364 - rootCid: rootCid == null && nullToAbsent ? const Value.absent() : Value(rootCid), 2365 - embedJson: embedJson == null && nullToAbsent ? const Value.absent() : Value(embedJson), 2366 - mediaPaths: mediaPaths == null && nullToAbsent ? const Value.absent() : Value(mediaPaths), 2851 + replyUri: replyUri == null && nullToAbsent 2852 + ? const Value.absent() 2853 + : Value(replyUri), 2854 + replyCid: replyCid == null && nullToAbsent 2855 + ? const Value.absent() 2856 + : Value(replyCid), 2857 + rootUri: rootUri == null && nullToAbsent 2858 + ? const Value.absent() 2859 + : Value(rootUri), 2860 + rootCid: rootCid == null && nullToAbsent 2861 + ? const Value.absent() 2862 + : Value(rootCid), 2863 + embedJson: embedJson == null && nullToAbsent 2864 + ? const Value.absent() 2865 + : Value(embedJson), 2866 + mediaPaths: mediaPaths == null && nullToAbsent 2867 + ? const Value.absent() 2868 + : Value(mediaPaths), 2367 2869 createdAt: Value(createdAt), 2368 2870 updatedAt: Value(updatedAt), 2369 - scheduledAt: scheduledAt == null && nullToAbsent ? const Value.absent() : Value(scheduledAt), 2871 + scheduledAt: scheduledAt == null && nullToAbsent 2872 + ? const Value.absent() 2873 + : Value(scheduledAt), 2370 2874 ); 2371 2875 } 2372 2876 2373 - factory DraftEntry.fromJson(Map<String, dynamic> json, {ValueSerializer? serializer}) { 2877 + factory DraftEntry.fromJson( 2878 + Map<String, dynamic> json, { 2879 + ValueSerializer? serializer, 2880 + }) { 2374 2881 serializer ??= driftRuntimeOptions.defaultSerializer; 2375 2882 return DraftEntry( 2376 2883 id: serializer.fromJson<int>(json['id']), ··· 2436 2943 DraftEntry copyWithCompanion(DraftsCompanion data) { 2437 2944 return DraftEntry( 2438 2945 id: data.id.present ? data.id.value : this.id, 2439 - accountDid: data.accountDid.present ? data.accountDid.value : this.accountDid, 2946 + accountDid: data.accountDid.present 2947 + ? data.accountDid.value 2948 + : this.accountDid, 2440 2949 content: data.content.present ? data.content.value : this.content, 2441 2950 replyUri: data.replyUri.present ? data.replyUri.value : this.replyUri, 2442 2951 replyCid: data.replyCid.present ? data.replyCid.value : this.replyCid, 2443 2952 rootUri: data.rootUri.present ? data.rootUri.value : this.rootUri, 2444 2953 rootCid: data.rootCid.present ? data.rootCid.value : this.rootCid, 2445 2954 embedJson: data.embedJson.present ? data.embedJson.value : this.embedJson, 2446 - mediaPaths: data.mediaPaths.present ? data.mediaPaths.value : this.mediaPaths, 2955 + mediaPaths: data.mediaPaths.present 2956 + ? data.mediaPaths.value 2957 + : this.mediaPaths, 2447 2958 createdAt: data.createdAt.present ? data.createdAt.value : this.createdAt, 2448 2959 updatedAt: data.updatedAt.present ? data.updatedAt.value : this.updatedAt, 2449 - scheduledAt: data.scheduledAt.present ? data.scheduledAt.value : this.scheduledAt, 2960 + scheduledAt: data.scheduledAt.present 2961 + ? data.scheduledAt.value 2962 + : this.scheduledAt, 2450 2963 ); 2451 2964 } 2452 2965 ··· 2666 3179 } 2667 3180 } 2668 3181 3182 + class $SavedPostsTable extends SavedPosts 3183 + with TableInfo<$SavedPostsTable, SavedPostEntry> { 3184 + @override 3185 + final GeneratedDatabase attachedDatabase; 3186 + final String? _alias; 3187 + $SavedPostsTable(this.attachedDatabase, [this._alias]); 3188 + static const VerificationMeta _idMeta = const VerificationMeta('id'); 3189 + @override 3190 + late final GeneratedColumn<int> id = GeneratedColumn<int>( 3191 + 'id', 3192 + aliasedName, 3193 + false, 3194 + hasAutoIncrement: true, 3195 + type: DriftSqlType.int, 3196 + requiredDuringInsert: false, 3197 + defaultConstraints: GeneratedColumn.constraintIsAlways( 3198 + 'PRIMARY KEY AUTOINCREMENT', 3199 + ), 3200 + ); 3201 + static const VerificationMeta _accountDidMeta = const VerificationMeta( 3202 + 'accountDid', 3203 + ); 3204 + @override 3205 + late final GeneratedColumn<String> accountDid = GeneratedColumn<String>( 3206 + 'account_did', 3207 + aliasedName, 3208 + false, 3209 + type: DriftSqlType.string, 3210 + requiredDuringInsert: true, 3211 + ); 3212 + static const VerificationMeta _postUriMeta = const VerificationMeta( 3213 + 'postUri', 3214 + ); 3215 + @override 3216 + late final GeneratedColumn<String> postUri = GeneratedColumn<String>( 3217 + 'post_uri', 3218 + aliasedName, 3219 + false, 3220 + type: DriftSqlType.string, 3221 + requiredDuringInsert: true, 3222 + ); 3223 + static const VerificationMeta _postJsonMeta = const VerificationMeta( 3224 + 'postJson', 3225 + ); 3226 + @override 3227 + late final GeneratedColumn<String> postJson = GeneratedColumn<String>( 3228 + 'post_json', 3229 + aliasedName, 3230 + false, 3231 + type: DriftSqlType.string, 3232 + requiredDuringInsert: true, 3233 + ); 3234 + static const VerificationMeta _savedAtMeta = const VerificationMeta( 3235 + 'savedAt', 3236 + ); 3237 + @override 3238 + late final GeneratedColumn<DateTime> savedAt = GeneratedColumn<DateTime>( 3239 + 'saved_at', 3240 + aliasedName, 3241 + false, 3242 + type: DriftSqlType.dateTime, 3243 + requiredDuringInsert: false, 3244 + defaultValue: currentDateAndTime, 3245 + ); 3246 + @override 3247 + List<GeneratedColumn> get $columns => [ 3248 + id, 3249 + accountDid, 3250 + postUri, 3251 + postJson, 3252 + savedAt, 3253 + ]; 3254 + @override 3255 + String get aliasedName => _alias ?? actualTableName; 3256 + @override 3257 + String get actualTableName => $name; 3258 + static const String $name = 'saved_posts'; 3259 + @override 3260 + VerificationContext validateIntegrity( 3261 + Insertable<SavedPostEntry> instance, { 3262 + bool isInserting = false, 3263 + }) { 3264 + final context = VerificationContext(); 3265 + final data = instance.toColumns(true); 3266 + if (data.containsKey('id')) { 3267 + context.handle(_idMeta, id.isAcceptableOrUnknown(data['id']!, _idMeta)); 3268 + } 3269 + if (data.containsKey('account_did')) { 3270 + context.handle( 3271 + _accountDidMeta, 3272 + accountDid.isAcceptableOrUnknown(data['account_did']!, _accountDidMeta), 3273 + ); 3274 + } else if (isInserting) { 3275 + context.missing(_accountDidMeta); 3276 + } 3277 + if (data.containsKey('post_uri')) { 3278 + context.handle( 3279 + _postUriMeta, 3280 + postUri.isAcceptableOrUnknown(data['post_uri']!, _postUriMeta), 3281 + ); 3282 + } else if (isInserting) { 3283 + context.missing(_postUriMeta); 3284 + } 3285 + if (data.containsKey('post_json')) { 3286 + context.handle( 3287 + _postJsonMeta, 3288 + postJson.isAcceptableOrUnknown(data['post_json']!, _postJsonMeta), 3289 + ); 3290 + } else if (isInserting) { 3291 + context.missing(_postJsonMeta); 3292 + } 3293 + if (data.containsKey('saved_at')) { 3294 + context.handle( 3295 + _savedAtMeta, 3296 + savedAt.isAcceptableOrUnknown(data['saved_at']!, _savedAtMeta), 3297 + ); 3298 + } 3299 + return context; 3300 + } 3301 + 3302 + @override 3303 + Set<GeneratedColumn> get $primaryKey => {id}; 3304 + @override 3305 + SavedPostEntry map(Map<String, dynamic> data, {String? tablePrefix}) { 3306 + final effectivePrefix = tablePrefix != null ? '$tablePrefix.' : ''; 3307 + return SavedPostEntry( 3308 + id: attachedDatabase.typeMapping.read( 3309 + DriftSqlType.int, 3310 + data['${effectivePrefix}id'], 3311 + )!, 3312 + accountDid: attachedDatabase.typeMapping.read( 3313 + DriftSqlType.string, 3314 + data['${effectivePrefix}account_did'], 3315 + )!, 3316 + postUri: attachedDatabase.typeMapping.read( 3317 + DriftSqlType.string, 3318 + data['${effectivePrefix}post_uri'], 3319 + )!, 3320 + postJson: attachedDatabase.typeMapping.read( 3321 + DriftSqlType.string, 3322 + data['${effectivePrefix}post_json'], 3323 + )!, 3324 + savedAt: attachedDatabase.typeMapping.read( 3325 + DriftSqlType.dateTime, 3326 + data['${effectivePrefix}saved_at'], 3327 + )!, 3328 + ); 3329 + } 3330 + 3331 + @override 3332 + $SavedPostsTable createAlias(String alias) { 3333 + return $SavedPostsTable(attachedDatabase, alias); 3334 + } 3335 + } 3336 + 3337 + class SavedPostEntry extends DataClass implements Insertable<SavedPostEntry> { 3338 + final int id; 3339 + final String accountDid; 3340 + final String postUri; 3341 + final String postJson; 3342 + final DateTime savedAt; 3343 + const SavedPostEntry({ 3344 + required this.id, 3345 + required this.accountDid, 3346 + required this.postUri, 3347 + required this.postJson, 3348 + required this.savedAt, 3349 + }); 3350 + @override 3351 + Map<String, Expression> toColumns(bool nullToAbsent) { 3352 + final map = <String, Expression>{}; 3353 + map['id'] = Variable<int>(id); 3354 + map['account_did'] = Variable<String>(accountDid); 3355 + map['post_uri'] = Variable<String>(postUri); 3356 + map['post_json'] = Variable<String>(postJson); 3357 + map['saved_at'] = Variable<DateTime>(savedAt); 3358 + return map; 3359 + } 3360 + 3361 + SavedPostsCompanion toCompanion(bool nullToAbsent) { 3362 + return SavedPostsCompanion( 3363 + id: Value(id), 3364 + accountDid: Value(accountDid), 3365 + postUri: Value(postUri), 3366 + postJson: Value(postJson), 3367 + savedAt: Value(savedAt), 3368 + ); 3369 + } 3370 + 3371 + factory SavedPostEntry.fromJson( 3372 + Map<String, dynamic> json, { 3373 + ValueSerializer? serializer, 3374 + }) { 3375 + serializer ??= driftRuntimeOptions.defaultSerializer; 3376 + return SavedPostEntry( 3377 + id: serializer.fromJson<int>(json['id']), 3378 + accountDid: serializer.fromJson<String>(json['accountDid']), 3379 + postUri: serializer.fromJson<String>(json['postUri']), 3380 + postJson: serializer.fromJson<String>(json['postJson']), 3381 + savedAt: serializer.fromJson<DateTime>(json['savedAt']), 3382 + ); 3383 + } 3384 + @override 3385 + Map<String, dynamic> toJson({ValueSerializer? serializer}) { 3386 + serializer ??= driftRuntimeOptions.defaultSerializer; 3387 + return <String, dynamic>{ 3388 + 'id': serializer.toJson<int>(id), 3389 + 'accountDid': serializer.toJson<String>(accountDid), 3390 + 'postUri': serializer.toJson<String>(postUri), 3391 + 'postJson': serializer.toJson<String>(postJson), 3392 + 'savedAt': serializer.toJson<DateTime>(savedAt), 3393 + }; 3394 + } 3395 + 3396 + SavedPostEntry copyWith({ 3397 + int? id, 3398 + String? accountDid, 3399 + String? postUri, 3400 + String? postJson, 3401 + DateTime? savedAt, 3402 + }) => SavedPostEntry( 3403 + id: id ?? this.id, 3404 + accountDid: accountDid ?? this.accountDid, 3405 + postUri: postUri ?? this.postUri, 3406 + postJson: postJson ?? this.postJson, 3407 + savedAt: savedAt ?? this.savedAt, 3408 + ); 3409 + SavedPostEntry copyWithCompanion(SavedPostsCompanion data) { 3410 + return SavedPostEntry( 3411 + id: data.id.present ? data.id.value : this.id, 3412 + accountDid: data.accountDid.present 3413 + ? data.accountDid.value 3414 + : this.accountDid, 3415 + postUri: data.postUri.present ? data.postUri.value : this.postUri, 3416 + postJson: data.postJson.present ? data.postJson.value : this.postJson, 3417 + savedAt: data.savedAt.present ? data.savedAt.value : this.savedAt, 3418 + ); 3419 + } 3420 + 3421 + @override 3422 + String toString() { 3423 + return (StringBuffer('SavedPostEntry(') 3424 + ..write('id: $id, ') 3425 + ..write('accountDid: $accountDid, ') 3426 + ..write('postUri: $postUri, ') 3427 + ..write('postJson: $postJson, ') 3428 + ..write('savedAt: $savedAt') 3429 + ..write(')')) 3430 + .toString(); 3431 + } 3432 + 3433 + @override 3434 + int get hashCode => Object.hash(id, accountDid, postUri, postJson, savedAt); 3435 + @override 3436 + bool operator ==(Object other) => 3437 + identical(this, other) || 3438 + (other is SavedPostEntry && 3439 + other.id == this.id && 3440 + other.accountDid == this.accountDid && 3441 + other.postUri == this.postUri && 3442 + other.postJson == this.postJson && 3443 + other.savedAt == this.savedAt); 3444 + } 3445 + 3446 + class SavedPostsCompanion extends UpdateCompanion<SavedPostEntry> { 3447 + final Value<int> id; 3448 + final Value<String> accountDid; 3449 + final Value<String> postUri; 3450 + final Value<String> postJson; 3451 + final Value<DateTime> savedAt; 3452 + const SavedPostsCompanion({ 3453 + this.id = const Value.absent(), 3454 + this.accountDid = const Value.absent(), 3455 + this.postUri = const Value.absent(), 3456 + this.postJson = const Value.absent(), 3457 + this.savedAt = const Value.absent(), 3458 + }); 3459 + SavedPostsCompanion.insert({ 3460 + this.id = const Value.absent(), 3461 + required String accountDid, 3462 + required String postUri, 3463 + required String postJson, 3464 + this.savedAt = const Value.absent(), 3465 + }) : accountDid = Value(accountDid), 3466 + postUri = Value(postUri), 3467 + postJson = Value(postJson); 3468 + static Insertable<SavedPostEntry> custom({ 3469 + Expression<int>? id, 3470 + Expression<String>? accountDid, 3471 + Expression<String>? postUri, 3472 + Expression<String>? postJson, 3473 + Expression<DateTime>? savedAt, 3474 + }) { 3475 + return RawValuesInsertable({ 3476 + if (id != null) 'id': id, 3477 + if (accountDid != null) 'account_did': accountDid, 3478 + if (postUri != null) 'post_uri': postUri, 3479 + if (postJson != null) 'post_json': postJson, 3480 + if (savedAt != null) 'saved_at': savedAt, 3481 + }); 3482 + } 3483 + 3484 + SavedPostsCompanion copyWith({ 3485 + Value<int>? id, 3486 + Value<String>? accountDid, 3487 + Value<String>? postUri, 3488 + Value<String>? postJson, 3489 + Value<DateTime>? savedAt, 3490 + }) { 3491 + return SavedPostsCompanion( 3492 + id: id ?? this.id, 3493 + accountDid: accountDid ?? this.accountDid, 3494 + postUri: postUri ?? this.postUri, 3495 + postJson: postJson ?? this.postJson, 3496 + savedAt: savedAt ?? this.savedAt, 3497 + ); 3498 + } 3499 + 3500 + @override 3501 + Map<String, Expression> toColumns(bool nullToAbsent) { 3502 + final map = <String, Expression>{}; 3503 + if (id.present) { 3504 + map['id'] = Variable<int>(id.value); 3505 + } 3506 + if (accountDid.present) { 3507 + map['account_did'] = Variable<String>(accountDid.value); 3508 + } 3509 + if (postUri.present) { 3510 + map['post_uri'] = Variable<String>(postUri.value); 3511 + } 3512 + if (postJson.present) { 3513 + map['post_json'] = Variable<String>(postJson.value); 3514 + } 3515 + if (savedAt.present) { 3516 + map['saved_at'] = Variable<DateTime>(savedAt.value); 3517 + } 3518 + return map; 3519 + } 3520 + 3521 + @override 3522 + String toString() { 3523 + return (StringBuffer('SavedPostsCompanion(') 3524 + ..write('id: $id, ') 3525 + ..write('accountDid: $accountDid, ') 3526 + ..write('postUri: $postUri, ') 3527 + ..write('postJson: $postJson, ') 3528 + ..write('savedAt: $savedAt') 3529 + ..write(')')) 3530 + .toString(); 3531 + } 3532 + } 3533 + 2669 3534 abstract class _$AppDatabase extends GeneratedDatabase { 2670 3535 _$AppDatabase(QueryExecutor e) : super(e); 2671 3536 $AppDatabaseManager get managers => $AppDatabaseManager(this); ··· 2676 3541 late final $SavedFeedsTable savedFeeds = $SavedFeedsTable(this); 2677 3542 late final $SearchHistoryTable searchHistory = $SearchHistoryTable(this); 2678 3543 late final $DraftsTable drafts = $DraftsTable(this); 3544 + late final $SavedPostsTable savedPosts = $SavedPostsTable(this); 2679 3545 @override 2680 - Iterable<TableInfo<Table, Object?>> get allTables => allSchemaEntities.whereType<TableInfo<Table, Object?>>(); 3546 + Iterable<TableInfo<Table, Object?>> get allTables => 3547 + allSchemaEntities.whereType<TableInfo<Table, Object?>>(); 2681 3548 @override 2682 3549 List<DatabaseSchemaEntity> get allSchemaEntities => [ 2683 3550 accounts, ··· 2687 3554 savedFeeds, 2688 3555 searchHistory, 2689 3556 drafts, 3557 + savedPosts, 2690 3558 ]; 2691 3559 } 2692 3560 ··· 2723 3591 Value<int> rowid, 2724 3592 }); 2725 3593 2726 - class $$AccountsTableFilterComposer extends Composer<_$AppDatabase, $AccountsTable> { 3594 + class $$AccountsTableFilterComposer 3595 + extends Composer<_$AppDatabase, $AccountsTable> { 2727 3596 $$AccountsTableFilterComposer({ 2728 3597 required super.$db, 2729 3598 required super.$table, ··· 2731 3600 super.$addJoinBuilderToRootComposer, 2732 3601 super.$removeJoinBuilderFromRootComposer, 2733 3602 }); 2734 - ColumnFilters<String> get did => $composableBuilder(column: $table.did, builder: (column) => ColumnFilters(column)); 3603 + ColumnFilters<String> get did => $composableBuilder( 3604 + column: $table.did, 3605 + builder: (column) => ColumnFilters(column), 3606 + ); 2735 3607 2736 - ColumnFilters<String> get handle => 2737 - $composableBuilder(column: $table.handle, builder: (column) => ColumnFilters(column)); 3608 + ColumnFilters<String> get handle => $composableBuilder( 3609 + column: $table.handle, 3610 + builder: (column) => ColumnFilters(column), 3611 + ); 2738 3612 2739 - ColumnFilters<String> get displayName => 2740 - $composableBuilder(column: $table.displayName, builder: (column) => ColumnFilters(column)); 3613 + ColumnFilters<String> get displayName => $composableBuilder( 3614 + column: $table.displayName, 3615 + builder: (column) => ColumnFilters(column), 3616 + ); 2741 3617 2742 - ColumnFilters<String> get service => 2743 - $composableBuilder(column: $table.service, builder: (column) => ColumnFilters(column)); 3618 + ColumnFilters<String> get service => $composableBuilder( 3619 + column: $table.service, 3620 + builder: (column) => ColumnFilters(column), 3621 + ); 2744 3622 2745 - ColumnFilters<String> get accessToken => 2746 - $composableBuilder(column: $table.accessToken, builder: (column) => ColumnFilters(column)); 3623 + ColumnFilters<String> get accessToken => $composableBuilder( 3624 + column: $table.accessToken, 3625 + builder: (column) => ColumnFilters(column), 3626 + ); 2747 3627 2748 - ColumnFilters<String> get refreshToken => 2749 - $composableBuilder(column: $table.refreshToken, builder: (column) => ColumnFilters(column)); 3628 + ColumnFilters<String> get refreshToken => $composableBuilder( 3629 + column: $table.refreshToken, 3630 + builder: (column) => ColumnFilters(column), 3631 + ); 2750 3632 2751 - ColumnFilters<String> get dpopPublicKey => 2752 - $composableBuilder(column: $table.dpopPublicKey, builder: (column) => ColumnFilters(column)); 3633 + ColumnFilters<String> get dpopPublicKey => $composableBuilder( 3634 + column: $table.dpopPublicKey, 3635 + builder: (column) => ColumnFilters(column), 3636 + ); 2753 3637 2754 - ColumnFilters<String> get dpopPrivateKey => 2755 - $composableBuilder(column: $table.dpopPrivateKey, builder: (column) => ColumnFilters(column)); 3638 + ColumnFilters<String> get dpopPrivateKey => $composableBuilder( 3639 + column: $table.dpopPrivateKey, 3640 + builder: (column) => ColumnFilters(column), 3641 + ); 2756 3642 2757 - ColumnFilters<String> get dpopNonce => 2758 - $composableBuilder(column: $table.dpopNonce, builder: (column) => ColumnFilters(column)); 3643 + ColumnFilters<String> get dpopNonce => $composableBuilder( 3644 + column: $table.dpopNonce, 3645 + builder: (column) => ColumnFilters(column), 3646 + ); 2759 3647 2760 - ColumnFilters<DateTime> get expiresAt => 2761 - $composableBuilder(column: $table.expiresAt, builder: (column) => ColumnFilters(column)); 3648 + ColumnFilters<DateTime> get expiresAt => $composableBuilder( 3649 + column: $table.expiresAt, 3650 + builder: (column) => ColumnFilters(column), 3651 + ); 2762 3652 2763 - ColumnFilters<DateTime> get createdAt => 2764 - $composableBuilder(column: $table.createdAt, builder: (column) => ColumnFilters(column)); 3653 + ColumnFilters<DateTime> get createdAt => $composableBuilder( 3654 + column: $table.createdAt, 3655 + builder: (column) => ColumnFilters(column), 3656 + ); 2765 3657 2766 - ColumnFilters<DateTime> get updatedAt => 2767 - $composableBuilder(column: $table.updatedAt, builder: (column) => ColumnFilters(column)); 3658 + ColumnFilters<DateTime> get updatedAt => $composableBuilder( 3659 + column: $table.updatedAt, 3660 + builder: (column) => ColumnFilters(column), 3661 + ); 2768 3662 } 2769 3663 2770 - class $$AccountsTableOrderingComposer extends Composer<_$AppDatabase, $AccountsTable> { 3664 + class $$AccountsTableOrderingComposer 3665 + extends Composer<_$AppDatabase, $AccountsTable> { 2771 3666 $$AccountsTableOrderingComposer({ 2772 3667 required super.$db, 2773 3668 required super.$table, ··· 2775 3670 super.$addJoinBuilderToRootComposer, 2776 3671 super.$removeJoinBuilderFromRootComposer, 2777 3672 }); 2778 - ColumnOrderings<String> get did => 2779 - $composableBuilder(column: $table.did, builder: (column) => ColumnOrderings(column)); 3673 + ColumnOrderings<String> get did => $composableBuilder( 3674 + column: $table.did, 3675 + builder: (column) => ColumnOrderings(column), 3676 + ); 2780 3677 2781 - ColumnOrderings<String> get handle => 2782 - $composableBuilder(column: $table.handle, builder: (column) => ColumnOrderings(column)); 3678 + ColumnOrderings<String> get handle => $composableBuilder( 3679 + column: $table.handle, 3680 + builder: (column) => ColumnOrderings(column), 3681 + ); 2783 3682 2784 - ColumnOrderings<String> get displayName => 2785 - $composableBuilder(column: $table.displayName, builder: (column) => ColumnOrderings(column)); 3683 + ColumnOrderings<String> get displayName => $composableBuilder( 3684 + column: $table.displayName, 3685 + builder: (column) => ColumnOrderings(column), 3686 + ); 2786 3687 2787 - ColumnOrderings<String> get service => 2788 - $composableBuilder(column: $table.service, builder: (column) => ColumnOrderings(column)); 3688 + ColumnOrderings<String> get service => $composableBuilder( 3689 + column: $table.service, 3690 + builder: (column) => ColumnOrderings(column), 3691 + ); 2789 3692 2790 - ColumnOrderings<String> get accessToken => 2791 - $composableBuilder(column: $table.accessToken, builder: (column) => ColumnOrderings(column)); 3693 + ColumnOrderings<String> get accessToken => $composableBuilder( 3694 + column: $table.accessToken, 3695 + builder: (column) => ColumnOrderings(column), 3696 + ); 2792 3697 2793 - ColumnOrderings<String> get refreshToken => 2794 - $composableBuilder(column: $table.refreshToken, builder: (column) => ColumnOrderings(column)); 3698 + ColumnOrderings<String> get refreshToken => $composableBuilder( 3699 + column: $table.refreshToken, 3700 + builder: (column) => ColumnOrderings(column), 3701 + ); 2795 3702 2796 - ColumnOrderings<String> get dpopPublicKey => 2797 - $composableBuilder(column: $table.dpopPublicKey, builder: (column) => ColumnOrderings(column)); 3703 + ColumnOrderings<String> get dpopPublicKey => $composableBuilder( 3704 + column: $table.dpopPublicKey, 3705 + builder: (column) => ColumnOrderings(column), 3706 + ); 2798 3707 2799 - ColumnOrderings<String> get dpopPrivateKey => 2800 - $composableBuilder(column: $table.dpopPrivateKey, builder: (column) => ColumnOrderings(column)); 3708 + ColumnOrderings<String> get dpopPrivateKey => $composableBuilder( 3709 + column: $table.dpopPrivateKey, 3710 + builder: (column) => ColumnOrderings(column), 3711 + ); 2801 3712 2802 - ColumnOrderings<String> get dpopNonce => 2803 - $composableBuilder(column: $table.dpopNonce, builder: (column) => ColumnOrderings(column)); 3713 + ColumnOrderings<String> get dpopNonce => $composableBuilder( 3714 + column: $table.dpopNonce, 3715 + builder: (column) => ColumnOrderings(column), 3716 + ); 2804 3717 2805 - ColumnOrderings<DateTime> get expiresAt => 2806 - $composableBuilder(column: $table.expiresAt, builder: (column) => ColumnOrderings(column)); 3718 + ColumnOrderings<DateTime> get expiresAt => $composableBuilder( 3719 + column: $table.expiresAt, 3720 + builder: (column) => ColumnOrderings(column), 3721 + ); 2807 3722 2808 - ColumnOrderings<DateTime> get createdAt => 2809 - $composableBuilder(column: $table.createdAt, builder: (column) => ColumnOrderings(column)); 3723 + ColumnOrderings<DateTime> get createdAt => $composableBuilder( 3724 + column: $table.createdAt, 3725 + builder: (column) => ColumnOrderings(column), 3726 + ); 2810 3727 2811 - ColumnOrderings<DateTime> get updatedAt => 2812 - $composableBuilder(column: $table.updatedAt, builder: (column) => ColumnOrderings(column)); 3728 + ColumnOrderings<DateTime> get updatedAt => $composableBuilder( 3729 + column: $table.updatedAt, 3730 + builder: (column) => ColumnOrderings(column), 3731 + ); 2813 3732 } 2814 3733 2815 - class $$AccountsTableAnnotationComposer extends Composer<_$AppDatabase, $AccountsTable> { 3734 + class $$AccountsTableAnnotationComposer 3735 + extends Composer<_$AppDatabase, $AccountsTable> { 2816 3736 $$AccountsTableAnnotationComposer({ 2817 3737 required super.$db, 2818 3738 required super.$table, ··· 2820 3740 super.$addJoinBuilderToRootComposer, 2821 3741 super.$removeJoinBuilderFromRootComposer, 2822 3742 }); 2823 - GeneratedColumn<String> get did => $composableBuilder(column: $table.did, builder: (column) => column); 3743 + GeneratedColumn<String> get did => 3744 + $composableBuilder(column: $table.did, builder: (column) => column); 2824 3745 2825 - GeneratedColumn<String> get handle => $composableBuilder(column: $table.handle, builder: (column) => column); 3746 + GeneratedColumn<String> get handle => 3747 + $composableBuilder(column: $table.handle, builder: (column) => column); 2826 3748 2827 - GeneratedColumn<String> get displayName => 2828 - $composableBuilder(column: $table.displayName, builder: (column) => column); 3749 + GeneratedColumn<String> get displayName => $composableBuilder( 3750 + column: $table.displayName, 3751 + builder: (column) => column, 3752 + ); 2829 3753 2830 - GeneratedColumn<String> get service => $composableBuilder(column: $table.service, builder: (column) => column); 3754 + GeneratedColumn<String> get service => 3755 + $composableBuilder(column: $table.service, builder: (column) => column); 2831 3756 2832 - GeneratedColumn<String> get accessToken => 2833 - $composableBuilder(column: $table.accessToken, builder: (column) => column); 3757 + GeneratedColumn<String> get accessToken => $composableBuilder( 3758 + column: $table.accessToken, 3759 + builder: (column) => column, 3760 + ); 2834 3761 2835 - GeneratedColumn<String> get refreshToken => 2836 - $composableBuilder(column: $table.refreshToken, builder: (column) => column); 3762 + GeneratedColumn<String> get refreshToken => $composableBuilder( 3763 + column: $table.refreshToken, 3764 + builder: (column) => column, 3765 + ); 2837 3766 2838 - GeneratedColumn<String> get dpopPublicKey => 2839 - $composableBuilder(column: $table.dpopPublicKey, builder: (column) => column); 3767 + GeneratedColumn<String> get dpopPublicKey => $composableBuilder( 3768 + column: $table.dpopPublicKey, 3769 + builder: (column) => column, 3770 + ); 2840 3771 2841 - GeneratedColumn<String> get dpopPrivateKey => 2842 - $composableBuilder(column: $table.dpopPrivateKey, builder: (column) => column); 3772 + GeneratedColumn<String> get dpopPrivateKey => $composableBuilder( 3773 + column: $table.dpopPrivateKey, 3774 + builder: (column) => column, 3775 + ); 2843 3776 2844 - GeneratedColumn<String> get dpopNonce => $composableBuilder(column: $table.dpopNonce, builder: (column) => column); 3777 + GeneratedColumn<String> get dpopNonce => 3778 + $composableBuilder(column: $table.dpopNonce, builder: (column) => column); 2845 3779 2846 - GeneratedColumn<DateTime> get expiresAt => $composableBuilder(column: $table.expiresAt, builder: (column) => column); 3780 + GeneratedColumn<DateTime> get expiresAt => 3781 + $composableBuilder(column: $table.expiresAt, builder: (column) => column); 2847 3782 2848 - GeneratedColumn<DateTime> get createdAt => $composableBuilder(column: $table.createdAt, builder: (column) => column); 3783 + GeneratedColumn<DateTime> get createdAt => 3784 + $composableBuilder(column: $table.createdAt, builder: (column) => column); 2849 3785 2850 - GeneratedColumn<DateTime> get updatedAt => $composableBuilder(column: $table.updatedAt, builder: (column) => column); 3786 + GeneratedColumn<DateTime> get updatedAt => 3787 + $composableBuilder(column: $table.updatedAt, builder: (column) => column); 2851 3788 } 2852 3789 2853 3790 class $$AccountsTableTableManager ··· 2870 3807 TableManagerState( 2871 3808 db: db, 2872 3809 table: table, 2873 - createFilteringComposer: () => $$AccountsTableFilterComposer($db: db, $table: table), 2874 - createOrderingComposer: () => $$AccountsTableOrderingComposer($db: db, $table: table), 2875 - createComputedFieldComposer: () => $$AccountsTableAnnotationComposer($db: db, $table: table), 3810 + createFilteringComposer: () => 3811 + $$AccountsTableFilterComposer($db: db, $table: table), 3812 + createOrderingComposer: () => 3813 + $$AccountsTableOrderingComposer($db: db, $table: table), 3814 + createComputedFieldComposer: () => 3815 + $$AccountsTableAnnotationComposer($db: db, $table: table), 2876 3816 updateCompanionCallback: 2877 3817 ({ 2878 3818 Value<String> did = const Value.absent(), ··· 2933 3873 updatedAt: updatedAt, 2934 3874 rowid: rowid, 2935 3875 ), 2936 - withReferenceMapper: (p0) => p0.map((e) => (e.readTable(table), BaseReferences(db, table, e))).toList(), 3876 + withReferenceMapper: (p0) => p0 3877 + .map((e) => (e.readTable(table), BaseReferences(db, table, e))) 3878 + .toList(), 2937 3879 prefetchHooksCallback: null, 2938 3880 ), 2939 3881 ); ··· 2970 3912 Value<int> rowid, 2971 3913 }); 2972 3914 2973 - class $$CachedProfilesTableFilterComposer extends Composer<_$AppDatabase, $CachedProfilesTable> { 3915 + class $$CachedProfilesTableFilterComposer 3916 + extends Composer<_$AppDatabase, $CachedProfilesTable> { 2974 3917 $$CachedProfilesTableFilterComposer({ 2975 3918 required super.$db, 2976 3919 required super.$table, ··· 2978 3921 super.$addJoinBuilderToRootComposer, 2979 3922 super.$removeJoinBuilderFromRootComposer, 2980 3923 }); 2981 - ColumnFilters<String> get did => $composableBuilder(column: $table.did, builder: (column) => ColumnFilters(column)); 3924 + ColumnFilters<String> get did => $composableBuilder( 3925 + column: $table.did, 3926 + builder: (column) => ColumnFilters(column), 3927 + ); 2982 3928 2983 - ColumnFilters<String> get handle => 2984 - $composableBuilder(column: $table.handle, builder: (column) => ColumnFilters(column)); 3929 + ColumnFilters<String> get handle => $composableBuilder( 3930 + column: $table.handle, 3931 + builder: (column) => ColumnFilters(column), 3932 + ); 2985 3933 2986 - ColumnFilters<String> get payload => 2987 - $composableBuilder(column: $table.payload, builder: (column) => ColumnFilters(column)); 3934 + ColumnFilters<String> get payload => $composableBuilder( 3935 + column: $table.payload, 3936 + builder: (column) => ColumnFilters(column), 3937 + ); 2988 3938 2989 - ColumnFilters<DateTime> get fetchedAt => 2990 - $composableBuilder(column: $table.fetchedAt, builder: (column) => ColumnFilters(column)); 3939 + ColumnFilters<DateTime> get fetchedAt => $composableBuilder( 3940 + column: $table.fetchedAt, 3941 + builder: (column) => ColumnFilters(column), 3942 + ); 2991 3943 } 2992 3944 2993 - class $$CachedProfilesTableOrderingComposer extends Composer<_$AppDatabase, $CachedProfilesTable> { 3945 + class $$CachedProfilesTableOrderingComposer 3946 + extends Composer<_$AppDatabase, $CachedProfilesTable> { 2994 3947 $$CachedProfilesTableOrderingComposer({ 2995 3948 required super.$db, 2996 3949 required super.$table, ··· 2998 3951 super.$addJoinBuilderToRootComposer, 2999 3952 super.$removeJoinBuilderFromRootComposer, 3000 3953 }); 3001 - ColumnOrderings<String> get did => 3002 - $composableBuilder(column: $table.did, builder: (column) => ColumnOrderings(column)); 3954 + ColumnOrderings<String> get did => $composableBuilder( 3955 + column: $table.did, 3956 + builder: (column) => ColumnOrderings(column), 3957 + ); 3003 3958 3004 - ColumnOrderings<String> get handle => 3005 - $composableBuilder(column: $table.handle, builder: (column) => ColumnOrderings(column)); 3959 + ColumnOrderings<String> get handle => $composableBuilder( 3960 + column: $table.handle, 3961 + builder: (column) => ColumnOrderings(column), 3962 + ); 3006 3963 3007 - ColumnOrderings<String> get payload => 3008 - $composableBuilder(column: $table.payload, builder: (column) => ColumnOrderings(column)); 3964 + ColumnOrderings<String> get payload => $composableBuilder( 3965 + column: $table.payload, 3966 + builder: (column) => ColumnOrderings(column), 3967 + ); 3009 3968 3010 - ColumnOrderings<DateTime> get fetchedAt => 3011 - $composableBuilder(column: $table.fetchedAt, builder: (column) => ColumnOrderings(column)); 3969 + ColumnOrderings<DateTime> get fetchedAt => $composableBuilder( 3970 + column: $table.fetchedAt, 3971 + builder: (column) => ColumnOrderings(column), 3972 + ); 3012 3973 } 3013 3974 3014 - class $$CachedProfilesTableAnnotationComposer extends Composer<_$AppDatabase, $CachedProfilesTable> { 3975 + class $$CachedProfilesTableAnnotationComposer 3976 + extends Composer<_$AppDatabase, $CachedProfilesTable> { 3015 3977 $$CachedProfilesTableAnnotationComposer({ 3016 3978 required super.$db, 3017 3979 required super.$table, ··· 3019 3981 super.$addJoinBuilderToRootComposer, 3020 3982 super.$removeJoinBuilderFromRootComposer, 3021 3983 }); 3022 - GeneratedColumn<String> get did => $composableBuilder(column: $table.did, builder: (column) => column); 3984 + GeneratedColumn<String> get did => 3985 + $composableBuilder(column: $table.did, builder: (column) => column); 3023 3986 3024 - GeneratedColumn<String> get handle => $composableBuilder(column: $table.handle, builder: (column) => column); 3987 + GeneratedColumn<String> get handle => 3988 + $composableBuilder(column: $table.handle, builder: (column) => column); 3025 3989 3026 - GeneratedColumn<String> get payload => $composableBuilder(column: $table.payload, builder: (column) => column); 3990 + GeneratedColumn<String> get payload => 3991 + $composableBuilder(column: $table.payload, builder: (column) => column); 3027 3992 3028 - GeneratedColumn<DateTime> get fetchedAt => $composableBuilder(column: $table.fetchedAt, builder: (column) => column); 3993 + GeneratedColumn<DateTime> get fetchedAt => 3994 + $composableBuilder(column: $table.fetchedAt, builder: (column) => column); 3029 3995 } 3030 3996 3031 3997 class $$CachedProfilesTableTableManager ··· 3039 4005 $$CachedProfilesTableAnnotationComposer, 3040 4006 $$CachedProfilesTableCreateCompanionBuilder, 3041 4007 $$CachedProfilesTableUpdateCompanionBuilder, 3042 - (CachedProfile, BaseReferences<_$AppDatabase, $CachedProfilesTable, CachedProfile>), 4008 + ( 4009 + CachedProfile, 4010 + BaseReferences<_$AppDatabase, $CachedProfilesTable, CachedProfile>, 4011 + ), 3043 4012 CachedProfile, 3044 4013 PrefetchHooks Function() 3045 4014 > { 3046 - $$CachedProfilesTableTableManager(_$AppDatabase db, $CachedProfilesTable table) 3047 - : super( 4015 + $$CachedProfilesTableTableManager( 4016 + _$AppDatabase db, 4017 + $CachedProfilesTable table, 4018 + ) : super( 3048 4019 TableManagerState( 3049 4020 db: db, 3050 4021 table: table, 3051 - createFilteringComposer: () => $$CachedProfilesTableFilterComposer($db: db, $table: table), 3052 - createOrderingComposer: () => $$CachedProfilesTableOrderingComposer($db: db, $table: table), 3053 - createComputedFieldComposer: () => $$CachedProfilesTableAnnotationComposer($db: db, $table: table), 4022 + createFilteringComposer: () => 4023 + $$CachedProfilesTableFilterComposer($db: db, $table: table), 4024 + createOrderingComposer: () => 4025 + $$CachedProfilesTableOrderingComposer($db: db, $table: table), 4026 + createComputedFieldComposer: () => 4027 + $$CachedProfilesTableAnnotationComposer($db: db, $table: table), 3054 4028 updateCompanionCallback: 3055 4029 ({ 3056 4030 Value<String> did = const Value.absent(), ··· 3079 4053 fetchedAt: fetchedAt, 3080 4054 rowid: rowid, 3081 4055 ), 3082 - withReferenceMapper: (p0) => p0.map((e) => (e.readTable(table), BaseReferences(db, table, e))).toList(), 4056 + withReferenceMapper: (p0) => p0 4057 + .map((e) => (e.readTable(table), BaseReferences(db, table, e))) 4058 + .toList(), 3083 4059 prefetchHooksCallback: null, 3084 4060 ), 3085 4061 ); ··· 3095 4071 $$CachedProfilesTableAnnotationComposer, 3096 4072 $$CachedProfilesTableCreateCompanionBuilder, 3097 4073 $$CachedProfilesTableUpdateCompanionBuilder, 3098 - (CachedProfile, BaseReferences<_$AppDatabase, $CachedProfilesTable, CachedProfile>), 4074 + ( 4075 + CachedProfile, 4076 + BaseReferences<_$AppDatabase, $CachedProfilesTable, CachedProfile>, 4077 + ), 3099 4078 CachedProfile, 3100 4079 PrefetchHooks Function() 3101 4080 >; ··· 3118 4097 Value<int> rowid, 3119 4098 }); 3120 4099 3121 - class $$CachedPostsTableFilterComposer extends Composer<_$AppDatabase, $CachedPostsTable> { 4100 + class $$CachedPostsTableFilterComposer 4101 + extends Composer<_$AppDatabase, $CachedPostsTable> { 3122 4102 $$CachedPostsTableFilterComposer({ 3123 4103 required super.$db, 3124 4104 required super.$table, ··· 3126 4106 super.$addJoinBuilderToRootComposer, 3127 4107 super.$removeJoinBuilderFromRootComposer, 3128 4108 }); 3129 - ColumnFilters<String> get uri => $composableBuilder(column: $table.uri, builder: (column) => ColumnFilters(column)); 4109 + ColumnFilters<String> get uri => $composableBuilder( 4110 + column: $table.uri, 4111 + builder: (column) => ColumnFilters(column), 4112 + ); 3130 4113 3131 - ColumnFilters<String> get authorDid => 3132 - $composableBuilder(column: $table.authorDid, builder: (column) => ColumnFilters(column)); 4114 + ColumnFilters<String> get authorDid => $composableBuilder( 4115 + column: $table.authorDid, 4116 + builder: (column) => ColumnFilters(column), 4117 + ); 3133 4118 3134 - ColumnFilters<String> get payload => 3135 - $composableBuilder(column: $table.payload, builder: (column) => ColumnFilters(column)); 4119 + ColumnFilters<String> get payload => $composableBuilder( 4120 + column: $table.payload, 4121 + builder: (column) => ColumnFilters(column), 4122 + ); 3136 4123 3137 - ColumnFilters<DateTime> get createdAt => 3138 - $composableBuilder(column: $table.createdAt, builder: (column) => ColumnFilters(column)); 4124 + ColumnFilters<DateTime> get createdAt => $composableBuilder( 4125 + column: $table.createdAt, 4126 + builder: (column) => ColumnFilters(column), 4127 + ); 3139 4128 3140 - ColumnFilters<DateTime> get fetchedAt => 3141 - $composableBuilder(column: $table.fetchedAt, builder: (column) => ColumnFilters(column)); 4129 + ColumnFilters<DateTime> get fetchedAt => $composableBuilder( 4130 + column: $table.fetchedAt, 4131 + builder: (column) => ColumnFilters(column), 4132 + ); 3142 4133 } 3143 4134 3144 - class $$CachedPostsTableOrderingComposer extends Composer<_$AppDatabase, $CachedPostsTable> { 4135 + class $$CachedPostsTableOrderingComposer 4136 + extends Composer<_$AppDatabase, $CachedPostsTable> { 3145 4137 $$CachedPostsTableOrderingComposer({ 3146 4138 required super.$db, 3147 4139 required super.$table, ··· 3149 4141 super.$addJoinBuilderToRootComposer, 3150 4142 super.$removeJoinBuilderFromRootComposer, 3151 4143 }); 3152 - ColumnOrderings<String> get uri => 3153 - $composableBuilder(column: $table.uri, builder: (column) => ColumnOrderings(column)); 4144 + ColumnOrderings<String> get uri => $composableBuilder( 4145 + column: $table.uri, 4146 + builder: (column) => ColumnOrderings(column), 4147 + ); 3154 4148 3155 - ColumnOrderings<String> get authorDid => 3156 - $composableBuilder(column: $table.authorDid, builder: (column) => ColumnOrderings(column)); 4149 + ColumnOrderings<String> get authorDid => $composableBuilder( 4150 + column: $table.authorDid, 4151 + builder: (column) => ColumnOrderings(column), 4152 + ); 3157 4153 3158 - ColumnOrderings<String> get payload => 3159 - $composableBuilder(column: $table.payload, builder: (column) => ColumnOrderings(column)); 4154 + ColumnOrderings<String> get payload => $composableBuilder( 4155 + column: $table.payload, 4156 + builder: (column) => ColumnOrderings(column), 4157 + ); 3160 4158 3161 - ColumnOrderings<DateTime> get createdAt => 3162 - $composableBuilder(column: $table.createdAt, builder: (column) => ColumnOrderings(column)); 4159 + ColumnOrderings<DateTime> get createdAt => $composableBuilder( 4160 + column: $table.createdAt, 4161 + builder: (column) => ColumnOrderings(column), 4162 + ); 3163 4163 3164 - ColumnOrderings<DateTime> get fetchedAt => 3165 - $composableBuilder(column: $table.fetchedAt, builder: (column) => ColumnOrderings(column)); 4164 + ColumnOrderings<DateTime> get fetchedAt => $composableBuilder( 4165 + column: $table.fetchedAt, 4166 + builder: (column) => ColumnOrderings(column), 4167 + ); 3166 4168 } 3167 4169 3168 - class $$CachedPostsTableAnnotationComposer extends Composer<_$AppDatabase, $CachedPostsTable> { 4170 + class $$CachedPostsTableAnnotationComposer 4171 + extends Composer<_$AppDatabase, $CachedPostsTable> { 3169 4172 $$CachedPostsTableAnnotationComposer({ 3170 4173 required super.$db, 3171 4174 required super.$table, ··· 3173 4176 super.$addJoinBuilderToRootComposer, 3174 4177 super.$removeJoinBuilderFromRootComposer, 3175 4178 }); 3176 - GeneratedColumn<String> get uri => $composableBuilder(column: $table.uri, builder: (column) => column); 4179 + GeneratedColumn<String> get uri => 4180 + $composableBuilder(column: $table.uri, builder: (column) => column); 3177 4181 3178 - GeneratedColumn<String> get authorDid => $composableBuilder(column: $table.authorDid, builder: (column) => column); 4182 + GeneratedColumn<String> get authorDid => 4183 + $composableBuilder(column: $table.authorDid, builder: (column) => column); 3179 4184 3180 - GeneratedColumn<String> get payload => $composableBuilder(column: $table.payload, builder: (column) => column); 4185 + GeneratedColumn<String> get payload => 4186 + $composableBuilder(column: $table.payload, builder: (column) => column); 3181 4187 3182 - GeneratedColumn<DateTime> get createdAt => $composableBuilder(column: $table.createdAt, builder: (column) => column); 4188 + GeneratedColumn<DateTime> get createdAt => 4189 + $composableBuilder(column: $table.createdAt, builder: (column) => column); 3183 4190 3184 - GeneratedColumn<DateTime> get fetchedAt => $composableBuilder(column: $table.fetchedAt, builder: (column) => column); 4191 + GeneratedColumn<DateTime> get fetchedAt => 4192 + $composableBuilder(column: $table.fetchedAt, builder: (column) => column); 3185 4193 } 3186 4194 3187 4195 class $$CachedPostsTableTableManager ··· 3195 4203 $$CachedPostsTableAnnotationComposer, 3196 4204 $$CachedPostsTableCreateCompanionBuilder, 3197 4205 $$CachedPostsTableUpdateCompanionBuilder, 3198 - (CachedPost, BaseReferences<_$AppDatabase, $CachedPostsTable, CachedPost>), 4206 + ( 4207 + CachedPost, 4208 + BaseReferences<_$AppDatabase, $CachedPostsTable, CachedPost>, 4209 + ), 3199 4210 CachedPost, 3200 4211 PrefetchHooks Function() 3201 4212 > { ··· 3204 4215 TableManagerState( 3205 4216 db: db, 3206 4217 table: table, 3207 - createFilteringComposer: () => $$CachedPostsTableFilterComposer($db: db, $table: table), 3208 - createOrderingComposer: () => $$CachedPostsTableOrderingComposer($db: db, $table: table), 3209 - createComputedFieldComposer: () => $$CachedPostsTableAnnotationComposer($db: db, $table: table), 4218 + createFilteringComposer: () => 4219 + $$CachedPostsTableFilterComposer($db: db, $table: table), 4220 + createOrderingComposer: () => 4221 + $$CachedPostsTableOrderingComposer($db: db, $table: table), 4222 + createComputedFieldComposer: () => 4223 + $$CachedPostsTableAnnotationComposer($db: db, $table: table), 3210 4224 updateCompanionCallback: 3211 4225 ({ 3212 4226 Value<String> uri = const Value.absent(), ··· 3239 4253 fetchedAt: fetchedAt, 3240 4254 rowid: rowid, 3241 4255 ), 3242 - withReferenceMapper: (p0) => p0.map((e) => (e.readTable(table), BaseReferences(db, table, e))).toList(), 4256 + withReferenceMapper: (p0) => p0 4257 + .map((e) => (e.readTable(table), BaseReferences(db, table, e))) 4258 + .toList(), 3243 4259 prefetchHooksCallback: null, 3244 4260 ), 3245 4261 ); ··· 3255 4271 $$CachedPostsTableAnnotationComposer, 3256 4272 $$CachedPostsTableCreateCompanionBuilder, 3257 4273 $$CachedPostsTableUpdateCompanionBuilder, 3258 - (CachedPost, BaseReferences<_$AppDatabase, $CachedPostsTable, CachedPost>), 4274 + ( 4275 + CachedPost, 4276 + BaseReferences<_$AppDatabase, $CachedPostsTable, CachedPost>, 4277 + ), 3259 4278 CachedPost, 3260 4279 PrefetchHooks Function() 3261 4280 >; ··· 3267 4286 Value<int> rowid, 3268 4287 }); 3269 4288 typedef $$SettingsTableUpdateCompanionBuilder = 3270 - SettingsCompanion Function({Value<String> key, Value<String> value, Value<DateTime> updatedAt, Value<int> rowid}); 4289 + SettingsCompanion Function({ 4290 + Value<String> key, 4291 + Value<String> value, 4292 + Value<DateTime> updatedAt, 4293 + Value<int> rowid, 4294 + }); 3271 4295 3272 - class $$SettingsTableFilterComposer extends Composer<_$AppDatabase, $SettingsTable> { 4296 + class $$SettingsTableFilterComposer 4297 + extends Composer<_$AppDatabase, $SettingsTable> { 3273 4298 $$SettingsTableFilterComposer({ 3274 4299 required super.$db, 3275 4300 required super.$table, ··· 3277 4302 super.$addJoinBuilderToRootComposer, 3278 4303 super.$removeJoinBuilderFromRootComposer, 3279 4304 }); 3280 - ColumnFilters<String> get key => $composableBuilder(column: $table.key, builder: (column) => ColumnFilters(column)); 4305 + ColumnFilters<String> get key => $composableBuilder( 4306 + column: $table.key, 4307 + builder: (column) => ColumnFilters(column), 4308 + ); 3281 4309 3282 - ColumnFilters<String> get value => 3283 - $composableBuilder(column: $table.value, builder: (column) => ColumnFilters(column)); 4310 + ColumnFilters<String> get value => $composableBuilder( 4311 + column: $table.value, 4312 + builder: (column) => ColumnFilters(column), 4313 + ); 3284 4314 3285 - ColumnFilters<DateTime> get updatedAt => 3286 - $composableBuilder(column: $table.updatedAt, builder: (column) => ColumnFilters(column)); 4315 + ColumnFilters<DateTime> get updatedAt => $composableBuilder( 4316 + column: $table.updatedAt, 4317 + builder: (column) => ColumnFilters(column), 4318 + ); 3287 4319 } 3288 4320 3289 - class $$SettingsTableOrderingComposer extends Composer<_$AppDatabase, $SettingsTable> { 4321 + class $$SettingsTableOrderingComposer 4322 + extends Composer<_$AppDatabase, $SettingsTable> { 3290 4323 $$SettingsTableOrderingComposer({ 3291 4324 required super.$db, 3292 4325 required super.$table, ··· 3294 4327 super.$addJoinBuilderToRootComposer, 3295 4328 super.$removeJoinBuilderFromRootComposer, 3296 4329 }); 3297 - ColumnOrderings<String> get key => 3298 - $composableBuilder(column: $table.key, builder: (column) => ColumnOrderings(column)); 4330 + ColumnOrderings<String> get key => $composableBuilder( 4331 + column: $table.key, 4332 + builder: (column) => ColumnOrderings(column), 4333 + ); 3299 4334 3300 - ColumnOrderings<String> get value => 3301 - $composableBuilder(column: $table.value, builder: (column) => ColumnOrderings(column)); 4335 + ColumnOrderings<String> get value => $composableBuilder( 4336 + column: $table.value, 4337 + builder: (column) => ColumnOrderings(column), 4338 + ); 3302 4339 3303 - ColumnOrderings<DateTime> get updatedAt => 3304 - $composableBuilder(column: $table.updatedAt, builder: (column) => ColumnOrderings(column)); 4340 + ColumnOrderings<DateTime> get updatedAt => $composableBuilder( 4341 + column: $table.updatedAt, 4342 + builder: (column) => ColumnOrderings(column), 4343 + ); 3305 4344 } 3306 4345 3307 - class $$SettingsTableAnnotationComposer extends Composer<_$AppDatabase, $SettingsTable> { 4346 + class $$SettingsTableAnnotationComposer 4347 + extends Composer<_$AppDatabase, $SettingsTable> { 3308 4348 $$SettingsTableAnnotationComposer({ 3309 4349 required super.$db, 3310 4350 required super.$table, ··· 3312 4352 super.$addJoinBuilderToRootComposer, 3313 4353 super.$removeJoinBuilderFromRootComposer, 3314 4354 }); 3315 - GeneratedColumn<String> get key => $composableBuilder(column: $table.key, builder: (column) => column); 4355 + GeneratedColumn<String> get key => 4356 + $composableBuilder(column: $table.key, builder: (column) => column); 3316 4357 3317 - GeneratedColumn<String> get value => $composableBuilder(column: $table.value, builder: (column) => column); 4358 + GeneratedColumn<String> get value => 4359 + $composableBuilder(column: $table.value, builder: (column) => column); 3318 4360 3319 - GeneratedColumn<DateTime> get updatedAt => $composableBuilder(column: $table.updatedAt, builder: (column) => column); 4361 + GeneratedColumn<DateTime> get updatedAt => 4362 + $composableBuilder(column: $table.updatedAt, builder: (column) => column); 3320 4363 } 3321 4364 3322 4365 class $$SettingsTableTableManager ··· 3330 4373 $$SettingsTableAnnotationComposer, 3331 4374 $$SettingsTableCreateCompanionBuilder, 3332 4375 $$SettingsTableUpdateCompanionBuilder, 3333 - (SettingsEntry, BaseReferences<_$AppDatabase, $SettingsTable, SettingsEntry>), 4376 + ( 4377 + SettingsEntry, 4378 + BaseReferences<_$AppDatabase, $SettingsTable, SettingsEntry>, 4379 + ), 3334 4380 SettingsEntry, 3335 4381 PrefetchHooks Function() 3336 4382 > { ··· 3339 4385 TableManagerState( 3340 4386 db: db, 3341 4387 table: table, 3342 - createFilteringComposer: () => $$SettingsTableFilterComposer($db: db, $table: table), 3343 - createOrderingComposer: () => $$SettingsTableOrderingComposer($db: db, $table: table), 3344 - createComputedFieldComposer: () => $$SettingsTableAnnotationComposer($db: db, $table: table), 4388 + createFilteringComposer: () => 4389 + $$SettingsTableFilterComposer($db: db, $table: table), 4390 + createOrderingComposer: () => 4391 + $$SettingsTableOrderingComposer($db: db, $table: table), 4392 + createComputedFieldComposer: () => 4393 + $$SettingsTableAnnotationComposer($db: db, $table: table), 3345 4394 updateCompanionCallback: 3346 4395 ({ 3347 4396 Value<String> key = const Value.absent(), 3348 4397 Value<String> value = const Value.absent(), 3349 4398 Value<DateTime> updatedAt = const Value.absent(), 3350 4399 Value<int> rowid = const Value.absent(), 3351 - }) => SettingsCompanion(key: key, value: value, updatedAt: updatedAt, rowid: rowid), 4400 + }) => SettingsCompanion( 4401 + key: key, 4402 + value: value, 4403 + updatedAt: updatedAt, 4404 + rowid: rowid, 4405 + ), 3352 4406 createCompanionCallback: 3353 4407 ({ 3354 4408 required String key, 3355 4409 required String value, 3356 4410 Value<DateTime> updatedAt = const Value.absent(), 3357 4411 Value<int> rowid = const Value.absent(), 3358 - }) => SettingsCompanion.insert(key: key, value: value, updatedAt: updatedAt, rowid: rowid), 3359 - withReferenceMapper: (p0) => p0.map((e) => (e.readTable(table), BaseReferences(db, table, e))).toList(), 4412 + }) => SettingsCompanion.insert( 4413 + key: key, 4414 + value: value, 4415 + updatedAt: updatedAt, 4416 + rowid: rowid, 4417 + ), 4418 + withReferenceMapper: (p0) => p0 4419 + .map((e) => (e.readTable(table), BaseReferences(db, table, e))) 4420 + .toList(), 3360 4421 prefetchHooksCallback: null, 3361 4422 ), 3362 4423 ); ··· 3372 4433 $$SettingsTableAnnotationComposer, 3373 4434 $$SettingsTableCreateCompanionBuilder, 3374 4435 $$SettingsTableUpdateCompanionBuilder, 3375 - (SettingsEntry, BaseReferences<_$AppDatabase, $SettingsTable, SettingsEntry>), 4436 + ( 4437 + SettingsEntry, 4438 + BaseReferences<_$AppDatabase, $SettingsTable, SettingsEntry>, 4439 + ), 3376 4440 SettingsEntry, 3377 4441 PrefetchHooks Function() 3378 4442 >; ··· 3399 4463 Value<int> rowid, 3400 4464 }); 3401 4465 3402 - class $$SavedFeedsTableFilterComposer extends Composer<_$AppDatabase, $SavedFeedsTable> { 4466 + class $$SavedFeedsTableFilterComposer 4467 + extends Composer<_$AppDatabase, $SavedFeedsTable> { 3403 4468 $$SavedFeedsTableFilterComposer({ 3404 4469 required super.$db, 3405 4470 required super.$table, ··· 3407 4472 super.$addJoinBuilderToRootComposer, 3408 4473 super.$removeJoinBuilderFromRootComposer, 3409 4474 }); 3410 - ColumnFilters<String> get id => $composableBuilder(column: $table.id, builder: (column) => ColumnFilters(column)); 4475 + ColumnFilters<String> get id => $composableBuilder( 4476 + column: $table.id, 4477 + builder: (column) => ColumnFilters(column), 4478 + ); 3411 4479 3412 - ColumnFilters<String> get accountDid => 3413 - $composableBuilder(column: $table.accountDid, builder: (column) => ColumnFilters(column)); 4480 + ColumnFilters<String> get accountDid => $composableBuilder( 4481 + column: $table.accountDid, 4482 + builder: (column) => ColumnFilters(column), 4483 + ); 3414 4484 3415 - ColumnFilters<String> get type => $composableBuilder(column: $table.type, builder: (column) => ColumnFilters(column)); 4485 + ColumnFilters<String> get type => $composableBuilder( 4486 + column: $table.type, 4487 + builder: (column) => ColumnFilters(column), 4488 + ); 3416 4489 3417 - ColumnFilters<String> get value => 3418 - $composableBuilder(column: $table.value, builder: (column) => ColumnFilters(column)); 4490 + ColumnFilters<String> get value => $composableBuilder( 4491 + column: $table.value, 4492 + builder: (column) => ColumnFilters(column), 4493 + ); 3419 4494 3420 - ColumnFilters<bool> get pinned => 3421 - $composableBuilder(column: $table.pinned, builder: (column) => ColumnFilters(column)); 4495 + ColumnFilters<bool> get pinned => $composableBuilder( 4496 + column: $table.pinned, 4497 + builder: (column) => ColumnFilters(column), 4498 + ); 3422 4499 3423 - ColumnFilters<int> get sortOrder => 3424 - $composableBuilder(column: $table.sortOrder, builder: (column) => ColumnFilters(column)); 4500 + ColumnFilters<int> get sortOrder => $composableBuilder( 4501 + column: $table.sortOrder, 4502 + builder: (column) => ColumnFilters(column), 4503 + ); 3425 4504 3426 - ColumnFilters<DateTime> get updatedAt => 3427 - $composableBuilder(column: $table.updatedAt, builder: (column) => ColumnFilters(column)); 4505 + ColumnFilters<DateTime> get updatedAt => $composableBuilder( 4506 + column: $table.updatedAt, 4507 + builder: (column) => ColumnFilters(column), 4508 + ); 3428 4509 } 3429 4510 3430 - class $$SavedFeedsTableOrderingComposer extends Composer<_$AppDatabase, $SavedFeedsTable> { 4511 + class $$SavedFeedsTableOrderingComposer 4512 + extends Composer<_$AppDatabase, $SavedFeedsTable> { 3431 4513 $$SavedFeedsTableOrderingComposer({ 3432 4514 required super.$db, 3433 4515 required super.$table, ··· 3435 4517 super.$addJoinBuilderToRootComposer, 3436 4518 super.$removeJoinBuilderFromRootComposer, 3437 4519 }); 3438 - ColumnOrderings<String> get id => $composableBuilder(column: $table.id, builder: (column) => ColumnOrderings(column)); 4520 + ColumnOrderings<String> get id => $composableBuilder( 4521 + column: $table.id, 4522 + builder: (column) => ColumnOrderings(column), 4523 + ); 3439 4524 3440 - ColumnOrderings<String> get accountDid => 3441 - $composableBuilder(column: $table.accountDid, builder: (column) => ColumnOrderings(column)); 4525 + ColumnOrderings<String> get accountDid => $composableBuilder( 4526 + column: $table.accountDid, 4527 + builder: (column) => ColumnOrderings(column), 4528 + ); 3442 4529 3443 - ColumnOrderings<String> get type => 3444 - $composableBuilder(column: $table.type, builder: (column) => ColumnOrderings(column)); 4530 + ColumnOrderings<String> get type => $composableBuilder( 4531 + column: $table.type, 4532 + builder: (column) => ColumnOrderings(column), 4533 + ); 3445 4534 3446 - ColumnOrderings<String> get value => 3447 - $composableBuilder(column: $table.value, builder: (column) => ColumnOrderings(column)); 4535 + ColumnOrderings<String> get value => $composableBuilder( 4536 + column: $table.value, 4537 + builder: (column) => ColumnOrderings(column), 4538 + ); 3448 4539 3449 - ColumnOrderings<bool> get pinned => 3450 - $composableBuilder(column: $table.pinned, builder: (column) => ColumnOrderings(column)); 4540 + ColumnOrderings<bool> get pinned => $composableBuilder( 4541 + column: $table.pinned, 4542 + builder: (column) => ColumnOrderings(column), 4543 + ); 3451 4544 3452 - ColumnOrderings<int> get sortOrder => 3453 - $composableBuilder(column: $table.sortOrder, builder: (column) => ColumnOrderings(column)); 4545 + ColumnOrderings<int> get sortOrder => $composableBuilder( 4546 + column: $table.sortOrder, 4547 + builder: (column) => ColumnOrderings(column), 4548 + ); 3454 4549 3455 - ColumnOrderings<DateTime> get updatedAt => 3456 - $composableBuilder(column: $table.updatedAt, builder: (column) => ColumnOrderings(column)); 4550 + ColumnOrderings<DateTime> get updatedAt => $composableBuilder( 4551 + column: $table.updatedAt, 4552 + builder: (column) => ColumnOrderings(column), 4553 + ); 3457 4554 } 3458 4555 3459 - class $$SavedFeedsTableAnnotationComposer extends Composer<_$AppDatabase, $SavedFeedsTable> { 4556 + class $$SavedFeedsTableAnnotationComposer 4557 + extends Composer<_$AppDatabase, $SavedFeedsTable> { 3460 4558 $$SavedFeedsTableAnnotationComposer({ 3461 4559 required super.$db, 3462 4560 required super.$table, ··· 3464 4562 super.$addJoinBuilderToRootComposer, 3465 4563 super.$removeJoinBuilderFromRootComposer, 3466 4564 }); 3467 - GeneratedColumn<String> get id => $composableBuilder(column: $table.id, builder: (column) => column); 4565 + GeneratedColumn<String> get id => 4566 + $composableBuilder(column: $table.id, builder: (column) => column); 3468 4567 3469 - GeneratedColumn<String> get accountDid => $composableBuilder(column: $table.accountDid, builder: (column) => column); 4568 + GeneratedColumn<String> get accountDid => $composableBuilder( 4569 + column: $table.accountDid, 4570 + builder: (column) => column, 4571 + ); 3470 4572 3471 - GeneratedColumn<String> get type => $composableBuilder(column: $table.type, builder: (column) => column); 4573 + GeneratedColumn<String> get type => 4574 + $composableBuilder(column: $table.type, builder: (column) => column); 3472 4575 3473 - GeneratedColumn<String> get value => $composableBuilder(column: $table.value, builder: (column) => column); 4576 + GeneratedColumn<String> get value => 4577 + $composableBuilder(column: $table.value, builder: (column) => column); 3474 4578 3475 - GeneratedColumn<bool> get pinned => $composableBuilder(column: $table.pinned, builder: (column) => column); 4579 + GeneratedColumn<bool> get pinned => 4580 + $composableBuilder(column: $table.pinned, builder: (column) => column); 3476 4581 3477 - GeneratedColumn<int> get sortOrder => $composableBuilder(column: $table.sortOrder, builder: (column) => column); 4582 + GeneratedColumn<int> get sortOrder => 4583 + $composableBuilder(column: $table.sortOrder, builder: (column) => column); 3478 4584 3479 - GeneratedColumn<DateTime> get updatedAt => $composableBuilder(column: $table.updatedAt, builder: (column) => column); 4585 + GeneratedColumn<DateTime> get updatedAt => 4586 + $composableBuilder(column: $table.updatedAt, builder: (column) => column); 3480 4587 } 3481 4588 3482 4589 class $$SavedFeedsTableTableManager ··· 3490 4597 $$SavedFeedsTableAnnotationComposer, 3491 4598 $$SavedFeedsTableCreateCompanionBuilder, 3492 4599 $$SavedFeedsTableUpdateCompanionBuilder, 3493 - (SavedFeedEntry, BaseReferences<_$AppDatabase, $SavedFeedsTable, SavedFeedEntry>), 4600 + ( 4601 + SavedFeedEntry, 4602 + BaseReferences<_$AppDatabase, $SavedFeedsTable, SavedFeedEntry>, 4603 + ), 3494 4604 SavedFeedEntry, 3495 4605 PrefetchHooks Function() 3496 4606 > { ··· 3499 4609 TableManagerState( 3500 4610 db: db, 3501 4611 table: table, 3502 - createFilteringComposer: () => $$SavedFeedsTableFilterComposer($db: db, $table: table), 3503 - createOrderingComposer: () => $$SavedFeedsTableOrderingComposer($db: db, $table: table), 3504 - createComputedFieldComposer: () => $$SavedFeedsTableAnnotationComposer($db: db, $table: table), 4612 + createFilteringComposer: () => 4613 + $$SavedFeedsTableFilterComposer($db: db, $table: table), 4614 + createOrderingComposer: () => 4615 + $$SavedFeedsTableOrderingComposer($db: db, $table: table), 4616 + createComputedFieldComposer: () => 4617 + $$SavedFeedsTableAnnotationComposer($db: db, $table: table), 3505 4618 updateCompanionCallback: 3506 4619 ({ 3507 4620 Value<String> id = const Value.absent(), ··· 3542 4655 updatedAt: updatedAt, 3543 4656 rowid: rowid, 3544 4657 ), 3545 - withReferenceMapper: (p0) => p0.map((e) => (e.readTable(table), BaseReferences(db, table, e))).toList(), 4658 + withReferenceMapper: (p0) => p0 4659 + .map((e) => (e.readTable(table), BaseReferences(db, table, e))) 4660 + .toList(), 3546 4661 prefetchHooksCallback: null, 3547 4662 ), 3548 4663 ); ··· 3558 4673 $$SavedFeedsTableAnnotationComposer, 3559 4674 $$SavedFeedsTableCreateCompanionBuilder, 3560 4675 $$SavedFeedsTableUpdateCompanionBuilder, 3561 - (SavedFeedEntry, BaseReferences<_$AppDatabase, $SavedFeedsTable, SavedFeedEntry>), 4676 + ( 4677 + SavedFeedEntry, 4678 + BaseReferences<_$AppDatabase, $SavedFeedsTable, SavedFeedEntry>, 4679 + ), 3562 4680 SavedFeedEntry, 3563 4681 PrefetchHooks Function() 3564 4682 >; ··· 3579 4697 Value<String> accountDid, 3580 4698 }); 3581 4699 3582 - class $$SearchHistoryTableFilterComposer extends Composer<_$AppDatabase, $SearchHistoryTable> { 4700 + class $$SearchHistoryTableFilterComposer 4701 + extends Composer<_$AppDatabase, $SearchHistoryTable> { 3583 4702 $$SearchHistoryTableFilterComposer({ 3584 4703 required super.$db, 3585 4704 required super.$table, ··· 3587 4706 super.$addJoinBuilderToRootComposer, 3588 4707 super.$removeJoinBuilderFromRootComposer, 3589 4708 }); 3590 - ColumnFilters<int> get id => $composableBuilder(column: $table.id, builder: (column) => ColumnFilters(column)); 4709 + ColumnFilters<int> get id => $composableBuilder( 4710 + column: $table.id, 4711 + builder: (column) => ColumnFilters(column), 4712 + ); 3591 4713 3592 - ColumnFilters<String> get query => 3593 - $composableBuilder(column: $table.query, builder: (column) => ColumnFilters(column)); 4714 + ColumnFilters<String> get query => $composableBuilder( 4715 + column: $table.query, 4716 + builder: (column) => ColumnFilters(column), 4717 + ); 3594 4718 3595 - ColumnFilters<String> get type => $composableBuilder(column: $table.type, builder: (column) => ColumnFilters(column)); 4719 + ColumnFilters<String> get type => $composableBuilder( 4720 + column: $table.type, 4721 + builder: (column) => ColumnFilters(column), 4722 + ); 3596 4723 3597 - ColumnFilters<DateTime> get searchedAt => 3598 - $composableBuilder(column: $table.searchedAt, builder: (column) => ColumnFilters(column)); 4724 + ColumnFilters<DateTime> get searchedAt => $composableBuilder( 4725 + column: $table.searchedAt, 4726 + builder: (column) => ColumnFilters(column), 4727 + ); 3599 4728 3600 - ColumnFilters<String> get accountDid => 3601 - $composableBuilder(column: $table.accountDid, builder: (column) => ColumnFilters(column)); 4729 + ColumnFilters<String> get accountDid => $composableBuilder( 4730 + column: $table.accountDid, 4731 + builder: (column) => ColumnFilters(column), 4732 + ); 3602 4733 } 3603 4734 3604 - class $$SearchHistoryTableOrderingComposer extends Composer<_$AppDatabase, $SearchHistoryTable> { 4735 + class $$SearchHistoryTableOrderingComposer 4736 + extends Composer<_$AppDatabase, $SearchHistoryTable> { 3605 4737 $$SearchHistoryTableOrderingComposer({ 3606 4738 required super.$db, 3607 4739 required super.$table, ··· 3609 4741 super.$addJoinBuilderToRootComposer, 3610 4742 super.$removeJoinBuilderFromRootComposer, 3611 4743 }); 3612 - ColumnOrderings<int> get id => $composableBuilder(column: $table.id, builder: (column) => ColumnOrderings(column)); 4744 + ColumnOrderings<int> get id => $composableBuilder( 4745 + column: $table.id, 4746 + builder: (column) => ColumnOrderings(column), 4747 + ); 3613 4748 3614 - ColumnOrderings<String> get query => 3615 - $composableBuilder(column: $table.query, builder: (column) => ColumnOrderings(column)); 4749 + ColumnOrderings<String> get query => $composableBuilder( 4750 + column: $table.query, 4751 + builder: (column) => ColumnOrderings(column), 4752 + ); 3616 4753 3617 - ColumnOrderings<String> get type => 3618 - $composableBuilder(column: $table.type, builder: (column) => ColumnOrderings(column)); 4754 + ColumnOrderings<String> get type => $composableBuilder( 4755 + column: $table.type, 4756 + builder: (column) => ColumnOrderings(column), 4757 + ); 3619 4758 3620 - ColumnOrderings<DateTime> get searchedAt => 3621 - $composableBuilder(column: $table.searchedAt, builder: (column) => ColumnOrderings(column)); 4759 + ColumnOrderings<DateTime> get searchedAt => $composableBuilder( 4760 + column: $table.searchedAt, 4761 + builder: (column) => ColumnOrderings(column), 4762 + ); 3622 4763 3623 - ColumnOrderings<String> get accountDid => 3624 - $composableBuilder(column: $table.accountDid, builder: (column) => ColumnOrderings(column)); 4764 + ColumnOrderings<String> get accountDid => $composableBuilder( 4765 + column: $table.accountDid, 4766 + builder: (column) => ColumnOrderings(column), 4767 + ); 3625 4768 } 3626 4769 3627 - class $$SearchHistoryTableAnnotationComposer extends Composer<_$AppDatabase, $SearchHistoryTable> { 4770 + class $$SearchHistoryTableAnnotationComposer 4771 + extends Composer<_$AppDatabase, $SearchHistoryTable> { 3628 4772 $$SearchHistoryTableAnnotationComposer({ 3629 4773 required super.$db, 3630 4774 required super.$table, ··· 3632 4776 super.$addJoinBuilderToRootComposer, 3633 4777 super.$removeJoinBuilderFromRootComposer, 3634 4778 }); 3635 - GeneratedColumn<int> get id => $composableBuilder(column: $table.id, builder: (column) => column); 4779 + GeneratedColumn<int> get id => 4780 + $composableBuilder(column: $table.id, builder: (column) => column); 3636 4781 3637 - GeneratedColumn<String> get query => $composableBuilder(column: $table.query, builder: (column) => column); 4782 + GeneratedColumn<String> get query => 4783 + $composableBuilder(column: $table.query, builder: (column) => column); 3638 4784 3639 - GeneratedColumn<String> get type => $composableBuilder(column: $table.type, builder: (column) => column); 4785 + GeneratedColumn<String> get type => 4786 + $composableBuilder(column: $table.type, builder: (column) => column); 3640 4787 3641 - GeneratedColumn<DateTime> get searchedAt => 3642 - $composableBuilder(column: $table.searchedAt, builder: (column) => column); 4788 + GeneratedColumn<DateTime> get searchedAt => $composableBuilder( 4789 + column: $table.searchedAt, 4790 + builder: (column) => column, 4791 + ); 3643 4792 3644 - GeneratedColumn<String> get accountDid => $composableBuilder(column: $table.accountDid, builder: (column) => column); 4793 + GeneratedColumn<String> get accountDid => $composableBuilder( 4794 + column: $table.accountDid, 4795 + builder: (column) => column, 4796 + ); 3645 4797 } 3646 4798 3647 4799 class $$SearchHistoryTableTableManager ··· 3655 4807 $$SearchHistoryTableAnnotationComposer, 3656 4808 $$SearchHistoryTableCreateCompanionBuilder, 3657 4809 $$SearchHistoryTableUpdateCompanionBuilder, 3658 - (SearchHistoryEntry, BaseReferences<_$AppDatabase, $SearchHistoryTable, SearchHistoryEntry>), 4810 + ( 4811 + SearchHistoryEntry, 4812 + BaseReferences< 4813 + _$AppDatabase, 4814 + $SearchHistoryTable, 4815 + SearchHistoryEntry 4816 + >, 4817 + ), 3659 4818 SearchHistoryEntry, 3660 4819 PrefetchHooks Function() 3661 4820 > { ··· 3664 4823 TableManagerState( 3665 4824 db: db, 3666 4825 table: table, 3667 - createFilteringComposer: () => $$SearchHistoryTableFilterComposer($db: db, $table: table), 3668 - createOrderingComposer: () => $$SearchHistoryTableOrderingComposer($db: db, $table: table), 3669 - createComputedFieldComposer: () => $$SearchHistoryTableAnnotationComposer($db: db, $table: table), 4826 + createFilteringComposer: () => 4827 + $$SearchHistoryTableFilterComposer($db: db, $table: table), 4828 + createOrderingComposer: () => 4829 + $$SearchHistoryTableOrderingComposer($db: db, $table: table), 4830 + createComputedFieldComposer: () => 4831 + $$SearchHistoryTableAnnotationComposer($db: db, $table: table), 3670 4832 updateCompanionCallback: 3671 4833 ({ 3672 4834 Value<int> id = const Value.absent(), ··· 3695 4857 searchedAt: searchedAt, 3696 4858 accountDid: accountDid, 3697 4859 ), 3698 - withReferenceMapper: (p0) => p0.map((e) => (e.readTable(table), BaseReferences(db, table, e))).toList(), 4860 + withReferenceMapper: (p0) => p0 4861 + .map((e) => (e.readTable(table), BaseReferences(db, table, e))) 4862 + .toList(), 3699 4863 prefetchHooksCallback: null, 3700 4864 ), 3701 4865 ); ··· 3711 4875 $$SearchHistoryTableAnnotationComposer, 3712 4876 $$SearchHistoryTableCreateCompanionBuilder, 3713 4877 $$SearchHistoryTableUpdateCompanionBuilder, 3714 - (SearchHistoryEntry, BaseReferences<_$AppDatabase, $SearchHistoryTable, SearchHistoryEntry>), 4878 + ( 4879 + SearchHistoryEntry, 4880 + BaseReferences<_$AppDatabase, $SearchHistoryTable, SearchHistoryEntry>, 4881 + ), 3715 4882 SearchHistoryEntry, 3716 4883 PrefetchHooks Function() 3717 4884 >; ··· 3746 4913 Value<DateTime?> scheduledAt, 3747 4914 }); 3748 4915 3749 - class $$DraftsTableFilterComposer extends Composer<_$AppDatabase, $DraftsTable> { 4916 + class $$DraftsTableFilterComposer 4917 + extends Composer<_$AppDatabase, $DraftsTable> { 3750 4918 $$DraftsTableFilterComposer({ 3751 4919 required super.$db, 3752 4920 required super.$table, ··· 3754 4922 super.$addJoinBuilderToRootComposer, 3755 4923 super.$removeJoinBuilderFromRootComposer, 3756 4924 }); 3757 - ColumnFilters<int> get id => $composableBuilder(column: $table.id, builder: (column) => ColumnFilters(column)); 4925 + ColumnFilters<int> get id => $composableBuilder( 4926 + column: $table.id, 4927 + builder: (column) => ColumnFilters(column), 4928 + ); 3758 4929 3759 - ColumnFilters<String> get accountDid => 3760 - $composableBuilder(column: $table.accountDid, builder: (column) => ColumnFilters(column)); 4930 + ColumnFilters<String> get accountDid => $composableBuilder( 4931 + column: $table.accountDid, 4932 + builder: (column) => ColumnFilters(column), 4933 + ); 3761 4934 3762 - ColumnFilters<String> get content => 3763 - $composableBuilder(column: $table.content, builder: (column) => ColumnFilters(column)); 4935 + ColumnFilters<String> get content => $composableBuilder( 4936 + column: $table.content, 4937 + builder: (column) => ColumnFilters(column), 4938 + ); 3764 4939 3765 - ColumnFilters<String> get replyUri => 3766 - $composableBuilder(column: $table.replyUri, builder: (column) => ColumnFilters(column)); 4940 + ColumnFilters<String> get replyUri => $composableBuilder( 4941 + column: $table.replyUri, 4942 + builder: (column) => ColumnFilters(column), 4943 + ); 3767 4944 3768 - ColumnFilters<String> get replyCid => 3769 - $composableBuilder(column: $table.replyCid, builder: (column) => ColumnFilters(column)); 4945 + ColumnFilters<String> get replyCid => $composableBuilder( 4946 + column: $table.replyCid, 4947 + builder: (column) => ColumnFilters(column), 4948 + ); 3770 4949 3771 - ColumnFilters<String> get rootUri => 3772 - $composableBuilder(column: $table.rootUri, builder: (column) => ColumnFilters(column)); 4950 + ColumnFilters<String> get rootUri => $composableBuilder( 4951 + column: $table.rootUri, 4952 + builder: (column) => ColumnFilters(column), 4953 + ); 3773 4954 3774 - ColumnFilters<String> get rootCid => 3775 - $composableBuilder(column: $table.rootCid, builder: (column) => ColumnFilters(column)); 4955 + ColumnFilters<String> get rootCid => $composableBuilder( 4956 + column: $table.rootCid, 4957 + builder: (column) => ColumnFilters(column), 4958 + ); 3776 4959 3777 - ColumnFilters<String> get embedJson => 3778 - $composableBuilder(column: $table.embedJson, builder: (column) => ColumnFilters(column)); 4960 + ColumnFilters<String> get embedJson => $composableBuilder( 4961 + column: $table.embedJson, 4962 + builder: (column) => ColumnFilters(column), 4963 + ); 3779 4964 3780 - ColumnFilters<String> get mediaPaths => 3781 - $composableBuilder(column: $table.mediaPaths, builder: (column) => ColumnFilters(column)); 4965 + ColumnFilters<String> get mediaPaths => $composableBuilder( 4966 + column: $table.mediaPaths, 4967 + builder: (column) => ColumnFilters(column), 4968 + ); 3782 4969 3783 - ColumnFilters<DateTime> get createdAt => 3784 - $composableBuilder(column: $table.createdAt, builder: (column) => ColumnFilters(column)); 4970 + ColumnFilters<DateTime> get createdAt => $composableBuilder( 4971 + column: $table.createdAt, 4972 + builder: (column) => ColumnFilters(column), 4973 + ); 3785 4974 3786 - ColumnFilters<DateTime> get updatedAt => 3787 - $composableBuilder(column: $table.updatedAt, builder: (column) => ColumnFilters(column)); 4975 + ColumnFilters<DateTime> get updatedAt => $composableBuilder( 4976 + column: $table.updatedAt, 4977 + builder: (column) => ColumnFilters(column), 4978 + ); 3788 4979 3789 - ColumnFilters<DateTime> get scheduledAt => 3790 - $composableBuilder(column: $table.scheduledAt, builder: (column) => ColumnFilters(column)); 4980 + ColumnFilters<DateTime> get scheduledAt => $composableBuilder( 4981 + column: $table.scheduledAt, 4982 + builder: (column) => ColumnFilters(column), 4983 + ); 3791 4984 } 3792 4985 3793 - class $$DraftsTableOrderingComposer extends Composer<_$AppDatabase, $DraftsTable> { 4986 + class $$DraftsTableOrderingComposer 4987 + extends Composer<_$AppDatabase, $DraftsTable> { 3794 4988 $$DraftsTableOrderingComposer({ 3795 4989 required super.$db, 3796 4990 required super.$table, ··· 3798 4992 super.$addJoinBuilderToRootComposer, 3799 4993 super.$removeJoinBuilderFromRootComposer, 3800 4994 }); 3801 - ColumnOrderings<int> get id => $composableBuilder(column: $table.id, builder: (column) => ColumnOrderings(column)); 4995 + ColumnOrderings<int> get id => $composableBuilder( 4996 + column: $table.id, 4997 + builder: (column) => ColumnOrderings(column), 4998 + ); 3802 4999 3803 - ColumnOrderings<String> get accountDid => 3804 - $composableBuilder(column: $table.accountDid, builder: (column) => ColumnOrderings(column)); 5000 + ColumnOrderings<String> get accountDid => $composableBuilder( 5001 + column: $table.accountDid, 5002 + builder: (column) => ColumnOrderings(column), 5003 + ); 3805 5004 3806 - ColumnOrderings<String> get content => 3807 - $composableBuilder(column: $table.content, builder: (column) => ColumnOrderings(column)); 5005 + ColumnOrderings<String> get content => $composableBuilder( 5006 + column: $table.content, 5007 + builder: (column) => ColumnOrderings(column), 5008 + ); 3808 5009 3809 - ColumnOrderings<String> get replyUri => 3810 - $composableBuilder(column: $table.replyUri, builder: (column) => ColumnOrderings(column)); 5010 + ColumnOrderings<String> get replyUri => $composableBuilder( 5011 + column: $table.replyUri, 5012 + builder: (column) => ColumnOrderings(column), 5013 + ); 3811 5014 3812 - ColumnOrderings<String> get replyCid => 3813 - $composableBuilder(column: $table.replyCid, builder: (column) => ColumnOrderings(column)); 5015 + ColumnOrderings<String> get replyCid => $composableBuilder( 5016 + column: $table.replyCid, 5017 + builder: (column) => ColumnOrderings(column), 5018 + ); 3814 5019 3815 - ColumnOrderings<String> get rootUri => 3816 - $composableBuilder(column: $table.rootUri, builder: (column) => ColumnOrderings(column)); 5020 + ColumnOrderings<String> get rootUri => $composableBuilder( 5021 + column: $table.rootUri, 5022 + builder: (column) => ColumnOrderings(column), 5023 + ); 3817 5024 3818 - ColumnOrderings<String> get rootCid => 3819 - $composableBuilder(column: $table.rootCid, builder: (column) => ColumnOrderings(column)); 5025 + ColumnOrderings<String> get rootCid => $composableBuilder( 5026 + column: $table.rootCid, 5027 + builder: (column) => ColumnOrderings(column), 5028 + ); 3820 5029 3821 - ColumnOrderings<String> get embedJson => 3822 - $composableBuilder(column: $table.embedJson, builder: (column) => ColumnOrderings(column)); 5030 + ColumnOrderings<String> get embedJson => $composableBuilder( 5031 + column: $table.embedJson, 5032 + builder: (column) => ColumnOrderings(column), 5033 + ); 3823 5034 3824 - ColumnOrderings<String> get mediaPaths => 3825 - $composableBuilder(column: $table.mediaPaths, builder: (column) => ColumnOrderings(column)); 5035 + ColumnOrderings<String> get mediaPaths => $composableBuilder( 5036 + column: $table.mediaPaths, 5037 + builder: (column) => ColumnOrderings(column), 5038 + ); 3826 5039 3827 - ColumnOrderings<DateTime> get createdAt => 3828 - $composableBuilder(column: $table.createdAt, builder: (column) => ColumnOrderings(column)); 5040 + ColumnOrderings<DateTime> get createdAt => $composableBuilder( 5041 + column: $table.createdAt, 5042 + builder: (column) => ColumnOrderings(column), 5043 + ); 3829 5044 3830 - ColumnOrderings<DateTime> get updatedAt => 3831 - $composableBuilder(column: $table.updatedAt, builder: (column) => ColumnOrderings(column)); 5045 + ColumnOrderings<DateTime> get updatedAt => $composableBuilder( 5046 + column: $table.updatedAt, 5047 + builder: (column) => ColumnOrderings(column), 5048 + ); 3832 5049 3833 - ColumnOrderings<DateTime> get scheduledAt => 3834 - $composableBuilder(column: $table.scheduledAt, builder: (column) => ColumnOrderings(column)); 5050 + ColumnOrderings<DateTime> get scheduledAt => $composableBuilder( 5051 + column: $table.scheduledAt, 5052 + builder: (column) => ColumnOrderings(column), 5053 + ); 3835 5054 } 3836 5055 3837 - class $$DraftsTableAnnotationComposer extends Composer<_$AppDatabase, $DraftsTable> { 5056 + class $$DraftsTableAnnotationComposer 5057 + extends Composer<_$AppDatabase, $DraftsTable> { 3838 5058 $$DraftsTableAnnotationComposer({ 3839 5059 required super.$db, 3840 5060 required super.$table, ··· 3842 5062 super.$addJoinBuilderToRootComposer, 3843 5063 super.$removeJoinBuilderFromRootComposer, 3844 5064 }); 3845 - GeneratedColumn<int> get id => $composableBuilder(column: $table.id, builder: (column) => column); 5065 + GeneratedColumn<int> get id => 5066 + $composableBuilder(column: $table.id, builder: (column) => column); 3846 5067 3847 - GeneratedColumn<String> get accountDid => $composableBuilder(column: $table.accountDid, builder: (column) => column); 5068 + GeneratedColumn<String> get accountDid => $composableBuilder( 5069 + column: $table.accountDid, 5070 + builder: (column) => column, 5071 + ); 3848 5072 3849 - GeneratedColumn<String> get content => $composableBuilder(column: $table.content, builder: (column) => column); 5073 + GeneratedColumn<String> get content => 5074 + $composableBuilder(column: $table.content, builder: (column) => column); 3850 5075 3851 - GeneratedColumn<String> get replyUri => $composableBuilder(column: $table.replyUri, builder: (column) => column); 5076 + GeneratedColumn<String> get replyUri => 5077 + $composableBuilder(column: $table.replyUri, builder: (column) => column); 3852 5078 3853 - GeneratedColumn<String> get replyCid => $composableBuilder(column: $table.replyCid, builder: (column) => column); 5079 + GeneratedColumn<String> get replyCid => 5080 + $composableBuilder(column: $table.replyCid, builder: (column) => column); 3854 5081 3855 - GeneratedColumn<String> get rootUri => $composableBuilder(column: $table.rootUri, builder: (column) => column); 5082 + GeneratedColumn<String> get rootUri => 5083 + $composableBuilder(column: $table.rootUri, builder: (column) => column); 3856 5084 3857 - GeneratedColumn<String> get rootCid => $composableBuilder(column: $table.rootCid, builder: (column) => column); 5085 + GeneratedColumn<String> get rootCid => 5086 + $composableBuilder(column: $table.rootCid, builder: (column) => column); 3858 5087 3859 - GeneratedColumn<String> get embedJson => $composableBuilder(column: $table.embedJson, builder: (column) => column); 5088 + GeneratedColumn<String> get embedJson => 5089 + $composableBuilder(column: $table.embedJson, builder: (column) => column); 3860 5090 3861 - GeneratedColumn<String> get mediaPaths => $composableBuilder(column: $table.mediaPaths, builder: (column) => column); 5091 + GeneratedColumn<String> get mediaPaths => $composableBuilder( 5092 + column: $table.mediaPaths, 5093 + builder: (column) => column, 5094 + ); 3862 5095 3863 - GeneratedColumn<DateTime> get createdAt => $composableBuilder(column: $table.createdAt, builder: (column) => column); 5096 + GeneratedColumn<DateTime> get createdAt => 5097 + $composableBuilder(column: $table.createdAt, builder: (column) => column); 3864 5098 3865 - GeneratedColumn<DateTime> get updatedAt => $composableBuilder(column: $table.updatedAt, builder: (column) => column); 5099 + GeneratedColumn<DateTime> get updatedAt => 5100 + $composableBuilder(column: $table.updatedAt, builder: (column) => column); 3866 5101 3867 - GeneratedColumn<DateTime> get scheduledAt => 3868 - $composableBuilder(column: $table.scheduledAt, builder: (column) => column); 5102 + GeneratedColumn<DateTime> get scheduledAt => $composableBuilder( 5103 + column: $table.scheduledAt, 5104 + builder: (column) => column, 5105 + ); 3869 5106 } 3870 5107 3871 5108 class $$DraftsTableTableManager ··· 3888 5125 TableManagerState( 3889 5126 db: db, 3890 5127 table: table, 3891 - createFilteringComposer: () => $$DraftsTableFilterComposer($db: db, $table: table), 3892 - createOrderingComposer: () => $$DraftsTableOrderingComposer($db: db, $table: table), 3893 - createComputedFieldComposer: () => $$DraftsTableAnnotationComposer($db: db, $table: table), 5128 + createFilteringComposer: () => 5129 + $$DraftsTableFilterComposer($db: db, $table: table), 5130 + createOrderingComposer: () => 5131 + $$DraftsTableOrderingComposer($db: db, $table: table), 5132 + createComputedFieldComposer: () => 5133 + $$DraftsTableAnnotationComposer($db: db, $table: table), 3894 5134 updateCompanionCallback: 3895 5135 ({ 3896 5136 Value<int> id = const Value.absent(), ··· 3947 5187 updatedAt: updatedAt, 3948 5188 scheduledAt: scheduledAt, 3949 5189 ), 3950 - withReferenceMapper: (p0) => p0.map((e) => (e.readTable(table), BaseReferences(db, table, e))).toList(), 5190 + withReferenceMapper: (p0) => p0 5191 + .map((e) => (e.readTable(table), BaseReferences(db, table, e))) 5192 + .toList(), 3951 5193 prefetchHooksCallback: null, 3952 5194 ), 3953 5195 ); ··· 3967 5209 DraftEntry, 3968 5210 PrefetchHooks Function() 3969 5211 >; 5212 + typedef $$SavedPostsTableCreateCompanionBuilder = 5213 + SavedPostsCompanion Function({ 5214 + Value<int> id, 5215 + required String accountDid, 5216 + required String postUri, 5217 + required String postJson, 5218 + Value<DateTime> savedAt, 5219 + }); 5220 + typedef $$SavedPostsTableUpdateCompanionBuilder = 5221 + SavedPostsCompanion Function({ 5222 + Value<int> id, 5223 + Value<String> accountDid, 5224 + Value<String> postUri, 5225 + Value<String> postJson, 5226 + Value<DateTime> savedAt, 5227 + }); 5228 + 5229 + class $$SavedPostsTableFilterComposer 5230 + extends Composer<_$AppDatabase, $SavedPostsTable> { 5231 + $$SavedPostsTableFilterComposer({ 5232 + required super.$db, 5233 + required super.$table, 5234 + super.joinBuilder, 5235 + super.$addJoinBuilderToRootComposer, 5236 + super.$removeJoinBuilderFromRootComposer, 5237 + }); 5238 + ColumnFilters<int> get id => $composableBuilder( 5239 + column: $table.id, 5240 + builder: (column) => ColumnFilters(column), 5241 + ); 5242 + 5243 + ColumnFilters<String> get accountDid => $composableBuilder( 5244 + column: $table.accountDid, 5245 + builder: (column) => ColumnFilters(column), 5246 + ); 5247 + 5248 + ColumnFilters<String> get postUri => $composableBuilder( 5249 + column: $table.postUri, 5250 + builder: (column) => ColumnFilters(column), 5251 + ); 5252 + 5253 + ColumnFilters<String> get postJson => $composableBuilder( 5254 + column: $table.postJson, 5255 + builder: (column) => ColumnFilters(column), 5256 + ); 5257 + 5258 + ColumnFilters<DateTime> get savedAt => $composableBuilder( 5259 + column: $table.savedAt, 5260 + builder: (column) => ColumnFilters(column), 5261 + ); 5262 + } 5263 + 5264 + class $$SavedPostsTableOrderingComposer 5265 + extends Composer<_$AppDatabase, $SavedPostsTable> { 5266 + $$SavedPostsTableOrderingComposer({ 5267 + required super.$db, 5268 + required super.$table, 5269 + super.joinBuilder, 5270 + super.$addJoinBuilderToRootComposer, 5271 + super.$removeJoinBuilderFromRootComposer, 5272 + }); 5273 + ColumnOrderings<int> get id => $composableBuilder( 5274 + column: $table.id, 5275 + builder: (column) => ColumnOrderings(column), 5276 + ); 5277 + 5278 + ColumnOrderings<String> get accountDid => $composableBuilder( 5279 + column: $table.accountDid, 5280 + builder: (column) => ColumnOrderings(column), 5281 + ); 5282 + 5283 + ColumnOrderings<String> get postUri => $composableBuilder( 5284 + column: $table.postUri, 5285 + builder: (column) => ColumnOrderings(column), 5286 + ); 5287 + 5288 + ColumnOrderings<String> get postJson => $composableBuilder( 5289 + column: $table.postJson, 5290 + builder: (column) => ColumnOrderings(column), 5291 + ); 5292 + 5293 + ColumnOrderings<DateTime> get savedAt => $composableBuilder( 5294 + column: $table.savedAt, 5295 + builder: (column) => ColumnOrderings(column), 5296 + ); 5297 + } 5298 + 5299 + class $$SavedPostsTableAnnotationComposer 5300 + extends Composer<_$AppDatabase, $SavedPostsTable> { 5301 + $$SavedPostsTableAnnotationComposer({ 5302 + required super.$db, 5303 + required super.$table, 5304 + super.joinBuilder, 5305 + super.$addJoinBuilderToRootComposer, 5306 + super.$removeJoinBuilderFromRootComposer, 5307 + }); 5308 + GeneratedColumn<int> get id => 5309 + $composableBuilder(column: $table.id, builder: (column) => column); 5310 + 5311 + GeneratedColumn<String> get accountDid => $composableBuilder( 5312 + column: $table.accountDid, 5313 + builder: (column) => column, 5314 + ); 5315 + 5316 + GeneratedColumn<String> get postUri => 5317 + $composableBuilder(column: $table.postUri, builder: (column) => column); 5318 + 5319 + GeneratedColumn<String> get postJson => 5320 + $composableBuilder(column: $table.postJson, builder: (column) => column); 5321 + 5322 + GeneratedColumn<DateTime> get savedAt => 5323 + $composableBuilder(column: $table.savedAt, builder: (column) => column); 5324 + } 5325 + 5326 + class $$SavedPostsTableTableManager 5327 + extends 5328 + RootTableManager< 5329 + _$AppDatabase, 5330 + $SavedPostsTable, 5331 + SavedPostEntry, 5332 + $$SavedPostsTableFilterComposer, 5333 + $$SavedPostsTableOrderingComposer, 5334 + $$SavedPostsTableAnnotationComposer, 5335 + $$SavedPostsTableCreateCompanionBuilder, 5336 + $$SavedPostsTableUpdateCompanionBuilder, 5337 + ( 5338 + SavedPostEntry, 5339 + BaseReferences<_$AppDatabase, $SavedPostsTable, SavedPostEntry>, 5340 + ), 5341 + SavedPostEntry, 5342 + PrefetchHooks Function() 5343 + > { 5344 + $$SavedPostsTableTableManager(_$AppDatabase db, $SavedPostsTable table) 5345 + : super( 5346 + TableManagerState( 5347 + db: db, 5348 + table: table, 5349 + createFilteringComposer: () => 5350 + $$SavedPostsTableFilterComposer($db: db, $table: table), 5351 + createOrderingComposer: () => 5352 + $$SavedPostsTableOrderingComposer($db: db, $table: table), 5353 + createComputedFieldComposer: () => 5354 + $$SavedPostsTableAnnotationComposer($db: db, $table: table), 5355 + updateCompanionCallback: 5356 + ({ 5357 + Value<int> id = const Value.absent(), 5358 + Value<String> accountDid = const Value.absent(), 5359 + Value<String> postUri = const Value.absent(), 5360 + Value<String> postJson = const Value.absent(), 5361 + Value<DateTime> savedAt = const Value.absent(), 5362 + }) => SavedPostsCompanion( 5363 + id: id, 5364 + accountDid: accountDid, 5365 + postUri: postUri, 5366 + postJson: postJson, 5367 + savedAt: savedAt, 5368 + ), 5369 + createCompanionCallback: 5370 + ({ 5371 + Value<int> id = const Value.absent(), 5372 + required String accountDid, 5373 + required String postUri, 5374 + required String postJson, 5375 + Value<DateTime> savedAt = const Value.absent(), 5376 + }) => SavedPostsCompanion.insert( 5377 + id: id, 5378 + accountDid: accountDid, 5379 + postUri: postUri, 5380 + postJson: postJson, 5381 + savedAt: savedAt, 5382 + ), 5383 + withReferenceMapper: (p0) => p0 5384 + .map((e) => (e.readTable(table), BaseReferences(db, table, e))) 5385 + .toList(), 5386 + prefetchHooksCallback: null, 5387 + ), 5388 + ); 5389 + } 5390 + 5391 + typedef $$SavedPostsTableProcessedTableManager = 5392 + ProcessedTableManager< 5393 + _$AppDatabase, 5394 + $SavedPostsTable, 5395 + SavedPostEntry, 5396 + $$SavedPostsTableFilterComposer, 5397 + $$SavedPostsTableOrderingComposer, 5398 + $$SavedPostsTableAnnotationComposer, 5399 + $$SavedPostsTableCreateCompanionBuilder, 5400 + $$SavedPostsTableUpdateCompanionBuilder, 5401 + ( 5402 + SavedPostEntry, 5403 + BaseReferences<_$AppDatabase, $SavedPostsTable, SavedPostEntry>, 5404 + ), 5405 + SavedPostEntry, 5406 + PrefetchHooks Function() 5407 + >; 3970 5408 3971 5409 class $AppDatabaseManager { 3972 5410 final _$AppDatabase _db; 3973 5411 $AppDatabaseManager(this._db); 3974 - $$AccountsTableTableManager get accounts => $$AccountsTableTableManager(_db, _db.accounts); 3975 - $$CachedProfilesTableTableManager get cachedProfiles => $$CachedProfilesTableTableManager(_db, _db.cachedProfiles); 3976 - $$CachedPostsTableTableManager get cachedPosts => $$CachedPostsTableTableManager(_db, _db.cachedPosts); 3977 - $$SettingsTableTableManager get settings => $$SettingsTableTableManager(_db, _db.settings); 3978 - $$SavedFeedsTableTableManager get savedFeeds => $$SavedFeedsTableTableManager(_db, _db.savedFeeds); 3979 - $$SearchHistoryTableTableManager get searchHistory => $$SearchHistoryTableTableManager(_db, _db.searchHistory); 3980 - $$DraftsTableTableManager get drafts => $$DraftsTableTableManager(_db, _db.drafts); 5412 + $$AccountsTableTableManager get accounts => 5413 + $$AccountsTableTableManager(_db, _db.accounts); 5414 + $$CachedProfilesTableTableManager get cachedProfiles => 5415 + $$CachedProfilesTableTableManager(_db, _db.cachedProfiles); 5416 + $$CachedPostsTableTableManager get cachedPosts => 5417 + $$CachedPostsTableTableManager(_db, _db.cachedPosts); 5418 + $$SettingsTableTableManager get settings => 5419 + $$SettingsTableTableManager(_db, _db.settings); 5420 + $$SavedFeedsTableTableManager get savedFeeds => 5421 + $$SavedFeedsTableTableManager(_db, _db.savedFeeds); 5422 + $$SearchHistoryTableTableManager get searchHistory => 5423 + $$SearchHistoryTableTableManager(_db, _db.searchHistory); 5424 + $$DraftsTableTableManager get drafts => 5425 + $$DraftsTableTableManager(_db, _db.drafts); 5426 + $$SavedPostsTableTableManager get savedPosts => 5427 + $$SavedPostsTableTableManager(_db, _db.savedPosts); 3981 5428 }
+12
lib/core/database/tables.dart
··· 90 90 DateTimeColumn get updatedAt => dateTime().withDefault(currentDateAndTime)(); 91 91 DateTimeColumn get scheduledAt => dateTime().nullable()(); 92 92 } 93 + 94 + @DataClassName('SavedPostEntry') 95 + class SavedPosts extends Table { 96 + IntColumn get id => integer().autoIncrement()(); 97 + TextColumn get accountDid => text()(); 98 + TextColumn get postUri => text()(); 99 + TextColumn get postJson => text()(); 100 + DateTimeColumn get savedAt => dateTime().withDefault(currentDateAndTime)(); 101 + 102 + @override 103 + List<String> get customConstraints => ['UNIQUE (account_did, post_uri)']; 104 + }
+198
lib/features/feed/cubit/post_action_cubit.dart
··· 1 + import 'package:atproto_core/atproto_core.dart'; 2 + import 'package:equatable/equatable.dart'; 3 + import 'package:flutter_bloc/flutter_bloc.dart'; 4 + import 'package:lazurite/core/logging/app_logger.dart'; 5 + import 'package:lazurite/features/feed/data/post_action_repository.dart'; 6 + 7 + class PostActionState extends Equatable { 8 + const PostActionState({ 9 + required this.postUri, 10 + this.isLiked = false, 11 + this.isReposted = false, 12 + this.likeCount = 0, 13 + this.repostCount = 0, 14 + this.likeUri, 15 + this.repostUri, 16 + this.isLoadingLike = false, 17 + this.isLoadingRepost = false, 18 + this.error, 19 + }); 20 + 21 + final String postUri; 22 + final bool isLiked; 23 + final bool isReposted; 24 + final int likeCount; 25 + final int repostCount; 26 + final String? likeUri; 27 + final String? repostUri; 28 + final bool isLoadingLike; 29 + final bool isLoadingRepost; 30 + final String? error; 31 + 32 + PostActionState copyWith({ 33 + bool? isLiked, 34 + bool? isReposted, 35 + int? likeCount, 36 + int? repostCount, 37 + String? likeUri, 38 + String? repostUri, 39 + bool? isLoadingLike, 40 + bool? isLoadingRepost, 41 + String? error, 42 + }) { 43 + return PostActionState( 44 + postUri: postUri, 45 + isLiked: isLiked ?? this.isLiked, 46 + isReposted: isReposted ?? this.isReposted, 47 + likeCount: likeCount ?? this.likeCount, 48 + repostCount: repostCount ?? this.repostCount, 49 + likeUri: likeUri ?? this.likeUri, 50 + repostUri: repostUri ?? this.repostUri, 51 + isLoadingLike: isLoadingLike ?? this.isLoadingLike, 52 + isLoadingRepost: isLoadingRepost ?? this.isLoadingRepost, 53 + error: error ?? this.error, 54 + ); 55 + } 56 + 57 + @override 58 + List<Object?> get props => [ 59 + postUri, 60 + isLiked, 61 + isReposted, 62 + likeCount, 63 + repostCount, 64 + likeUri, 65 + repostUri, 66 + isLoadingLike, 67 + isLoadingRepost, 68 + error, 69 + ]; 70 + } 71 + 72 + class PostActionCubit extends Cubit<PostActionState> { 73 + PostActionCubit({ 74 + required PostActionRepository postActionRepository, 75 + required String postUri, 76 + required String postCid, 77 + bool isLiked = false, 78 + bool isReposted = false, 79 + int likeCount = 0, 80 + int repostCount = 0, 81 + String? likeUri, 82 + String? repostUri, 83 + }) : _postActionRepository = postActionRepository, 84 + _postCid = postCid, 85 + super( 86 + PostActionState( 87 + postUri: postUri, 88 + isLiked: isLiked, 89 + isReposted: isReposted, 90 + likeCount: likeCount, 91 + repostCount: repostCount, 92 + likeUri: likeUri, 93 + repostUri: repostUri, 94 + ), 95 + ); 96 + 97 + final PostActionRepository _postActionRepository; 98 + final String _postCid; 99 + 100 + Future<void> toggleLike() async { 101 + if (state.isLoadingLike) return; 102 + 103 + final wasLiked = state.isLiked; 104 + final previousLikeCount = state.likeCount; 105 + final previousLikeUri = state.likeUri; 106 + 107 + emit( 108 + state.copyWith( 109 + isLiked: !wasLiked, 110 + likeCount: wasLiked ? previousLikeCount - 1 : previousLikeCount + 1, 111 + isLoadingLike: true, 112 + error: null, 113 + ), 114 + ); 115 + 116 + try { 117 + if (wasLiked) { 118 + if (previousLikeUri != null) { 119 + await _postActionRepository.unlikePost(likeUri: previousLikeUri); 120 + emit(state.copyWith(likeUri: null, isLoadingLike: false)); 121 + } else { 122 + emit(state.copyWith(isLoadingLike: false)); 123 + } 124 + } else { 125 + final newLikeUri = await _postActionRepository.likePost(uri: AtUri.parse(state.postUri), cid: _postCid); 126 + emit(state.copyWith(likeUri: newLikeUri, isLoadingLike: false)); 127 + } 128 + } catch (error) { 129 + log.e('Failed to toggle like', error: error); 130 + 131 + emit( 132 + state.copyWith( 133 + isLiked: wasLiked, 134 + likeCount: previousLikeCount, 135 + likeUri: previousLikeUri, 136 + isLoadingLike: false, 137 + error: 'Failed to ${wasLiked ? 'unlike' : 'like'} post', 138 + ), 139 + ); 140 + } 141 + } 142 + 143 + Future<void> toggleRepost() async { 144 + if (state.isLoadingRepost) return; 145 + 146 + final wasReposted = state.isReposted; 147 + final previousRepostCount = state.repostCount; 148 + final previousRepostUri = state.repostUri; 149 + 150 + emit( 151 + state.copyWith( 152 + isReposted: !wasReposted, 153 + repostCount: wasReposted ? previousRepostCount - 1 : previousRepostCount + 1, 154 + isLoadingRepost: true, 155 + error: null, 156 + ), 157 + ); 158 + 159 + try { 160 + if (wasReposted) { 161 + if (previousRepostUri != null) { 162 + await _postActionRepository.unrepostPost(repostUri: previousRepostUri); 163 + emit(state.copyWith(repostUri: null, isLoadingRepost: false)); 164 + } else { 165 + emit(state.copyWith(isLoadingRepost: false)); 166 + } 167 + } else { 168 + final newRepostUri = await _postActionRepository.repostPost(uri: AtUri.parse(state.postUri), cid: _postCid); 169 + emit(state.copyWith(repostUri: newRepostUri, isLoadingRepost: false)); 170 + } 171 + } catch (error) { 172 + log.e('Failed to toggle repost', error: error); 173 + 174 + emit( 175 + state.copyWith( 176 + isReposted: wasReposted, 177 + repostCount: previousRepostCount, 178 + repostUri: previousRepostUri, 179 + isLoadingRepost: false, 180 + error: 'Failed to ${wasReposted ? 'unrepost' : 'repost'} post', 181 + ), 182 + ); 183 + } 184 + } 185 + 186 + Future<void> deletePost() async { 187 + try { 188 + await _postActionRepository.deletePost(postUri: state.postUri); 189 + } catch (error) { 190 + log.e('Failed to delete post', error: error); 191 + emit(state.copyWith(error: 'Failed to delete post')); 192 + } 193 + } 194 + 195 + void clearError() { 196 + emit(state.copyWith(error: null)); 197 + } 198 + }
+152
lib/features/feed/cubit/saved_posts_cubit.dart
··· 1 + import 'dart:async'; 2 + 3 + import 'package:drift/drift.dart'; 4 + import 'package:equatable/equatable.dart'; 5 + import 'package:flutter_bloc/flutter_bloc.dart'; 6 + import 'package:lazurite/core/database/app_database.dart'; 7 + import 'package:lazurite/core/logging/app_logger.dart'; 8 + 9 + class SavedPostsState extends Equatable { 10 + const SavedPostsState({ 11 + this.status = SavedPostsStatus.initial, 12 + this.savedPosts = const [], 13 + this.savedUris = const {}, 14 + this.error, 15 + }); 16 + 17 + final SavedPostsStatus status; 18 + final List<SavedPostEntry> savedPosts; 19 + final Set<String> savedUris; 20 + final String? error; 21 + 22 + bool isSaved(String postUri) => savedUris.contains(postUri); 23 + 24 + SavedPostsState copyWith({ 25 + SavedPostsStatus? status, 26 + List<SavedPostEntry>? savedPosts, 27 + Set<String>? savedUris, 28 + String? error, 29 + }) { 30 + return SavedPostsState( 31 + status: status ?? this.status, 32 + savedPosts: savedPosts ?? this.savedPosts, 33 + savedUris: savedUris ?? this.savedUris, 34 + error: error ?? this.error, 35 + ); 36 + } 37 + 38 + @override 39 + List<Object?> get props => [status, savedPosts, savedUris, error]; 40 + } 41 + 42 + enum SavedPostsStatus { initial, loading, loaded, error } 43 + 44 + class SavedPostsCubit extends Cubit<SavedPostsState> { 45 + SavedPostsCubit({required AppDatabase database, required String accountDid}) 46 + : _database = database, 47 + _accountDid = accountDid, 48 + super(const SavedPostsState()) { 49 + _init(); 50 + } 51 + 52 + final AppDatabase _database; 53 + final String _accountDid; 54 + StreamSubscription<Set<String>>? _savedUrisSubscription; 55 + 56 + void _init() { 57 + _savedUrisSubscription = _database 58 + .watchSavedPostUris(_accountDid) 59 + .listen( 60 + (uris) { 61 + emit(state.copyWith(savedUris: uris)); 62 + }, 63 + onError: (error) { 64 + log.e('Error watching saved post URIs', error: error); 65 + }, 66 + ); 67 + } 68 + 69 + Future<void> loadSavedPosts() async { 70 + emit(state.copyWith(status: SavedPostsStatus.loading, error: null)); 71 + 72 + try { 73 + final posts = await _database.getSavedPosts(_accountDid); 74 + final uris = posts.map((p) => p.postUri).toSet(); 75 + 76 + emit(state.copyWith(status: SavedPostsStatus.loaded, savedPosts: posts, savedUris: uris)); 77 + } catch (error) { 78 + log.e('Failed to load saved posts', error: error); 79 + emit(state.copyWith(status: SavedPostsStatus.error, error: 'Failed to load saved posts')); 80 + } 81 + } 82 + 83 + Future<bool> toggleSave({required String postUri, required String postJson}) async { 84 + final isCurrentlySaved = state.isSaved(postUri); 85 + 86 + try { 87 + if (isCurrentlySaved) { 88 + await _database.unsavePost(_accountDid, postUri); 89 + } else { 90 + await _database.savePost( 91 + SavedPostsCompanion( 92 + accountDid: Value(_accountDid), 93 + postUri: Value(postUri), 94 + postJson: Value(postJson), 95 + savedAt: Value(DateTime.now()), 96 + ), 97 + ); 98 + } 99 + 100 + await loadSavedPosts(); 101 + return true; 102 + } catch (error) { 103 + log.e('Failed to toggle save', error: error); 104 + emit(state.copyWith(error: 'Failed to ${isCurrentlySaved ? 'unsave' : 'save'} post')); 105 + return false; 106 + } 107 + } 108 + 109 + Future<bool> savePost({required String postUri, required String postJson}) async { 110 + if (state.isSaved(postUri)) return true; 111 + return toggleSave(postUri: postUri, postJson: postJson); 112 + } 113 + 114 + Future<bool> unsavePost(String postUri) async { 115 + if (!state.isSaved(postUri)) return true; 116 + return toggleSave(postUri: postUri, postJson: ''); 117 + } 118 + 119 + Future<void> unsavePostById(int id) async { 120 + try { 121 + await _database.unsavePostById(id); 122 + await loadSavedPosts(); 123 + } catch (error) { 124 + log.e('Failed to unsave post', error: error); 125 + emit(state.copyWith(error: 'Failed to remove saved post')); 126 + } 127 + } 128 + 129 + Future<void> clearAllSaved() async { 130 + try { 131 + await _database.deleteAllSavedPosts(_accountDid); 132 + await loadSavedPosts(); 133 + } catch (error) { 134 + log.e('Failed to clear saved posts', error: error); 135 + emit(state.copyWith(error: 'Failed to clear saved posts')); 136 + } 137 + } 138 + 139 + Stream<bool> watchIsSaved(String postUri) { 140 + return _database.watchIsPostSaved(_accountDid, postUri); 141 + } 142 + 143 + void clearError() { 144 + emit(state.copyWith(error: null)); 145 + } 146 + 147 + @override 148 + Future<void> close() { 149 + _savedUrisSubscription?.cancel(); 150 + return super.close(); 151 + } 152 + }
+47
lib/features/feed/data/post_action_repository.dart
··· 1 + import 'package:atproto/com_atproto_repo_strongref.dart'; 2 + import 'package:atproto_core/atproto_core.dart'; 3 + import 'package:bluesky/bluesky.dart'; 4 + 5 + class PostActionRepository { 6 + PostActionRepository({required Bluesky bluesky}) : _bluesky = bluesky; 7 + 8 + final Bluesky _bluesky; 9 + 10 + Future<String> likePost({required AtUri uri, required String cid}) async { 11 + final response = await _bluesky.feed.like.create( 12 + subject: RepoStrongRef(cid: cid, uri: uri), 13 + createdAt: DateTime.now(), 14 + ); 15 + 16 + return response.data.uri.toString(); 17 + } 18 + 19 + Future<void> unlikePost({required String likeUri}) async { 20 + final rkey = _extractRkey(likeUri); 21 + await _bluesky.feed.like.delete(rkey: rkey); 22 + } 23 + 24 + Future<String> repostPost({required AtUri uri, required String cid}) async { 25 + final response = await _bluesky.feed.repost.create( 26 + subject: RepoStrongRef(cid: cid, uri: uri), 27 + createdAt: DateTime.now(), 28 + ); 29 + 30 + return response.data.uri.toString(); 31 + } 32 + 33 + Future<void> unrepostPost({required String repostUri}) async { 34 + final rkey = _extractRkey(repostUri); 35 + await _bluesky.feed.repost.delete(rkey: rkey); 36 + } 37 + 38 + Future<void> deletePost({required String postUri}) async { 39 + final rkey = _extractRkey(postUri); 40 + await _bluesky.feed.post.delete(rkey: rkey); 41 + } 42 + 43 + String _extractRkey(String uri) { 44 + final atUri = AtUri.parse(uri); 45 + return atUri.rkey; 46 + } 47 + }
+238
lib/features/profile/cubit/profile_action_cubit.dart
··· 1 + import 'package:atproto/com_atproto_moderation_defs.dart'; 2 + import 'package:atproto_core/atproto_core.dart'; 3 + import 'package:equatable/equatable.dart'; 4 + import 'package:flutter_bloc/flutter_bloc.dart'; 5 + import 'package:lazurite/core/logging/app_logger.dart'; 6 + import 'package:lazurite/features/profile/data/profile_action_repository.dart'; 7 + 8 + class ProfileActionState extends Equatable { 9 + const ProfileActionState({ 10 + required this.actorDid, 11 + this.isFollowing = false, 12 + this.isMuted = false, 13 + this.isBlocked = false, 14 + this.isBlockedBy = false, 15 + this.followUri, 16 + this.blockUri, 17 + this.isLoadingFollow = false, 18 + this.isLoadingMute = false, 19 + this.isLoadingBlock = false, 20 + this.error, 21 + }); 22 + 23 + final String actorDid; 24 + final bool isFollowing; 25 + final bool isMuted; 26 + final bool isBlocked; 27 + final bool isBlockedBy; 28 + final String? followUri; 29 + final String? blockUri; 30 + final bool isLoadingFollow; 31 + final bool isLoadingMute; 32 + final bool isLoadingBlock; 33 + final String? error; 34 + 35 + bool get canShowActions => !isBlockedBy; 36 + 37 + ProfileActionState copyWith({ 38 + bool? isFollowing, 39 + bool? isMuted, 40 + bool? isBlocked, 41 + bool? isBlockedBy, 42 + String? followUri, 43 + String? blockUri, 44 + bool? isLoadingFollow, 45 + bool? isLoadingMute, 46 + bool? isLoadingBlock, 47 + String? error, 48 + }) { 49 + return ProfileActionState( 50 + actorDid: actorDid, 51 + isFollowing: isFollowing ?? this.isFollowing, 52 + isMuted: isMuted ?? this.isMuted, 53 + isBlocked: isBlocked ?? this.isBlocked, 54 + isBlockedBy: isBlockedBy ?? this.isBlockedBy, 55 + followUri: followUri ?? this.followUri, 56 + blockUri: blockUri ?? this.blockUri, 57 + isLoadingFollow: isLoadingFollow ?? this.isLoadingFollow, 58 + isLoadingMute: isLoadingMute ?? this.isLoadingMute, 59 + isLoadingBlock: isLoadingBlock ?? this.isLoadingBlock, 60 + error: error ?? this.error, 61 + ); 62 + } 63 + 64 + @override 65 + List<Object?> get props => [ 66 + actorDid, 67 + isFollowing, 68 + isMuted, 69 + isBlocked, 70 + isBlockedBy, 71 + followUri, 72 + blockUri, 73 + isLoadingFollow, 74 + isLoadingMute, 75 + isLoadingBlock, 76 + error, 77 + ]; 78 + } 79 + 80 + class ProfileActionCubit extends Cubit<ProfileActionState> { 81 + ProfileActionCubit({ 82 + required ProfileActionRepository profileActionRepository, 83 + required String actorDid, 84 + bool isFollowing = false, 85 + bool isMuted = false, 86 + bool isBlocked = false, 87 + bool isBlockedBy = false, 88 + String? followUri, 89 + String? blockUri, 90 + }) : _profileActionRepository = profileActionRepository, 91 + super( 92 + ProfileActionState( 93 + actorDid: actorDid, 94 + isFollowing: isFollowing, 95 + isMuted: isMuted, 96 + isBlocked: isBlocked, 97 + isBlockedBy: isBlockedBy, 98 + followUri: followUri, 99 + blockUri: blockUri, 100 + ), 101 + ); 102 + 103 + final ProfileActionRepository _profileActionRepository; 104 + 105 + Future<void> toggleFollow() async { 106 + if (state.isLoadingFollow || state.isBlockedBy) return; 107 + 108 + final wasFollowing = state.isFollowing; 109 + final previousFollowUri = state.followUri; 110 + 111 + emit(state.copyWith(isFollowing: !wasFollowing, isLoadingFollow: true, error: null)); 112 + 113 + try { 114 + if (wasFollowing) { 115 + if (previousFollowUri != null) { 116 + await _profileActionRepository.unfollowActor(followUri: previousFollowUri); 117 + emit(state.copyWith(followUri: null, isLoadingFollow: false)); 118 + } else { 119 + emit(state.copyWith(isLoadingFollow: false)); 120 + } 121 + } else { 122 + final newFollowUri = await _profileActionRepository.followActor(did: state.actorDid); 123 + emit(state.copyWith(followUri: newFollowUri, isLoadingFollow: false)); 124 + } 125 + } catch (error) { 126 + log.e('Failed to toggle follow', error: error); 127 + 128 + emit( 129 + state.copyWith( 130 + isFollowing: wasFollowing, 131 + followUri: previousFollowUri, 132 + isLoadingFollow: false, 133 + error: 'Failed to ${wasFollowing ? 'unfollow' : 'follow'} user', 134 + ), 135 + ); 136 + } 137 + } 138 + 139 + Future<void> toggleMute() async { 140 + if (state.isLoadingMute || state.isBlockedBy) return; 141 + 142 + final wasMuted = state.isMuted; 143 + emit(state.copyWith(isMuted: !wasMuted, isLoadingMute: true, error: null)); 144 + 145 + try { 146 + if (wasMuted) { 147 + await _profileActionRepository.unmuteActor(did: state.actorDid); 148 + } else { 149 + await _profileActionRepository.muteActor(did: state.actorDid); 150 + } 151 + emit(state.copyWith(isLoadingMute: false)); 152 + } catch (error) { 153 + log.e('Failed to toggle mute', error: error); 154 + 155 + emit( 156 + state.copyWith( 157 + isMuted: wasMuted, 158 + isLoadingMute: false, 159 + error: 'Failed to ${wasMuted ? 'unmute' : 'mute'} user', 160 + ), 161 + ); 162 + } 163 + } 164 + 165 + Future<void> toggleBlock() async { 166 + if (state.isLoadingBlock || state.isBlockedBy) return; 167 + 168 + final wasBlocked = state.isBlocked; 169 + final previousBlockUri = state.blockUri; 170 + 171 + emit(state.copyWith(isBlocked: !wasBlocked, isLoadingBlock: true, error: null)); 172 + 173 + try { 174 + if (wasBlocked) { 175 + if (previousBlockUri != null) { 176 + await _profileActionRepository.unblockActor(blockUri: previousBlockUri); 177 + emit(state.copyWith(blockUri: null, isLoadingBlock: false)); 178 + } else { 179 + emit(state.copyWith(isLoadingBlock: false)); 180 + } 181 + } else { 182 + final newBlockUri = await _profileActionRepository.blockActor(did: state.actorDid); 183 + emit(state.copyWith(blockUri: newBlockUri, isLoadingBlock: false)); 184 + } 185 + } catch (error) { 186 + log.e('Failed to toggle block', error: error); 187 + 188 + emit( 189 + state.copyWith( 190 + isBlocked: wasBlocked, 191 + blockUri: previousBlockUri, 192 + isLoadingBlock: false, 193 + error: 'Failed to ${wasBlocked ? 'unblock' : 'block'} user', 194 + ), 195 + ); 196 + } 197 + } 198 + 199 + Future<String?> reportPost({ 200 + required AtUri postUri, 201 + required String cid, 202 + required ReasonType reasonType, 203 + String? reason, 204 + }) async { 205 + try { 206 + final reportId = await _profileActionRepository.reportPost( 207 + postUri: postUri, 208 + cid: cid, 209 + reasonType: reasonType, 210 + reason: reason, 211 + ); 212 + return reportId; 213 + } catch (error) { 214 + log.e('Failed to report post', error: error); 215 + emit(state.copyWith(error: 'Failed to report post')); 216 + return null; 217 + } 218 + } 219 + 220 + Future<String?> reportActor({required ReasonType reasonType, String? reason}) async { 221 + try { 222 + final reportId = await _profileActionRepository.reportActor( 223 + did: state.actorDid, 224 + reasonType: reasonType, 225 + reason: reason, 226 + ); 227 + return reportId; 228 + } catch (error) { 229 + log.e('Failed to report actor', error: error); 230 + emit(state.copyWith(error: 'Failed to report user')); 231 + return null; 232 + } 233 + } 234 + 235 + void clearError() { 236 + emit(state.copyWith(error: null)); 237 + } 238 + }
+74
lib/features/profile/data/profile_action_repository.dart
··· 1 + import 'package:atproto/com_atproto_admin_defs.dart'; 2 + import 'package:atproto/com_atproto_moderation_createreport.dart'; 3 + import 'package:atproto/com_atproto_moderation_defs.dart'; 4 + import 'package:atproto/com_atproto_repo_strongref.dart'; 5 + import 'package:atproto_core/atproto_core.dart'; 6 + import 'package:bluesky/bluesky.dart'; 7 + 8 + class ProfileActionRepository { 9 + ProfileActionRepository({required Bluesky bluesky}) : _bluesky = bluesky; 10 + 11 + final Bluesky _bluesky; 12 + 13 + Future<String> followActor({required String did}) async { 14 + final response = await _bluesky.graph.follow.create(subject: did, createdAt: DateTime.now()); 15 + 16 + return response.data.uri.toString(); 17 + } 18 + 19 + Future<void> unfollowActor({required String followUri}) async { 20 + final rkey = _extractRkey(followUri); 21 + await _bluesky.graph.follow.delete(rkey: rkey); 22 + } 23 + 24 + Future<void> muteActor({required String did}) async { 25 + await _bluesky.graph.muteActor(actor: did); 26 + } 27 + 28 + Future<void> unmuteActor({required String did}) async { 29 + await _bluesky.graph.unmuteActor(actor: did); 30 + } 31 + 32 + Future<String> blockActor({required String did}) async { 33 + final response = await _bluesky.graph.block.create(subject: did, createdAt: DateTime.now()); 34 + 35 + return response.data.uri.toString(); 36 + } 37 + 38 + Future<void> unblockActor({required String blockUri}) async { 39 + final rkey = _extractRkey(blockUri); 40 + await _bluesky.graph.block.delete(rkey: rkey); 41 + } 42 + 43 + Future<String> reportPost({ 44 + required AtUri postUri, 45 + required String cid, 46 + required ReasonType reasonType, 47 + String? reason, 48 + }) async { 49 + final response = await _bluesky.atproto.moderation.createReport( 50 + reasonType: reasonType, 51 + subject: UModerationCreateReportSubject.repoStrongRef( 52 + data: RepoStrongRef(cid: cid, uri: postUri), 53 + ), 54 + reason: reason, 55 + ); 56 + 57 + return response.data.id.toString(); 58 + } 59 + 60 + Future<String> reportActor({required String did, required ReasonType reasonType, String? reason}) async { 61 + final response = await _bluesky.atproto.moderation.createReport( 62 + reasonType: reasonType, 63 + subject: UModerationCreateReportSubject.repoRef(data: RepoRef(did: did)), 64 + reason: reason, 65 + ); 66 + 67 + return response.data.id.toString(); 68 + } 69 + 70 + String _extractRkey(String uri) { 71 + final atUri = AtUri.parse(uri); 72 + return atUri.rkey; 73 + } 74 + }
+5 -6
test/core/router/app_router_test.dart
··· 132 132 await tester.pumpWidget(buildSubject()); 133 133 await tester.pumpAndSettle(); 134 134 135 - expect(find.text('Home'), findsAtLeastNWidgets(1)); 136 - expect(find.text('Profile'), findsAtLeastNWidgets(1)); 137 - expect(find.text('Settings'), findsAtLeastNWidgets(1)); 135 + expect(find.byIcon(Icons.home), findsOneWidget); 136 + expect(find.byIcon(Icons.person_outline), findsOneWidget); 137 + expect(find.byIcon(Icons.settings_outlined), findsOneWidget); 138 138 expect(find.text('No feeds pinned'), findsOneWidget); 139 139 140 - await tester.tap(find.text('Profile').last); 140 + await tester.tap(find.byIcon(Icons.person_outline).first); 141 141 await tester.pumpAndSettle(); 142 142 143 143 expect(find.text('River Tam'), findsOneWidget); 144 144 145 - await tester.tap(find.text('Settings').last); 145 + await tester.tap(find.byIcon(Icons.settings_outlined).first); 146 146 await tester.pumpAndSettle(); 147 147 148 - expect(find.text('Settings'), findsAtLeastNWidgets(1)); 149 148 expect(find.text('APPEARANCE'), findsOneWidget); 150 149 }); 151 150 }
+311
test/features/feed/cubit/post_action_cubit_test.dart
··· 1 + import 'package:atproto_core/atproto_core.dart'; 2 + import 'package:bloc_test/bloc_test.dart'; 3 + import 'package:flutter_test/flutter_test.dart'; 4 + import 'package:lazurite/features/feed/cubit/post_action_cubit.dart'; 5 + import 'package:lazurite/features/feed/data/post_action_repository.dart'; 6 + import 'package:mocktail/mocktail.dart'; 7 + 8 + class MockPostActionRepository extends Mock implements PostActionRepository {} 9 + 10 + void main() { 11 + late MockPostActionRepository mockRepository; 12 + 13 + setUpAll(() { 14 + registerFallbackValue(AtUri.parse('at://did:plc:test/app.bsky.feed.post/fallback')); 15 + }); 16 + 17 + setUp(() { 18 + mockRepository = MockPostActionRepository(); 19 + }); 20 + 21 + const testPostUri = 'at://did:plc:test/app.bsky.feed.post/abc123'; 22 + const testPostCid = 'bafyreie5cvv4hhpwo4y6x4f4m6fsq3xrm5f3p5vzum5h5uv5x5x5x5x5x5'; 23 + const testLikeUri = 'at://did:plc:test/app.bsky.feed.like/like456'; 24 + const testRepostUri = 'at://did:plc:test/app.bsky.feed.repost/repost789'; 25 + 26 + group('PostActionCubit', () { 27 + test('initial state has correct values', () { 28 + final cubit = PostActionCubit(postActionRepository: mockRepository, postUri: testPostUri, postCid: testPostCid); 29 + 30 + expect(cubit.state.postUri, testPostUri); 31 + expect(cubit.state.isLiked, isFalse); 32 + expect(cubit.state.isReposted, isFalse); 33 + expect(cubit.state.likeCount, 0); 34 + expect(cubit.state.repostCount, 0); 35 + expect(cubit.state.isLoadingLike, isFalse); 36 + expect(cubit.state.isLoadingRepost, isFalse); 37 + }); 38 + 39 + test('initial state respects provided values', () { 40 + final cubit = PostActionCubit( 41 + postActionRepository: mockRepository, 42 + postUri: testPostUri, 43 + postCid: testPostCid, 44 + isLiked: true, 45 + isReposted: true, 46 + likeCount: 10, 47 + repostCount: 5, 48 + likeUri: testLikeUri, 49 + repostUri: testRepostUri, 50 + ); 51 + 52 + expect(cubit.state.isLiked, isTrue); 53 + expect(cubit.state.isReposted, isTrue); 54 + expect(cubit.state.likeCount, 10); 55 + expect(cubit.state.repostCount, 5); 56 + expect(cubit.state.likeUri, testLikeUri); 57 + expect(cubit.state.repostUri, testRepostUri); 58 + }); 59 + 60 + group('toggleLike', () { 61 + blocTest<PostActionCubit, PostActionState>( 62 + 'emits loading state then liked state when liking', 63 + build: () { 64 + when( 65 + () => mockRepository.likePost( 66 + uri: any(named: 'uri'), 67 + cid: any(named: 'cid'), 68 + ), 69 + ).thenAnswer((_) async => testLikeUri); 70 + return PostActionCubit( 71 + postActionRepository: mockRepository, 72 + postUri: testPostUri, 73 + postCid: testPostCid, 74 + likeCount: 5, 75 + ); 76 + }, 77 + act: (cubit) => cubit.toggleLike(), 78 + expect: () => [ 79 + isA<PostActionState>() 80 + .having((s) => s.isLiked, 'isLiked', isTrue) 81 + .having((s) => s.likeCount, 'likeCount', 6) 82 + .having((s) => s.isLoadingLike, 'isLoadingLike', isTrue) 83 + .having((s) => s.error, 'error', isNull), 84 + isA<PostActionState>() 85 + .having((s) => s.isLiked, 'isLiked', isTrue) 86 + .having((s) => s.likeCount, 'likeCount', 6) 87 + .having((s) => s.likeUri, 'likeUri', testLikeUri) 88 + .having((s) => s.isLoadingLike, 'isLoadingLike', isFalse), 89 + ], 90 + ); 91 + 92 + blocTest<PostActionCubit, PostActionState>( 93 + 'emits loading state then unliked state when unliking', 94 + build: () { 95 + when(() => mockRepository.unlikePost(likeUri: testLikeUri)).thenAnswer((_) async => {}); 96 + return PostActionCubit( 97 + postActionRepository: mockRepository, 98 + postUri: testPostUri, 99 + postCid: testPostCid, 100 + isLiked: true, 101 + likeCount: 5, 102 + likeUri: testLikeUri, 103 + ); 104 + }, 105 + act: (cubit) => cubit.toggleLike(), 106 + expect: () => [ 107 + isA<PostActionState>() 108 + .having((s) => s.isLiked, 'isLiked', isFalse) 109 + .having((s) => s.likeCount, 'likeCount', 4) 110 + .having((s) => s.isLoadingLike, 'isLoadingLike', isTrue), 111 + isA<PostActionState>() 112 + .having((s) => s.isLiked, 'isLiked', isFalse) 113 + .having((s) => s.likeCount, 'likeCount', 4) 114 + .having((s) => s.isLoadingLike, 'isLoadingLike', isFalse), 115 + ], 116 + ); 117 + 118 + blocTest<PostActionCubit, PostActionState>( 119 + 'rolls back state on like failure', 120 + build: () { 121 + when( 122 + () => mockRepository.likePost( 123 + uri: any(named: 'uri'), 124 + cid: any(named: 'cid'), 125 + ), 126 + ).thenThrow(Exception('Network error')); 127 + return PostActionCubit( 128 + postActionRepository: mockRepository, 129 + postUri: testPostUri, 130 + postCid: testPostCid, 131 + likeCount: 5, 132 + ); 133 + }, 134 + act: (cubit) => cubit.toggleLike(), 135 + expect: () => [ 136 + isA<PostActionState>() 137 + .having((s) => s.isLiked, 'isLiked', isTrue) 138 + .having((s) => s.likeCount, 'likeCount', 6) 139 + .having((s) => s.isLoadingLike, 'isLoadingLike', isTrue), 140 + isA<PostActionState>() 141 + .having((s) => s.isLiked, 'isLiked', isFalse) 142 + .having((s) => s.likeCount, 'likeCount', 5) 143 + .having((s) => s.isLoadingLike, 'isLoadingLike', isFalse) 144 + .having((s) => s.error, 'error', 'Failed to like post'), 145 + ], 146 + ); 147 + 148 + blocTest<PostActionCubit, PostActionState>( 149 + 'does nothing when already loading like', 150 + build: () => PostActionCubit(postActionRepository: mockRepository, postUri: testPostUri, postCid: testPostCid), 151 + seed: () => const PostActionState(postUri: testPostUri, isLoadingLike: true), 152 + act: (cubit) => cubit.toggleLike(), 153 + expect: () => [], 154 + ); 155 + }); 156 + 157 + group('toggleRepost', () { 158 + blocTest<PostActionCubit, PostActionState>( 159 + 'emits loading state then reposted state when reposting', 160 + build: () { 161 + when( 162 + () => mockRepository.repostPost( 163 + uri: any(named: 'uri'), 164 + cid: any(named: 'cid'), 165 + ), 166 + ).thenAnswer((_) async => testRepostUri); 167 + return PostActionCubit( 168 + postActionRepository: mockRepository, 169 + postUri: testPostUri, 170 + postCid: testPostCid, 171 + repostCount: 3, 172 + ); 173 + }, 174 + act: (cubit) => cubit.toggleRepost(), 175 + expect: () => [ 176 + isA<PostActionState>() 177 + .having((s) => s.isReposted, 'isReposted', isTrue) 178 + .having((s) => s.repostCount, 'repostCount', 4) 179 + .having((s) => s.isLoadingRepost, 'isLoadingRepost', isTrue), 180 + isA<PostActionState>() 181 + .having((s) => s.isReposted, 'isReposted', isTrue) 182 + .having((s) => s.repostCount, 'repostCount', 4) 183 + .having((s) => s.repostUri, 'repostUri', testRepostUri) 184 + .having((s) => s.isLoadingRepost, 'isLoadingRepost', isFalse), 185 + ], 186 + ); 187 + 188 + blocTest<PostActionCubit, PostActionState>( 189 + 'emits loading state then unreposted state when unreposting', 190 + build: () { 191 + when(() => mockRepository.unrepostPost(repostUri: testRepostUri)).thenAnswer((_) async => {}); 192 + return PostActionCubit( 193 + postActionRepository: mockRepository, 194 + postUri: testPostUri, 195 + postCid: testPostCid, 196 + isReposted: true, 197 + repostCount: 3, 198 + repostUri: testRepostUri, 199 + ); 200 + }, 201 + act: (cubit) => cubit.toggleRepost(), 202 + expect: () => [ 203 + isA<PostActionState>() 204 + .having((s) => s.isReposted, 'isReposted', isFalse) 205 + .having((s) => s.repostCount, 'repostCount', 2) 206 + .having((s) => s.isLoadingRepost, 'isLoadingRepost', isTrue), 207 + isA<PostActionState>() 208 + .having((s) => s.isReposted, 'isReposted', isFalse) 209 + .having((s) => s.repostCount, 'repostCount', 2) 210 + .having((s) => s.isLoadingRepost, 'isLoadingRepost', isFalse), 211 + ], 212 + ); 213 + 214 + blocTest<PostActionCubit, PostActionState>( 215 + 'rolls back state on repost failure', 216 + build: () { 217 + when( 218 + () => mockRepository.repostPost( 219 + uri: any(named: 'uri'), 220 + cid: any(named: 'cid'), 221 + ), 222 + ).thenThrow(Exception('Network error')); 223 + return PostActionCubit( 224 + postActionRepository: mockRepository, 225 + postUri: testPostUri, 226 + postCid: testPostCid, 227 + repostCount: 3, 228 + ); 229 + }, 230 + act: (cubit) => cubit.toggleRepost(), 231 + expect: () => [ 232 + isA<PostActionState>() 233 + .having((s) => s.isReposted, 'isReposted', isTrue) 234 + .having((s) => s.repostCount, 'repostCount', 4) 235 + .having((s) => s.isLoadingRepost, 'isLoadingRepost', isTrue), 236 + isA<PostActionState>() 237 + .having((s) => s.isReposted, 'isReposted', isFalse) 238 + .having((s) => s.repostCount, 'repostCount', 3) 239 + .having((s) => s.isLoadingRepost, 'isLoadingRepost', isFalse) 240 + .having((s) => s.error, 'error', 'Failed to repost post'), 241 + ], 242 + ); 243 + }); 244 + 245 + group('deletePost', () { 246 + blocTest<PostActionCubit, PostActionState>( 247 + 'calls deletePost on repository', 248 + build: () { 249 + when(() => mockRepository.deletePost(postUri: testPostUri)).thenAnswer((_) async => {}); 250 + return PostActionCubit(postActionRepository: mockRepository, postUri: testPostUri, postCid: testPostCid); 251 + }, 252 + act: (cubit) => cubit.deletePost(), 253 + verify: (_) { 254 + verify(() => mockRepository.deletePost(postUri: testPostUri)).called(1); 255 + }, 256 + ); 257 + 258 + blocTest<PostActionCubit, PostActionState>( 259 + 'emits error when delete fails', 260 + build: () { 261 + when(() => mockRepository.deletePost(postUri: testPostUri)).thenThrow(Exception('Network error')); 262 + return PostActionCubit(postActionRepository: mockRepository, postUri: testPostUri, postCid: testPostCid); 263 + }, 264 + act: (cubit) => cubit.deletePost(), 265 + expect: () => [isA<PostActionState>().having((s) => s.error, 'error', 'Failed to delete post')], 266 + ); 267 + }); 268 + }); 269 + 270 + group('PostActionState', () { 271 + test('props includes all fields', () { 272 + const state1 = PostActionState( 273 + postUri: testPostUri, 274 + isLiked: true, 275 + isReposted: false, 276 + likeCount: 5, 277 + repostCount: 3, 278 + likeUri: testLikeUri, 279 + repostUri: testRepostUri, 280 + isLoadingLike: true, 281 + isLoadingRepost: false, 282 + error: 'test error', 283 + ); 284 + 285 + const state2 = PostActionState( 286 + postUri: testPostUri, 287 + isLiked: true, 288 + isReposted: false, 289 + likeCount: 5, 290 + repostCount: 3, 291 + likeUri: testLikeUri, 292 + repostUri: testRepostUri, 293 + isLoadingLike: true, 294 + isLoadingRepost: false, 295 + error: 'test error', 296 + ); 297 + 298 + expect(state1, equals(state2)); 299 + }); 300 + 301 + test('copyWith creates new instance with updated values', () { 302 + const state = PostActionState(postUri: testPostUri, isLiked: false, likeCount: 0); 303 + 304 + final copied = state.copyWith(isLiked: true, likeCount: 1); 305 + 306 + expect(copied.isLiked, isTrue); 307 + expect(copied.likeCount, 1); 308 + expect(copied.postUri, testPostUri); 309 + }); 310 + }); 311 + }
+248
test/features/feed/cubit/saved_posts_cubit_test.dart
··· 1 + import 'package:drift/drift.dart' hide isNull; 2 + import 'package:drift/native.dart'; 3 + import 'package:flutter_test/flutter_test.dart'; 4 + import 'package:lazurite/core/database/app_database.dart'; 5 + import 'package:lazurite/features/feed/cubit/saved_posts_cubit.dart'; 6 + 7 + void main() { 8 + late AppDatabase database; 9 + 10 + const testAccountDid = 'did:plc:testuser123'; 11 + const testPostUri1 = 'at://did:plc:author1/app.bsky.feed.post/abc123'; 12 + const testPostUri2 = 'at://did:plc:author2/app.bsky.feed.post/def456'; 13 + const testPostJson1 = '{"uri": "$testPostUri1", "text": "Post 1"}'; 14 + const testPostJson2 = '{"uri": "$testPostUri2", "text": "Post 2"}'; 15 + 16 + setUp(() async { 17 + database = AppDatabase(executor: NativeDatabase.memory()); 18 + }); 19 + 20 + tearDown(() async { 21 + await database.close(); 22 + }); 23 + 24 + group('SavedPostsCubit', () { 25 + test('initial state has correct values', () { 26 + final cubit = SavedPostsCubit(database: database, accountDid: testAccountDid); 27 + 28 + expect(cubit.state.status, SavedPostsStatus.initial); 29 + expect(cubit.state.savedPosts, isEmpty); 30 + expect(cubit.state.savedUris, isEmpty); 31 + expect(cubit.state.error, isNull); 32 + }); 33 + 34 + group('loadSavedPosts', () { 35 + test('loads empty list when no saved posts', () async { 36 + final cubit = SavedPostsCubit(database: database, accountDid: testAccountDid); 37 + 38 + await cubit.loadSavedPosts(); 39 + 40 + expect(cubit.state.status, SavedPostsStatus.loaded); 41 + expect(cubit.state.savedPosts, isEmpty); 42 + }); 43 + 44 + test('loads saved posts from database', () async { 45 + await database.savePost( 46 + SavedPostsCompanion( 47 + accountDid: const Value(testAccountDid), 48 + postUri: const Value(testPostUri1), 49 + postJson: const Value(testPostJson1), 50 + savedAt: Value(DateTime.now()), 51 + ), 52 + ); 53 + 54 + final cubit = SavedPostsCubit(database: database, accountDid: testAccountDid); 55 + 56 + await cubit.loadSavedPosts(); 57 + 58 + expect(cubit.state.status, SavedPostsStatus.loaded); 59 + expect(cubit.state.savedPosts.length, 1); 60 + expect(cubit.state.savedUris.contains(testPostUri1), isTrue); 61 + }); 62 + }); 63 + 64 + group('toggleSave', () { 65 + test('saves post when not saved', () async { 66 + final cubit = SavedPostsCubit(database: database, accountDid: testAccountDid); 67 + 68 + await cubit.toggleSave(postUri: testPostUri1, postJson: testPostJson1); 69 + 70 + expect(cubit.state.savedPosts.length, 1); 71 + expect(cubit.state.isSaved(testPostUri1), isTrue); 72 + }); 73 + 74 + test('unsaves post when already saved', () async { 75 + await database.savePost( 76 + SavedPostsCompanion( 77 + accountDid: const Value(testAccountDid), 78 + postUri: const Value(testPostUri1), 79 + postJson: const Value(testPostJson1), 80 + savedAt: Value(DateTime.now()), 81 + ), 82 + ); 83 + 84 + final cubit = SavedPostsCubit(database: database, accountDid: testAccountDid); 85 + 86 + await cubit.loadSavedPosts(); 87 + expect(cubit.state.savedPosts.length, 1); 88 + 89 + await cubit.toggleSave(postUri: testPostUri1, postJson: testPostJson1); 90 + 91 + expect(cubit.state.savedPosts.length, 0); 92 + expect(cubit.state.isSaved(testPostUri1), isFalse); 93 + }); 94 + }); 95 + 96 + group('savePost', () { 97 + test('saves post when not already saved', () async { 98 + final cubit = SavedPostsCubit(database: database, accountDid: testAccountDid); 99 + 100 + final result = await cubit.savePost(postUri: testPostUri1, postJson: testPostJson1); 101 + 102 + expect(result, isTrue); 103 + expect(cubit.state.savedPosts.length, 1); 104 + }); 105 + 106 + test('returns true when already saved', () async { 107 + await database.savePost( 108 + SavedPostsCompanion( 109 + accountDid: const Value(testAccountDid), 110 + postUri: const Value(testPostUri1), 111 + postJson: const Value(testPostJson1), 112 + savedAt: Value(DateTime.now()), 113 + ), 114 + ); 115 + 116 + final cubit = SavedPostsCubit(database: database, accountDid: testAccountDid); 117 + 118 + await cubit.loadSavedPosts(); 119 + final result = await cubit.savePost(postUri: testPostUri1, postJson: testPostJson1); 120 + 121 + expect(result, isTrue); 122 + }); 123 + }); 124 + 125 + group('unsavePost', () { 126 + test('removes saved post', () async { 127 + await database.savePost( 128 + SavedPostsCompanion( 129 + accountDid: const Value(testAccountDid), 130 + postUri: const Value(testPostUri1), 131 + postJson: const Value(testPostJson1), 132 + savedAt: Value(DateTime.now()), 133 + ), 134 + ); 135 + 136 + final cubit = SavedPostsCubit(database: database, accountDid: testAccountDid); 137 + 138 + await cubit.loadSavedPosts(); 139 + expect(cubit.state.savedPosts.length, 1); 140 + 141 + await cubit.unsavePost(testPostUri1); 142 + 143 + expect(cubit.state.savedPosts.length, 0); 144 + }); 145 + }); 146 + 147 + group('unsavePostById', () { 148 + test('removes post by id', () async { 149 + await database.savePost( 150 + SavedPostsCompanion( 151 + accountDid: const Value(testAccountDid), 152 + postUri: const Value(testPostUri1), 153 + postJson: const Value(testPostJson1), 154 + savedAt: Value(DateTime.now()), 155 + ), 156 + ); 157 + 158 + final cubit = SavedPostsCubit(database: database, accountDid: testAccountDid); 159 + 160 + await cubit.loadSavedPosts(); 161 + final posts = await database.getSavedPosts(testAccountDid); 162 + 163 + await cubit.unsavePostById(posts.first.id); 164 + 165 + expect(cubit.state.savedPosts.length, 0); 166 + }); 167 + }); 168 + 169 + group('clearAllSaved', () { 170 + test('removes all saved posts', () async { 171 + await database.savePost( 172 + SavedPostsCompanion( 173 + accountDid: const Value(testAccountDid), 174 + postUri: const Value(testPostUri1), 175 + postJson: const Value(testPostJson1), 176 + savedAt: Value(DateTime.now()), 177 + ), 178 + ); 179 + await database.savePost( 180 + SavedPostsCompanion( 181 + accountDid: const Value(testAccountDid), 182 + postUri: const Value(testPostUri2), 183 + postJson: const Value(testPostJson2), 184 + savedAt: Value(DateTime.now()), 185 + ), 186 + ); 187 + 188 + final cubit = SavedPostsCubit(database: database, accountDid: testAccountDid); 189 + 190 + await cubit.loadSavedPosts(); 191 + expect(cubit.state.savedPosts.length, 2); 192 + 193 + await cubit.clearAllSaved(); 194 + 195 + expect(cubit.state.savedPosts.length, 0); 196 + expect(cubit.state.savedUris.length, 0); 197 + }); 198 + }); 199 + 200 + group('isSaved', () { 201 + test('returns true when post is saved', () async { 202 + final cubit = SavedPostsCubit(database: database, accountDid: testAccountDid); 203 + 204 + await cubit.savePost(postUri: testPostUri1, postJson: testPostJson1); 205 + 206 + expect(cubit.state.isSaved(testPostUri1), isTrue); 207 + expect(cubit.state.isSaved(testPostUri2), isFalse); 208 + }); 209 + }); 210 + 211 + group('SavedPostsState', () { 212 + test('props includes all fields', () { 213 + const state1 = SavedPostsState( 214 + status: SavedPostsStatus.loaded, 215 + savedPosts: [], 216 + savedUris: {}, 217 + error: 'test error', 218 + ); 219 + 220 + const state2 = SavedPostsState( 221 + status: SavedPostsStatus.loaded, 222 + savedPosts: [], 223 + savedUris: {}, 224 + error: 'test error', 225 + ); 226 + 227 + expect(state1, equals(state2)); 228 + }); 229 + 230 + test('copyWith creates new instance with updated values', () { 231 + const state = SavedPostsState(status: SavedPostsStatus.initial, savedPosts: []); 232 + 233 + final copied = state.copyWith(status: SavedPostsStatus.loaded, error: 'New error'); 234 + 235 + expect(copied.status, SavedPostsStatus.loaded); 236 + expect(copied.error, 'New error'); 237 + expect(copied.savedPosts, isEmpty); 238 + }); 239 + 240 + test('isSaved returns correct value', () { 241 + const state = SavedPostsState(status: SavedPostsStatus.loaded, savedUris: {'uri1', 'uri2'}); 242 + 243 + expect(state.isSaved('uri1'), isTrue); 244 + expect(state.isSaved('uri3'), isFalse); 245 + }); 246 + }); 247 + }); 248 + }
+168
test/features/feed/data/post_action_repository_test.dart
··· 1 + import 'package:flutter_test/flutter_test.dart'; 2 + import 'package:lazurite/features/feed/data/post_action_repository.dart'; 3 + 4 + class MockPostActionRepository implements PostActionRepository { 5 + final Map<String, dynamic> _likes = {}; 6 + final Map<String, dynamic> _reposts = {}; 7 + final Set<String> _deletedPosts = {}; 8 + 9 + @override 10 + Future<String> likePost({required dynamic uri, required String cid}) async { 11 + final likeUri = 'at://did:plc:test/app.bsky.feed.like/${uri.rkey}_like'; 12 + _likes[uri.toString()] = likeUri; 13 + return likeUri; 14 + } 15 + 16 + @override 17 + Future<void> unlikePost({required String likeUri}) async { 18 + _likes.removeWhere((key, value) => value == likeUri); 19 + } 20 + 21 + @override 22 + Future<String> repostPost({required dynamic uri, required String cid}) async { 23 + final repostUri = 'at://did:plc:test/app.bsky.feed.repost/${uri.rkey}_repost'; 24 + _reposts[uri.toString()] = repostUri; 25 + return repostUri; 26 + } 27 + 28 + @override 29 + Future<void> unrepostPost({required String repostUri}) async { 30 + _reposts.removeWhere((key, value) => value == repostUri); 31 + } 32 + 33 + @override 34 + Future<void> deletePost({required String postUri}) async { 35 + _deletedPosts.add(postUri); 36 + } 37 + 38 + bool isLiked(String postUri) => _likes.containsKey(postUri); 39 + bool isReposted(String postUri) => _reposts.containsKey(postUri); 40 + bool isDeleted(String postUri) => _deletedPosts.contains(postUri); 41 + String? getLikeUri(String postUri) => _likes[postUri]; 42 + String? getRepostUri(String postUri) => _reposts[postUri]; 43 + } 44 + 45 + void main() { 46 + late MockPostActionRepository repository; 47 + 48 + setUp(() { 49 + repository = MockPostActionRepository(); 50 + }); 51 + 52 + group('PostActionRepository Contract', () { 53 + const testCid = 'bafyreie5cvv4hhpwo4y6x4f4m6fsq3xrm5f3p5vzum5h5uv5x5x5x5x5x5'; 54 + 55 + group('likePost', () { 56 + test('should return like URI when successful', () async { 57 + final uri = _createTestUri('abc123'); 58 + 59 + final result = await repository.likePost(uri: uri, cid: testCid); 60 + 61 + expect(result, isNotNull); 62 + expect(result, contains('app.bsky.feed.like')); 63 + expect(repository.isLiked(uri.toString()), isTrue); 64 + }); 65 + 66 + test('should return different URIs for different posts', () async { 67 + final uri1 = _createTestUri('post1'); 68 + final uri2 = _createTestUri('post2'); 69 + 70 + final result1 = await repository.likePost(uri: uri1, cid: testCid); 71 + final result2 = await repository.likePost(uri: uri2, cid: testCid); 72 + 73 + expect(result1, isNot(equals(result2))); 74 + }); 75 + }); 76 + 77 + group('unlikePost', () { 78 + test('should remove like record', () async { 79 + final uri = _createTestUri('abc123'); 80 + final likeUri = await repository.likePost(uri: uri, cid: testCid); 81 + 82 + expect(repository.isLiked(uri.toString()), isTrue); 83 + 84 + await repository.unlikePost(likeUri: likeUri); 85 + 86 + expect(repository.isLiked(uri.toString()), isFalse); 87 + }); 88 + }); 89 + 90 + group('repostPost', () { 91 + test('should return repost URI when successful', () async { 92 + final uri = _createTestUri('abc123'); 93 + 94 + final result = await repository.repostPost(uri: uri, cid: testCid); 95 + 96 + expect(result, isNotNull); 97 + expect(result, contains('app.bsky.feed.repost')); 98 + expect(repository.isReposted(uri.toString()), isTrue); 99 + }); 100 + 101 + test('should return different URIs for different posts', () async { 102 + final uri1 = _createTestUri('post1'); 103 + final uri2 = _createTestUri('post2'); 104 + 105 + final result1 = await repository.repostPost(uri: uri1, cid: testCid); 106 + final result2 = await repository.repostPost(uri: uri2, cid: testCid); 107 + 108 + expect(result1, isNot(equals(result2))); 109 + }); 110 + }); 111 + 112 + group('unrepostPost', () { 113 + test('should remove repost record', () async { 114 + final uri = _createTestUri('abc123'); 115 + final repostUri = await repository.repostPost(uri: uri, cid: testCid); 116 + 117 + expect(repository.isReposted(uri.toString()), isTrue); 118 + 119 + await repository.unrepostPost(repostUri: repostUri); 120 + 121 + expect(repository.isReposted(uri.toString()), isFalse); 122 + }); 123 + }); 124 + 125 + group('deletePost', () { 126 + test('should mark post as deleted', () async { 127 + const postUri = 'at://did:plc:test/app.bsky.feed.post/to_delete'; 128 + 129 + expect(repository.isDeleted(postUri), isFalse); 130 + 131 + await repository.deletePost(postUri: postUri); 132 + 133 + expect(repository.isDeleted(postUri), isTrue); 134 + }); 135 + }); 136 + 137 + group('like and repost interaction', () { 138 + test('should track likes and reposts independently', () async { 139 + final uri = _createTestUri('abc123'); 140 + 141 + expect(repository.isLiked(uri.toString()), isFalse); 142 + expect(repository.isReposted(uri.toString()), isFalse); 143 + 144 + await repository.likePost(uri: uri, cid: testCid); 145 + expect(repository.isLiked(uri.toString()), isTrue); 146 + expect(repository.isReposted(uri.toString()), isFalse); 147 + 148 + await repository.repostPost(uri: uri, cid: testCid); 149 + expect(repository.isLiked(uri.toString()), isTrue); 150 + expect(repository.isReposted(uri.toString()), isTrue); 151 + }); 152 + }); 153 + }); 154 + } 155 + 156 + dynamic _createTestUri(String rkey) { 157 + return _MockAtUri('at://did:plc:test/app.bsky.feed.post/$rkey', rkey); 158 + } 159 + 160 + class _MockAtUri { 161 + _MockAtUri(this._uri, this.rkey); 162 + 163 + final String _uri; 164 + final String rkey; 165 + 166 + @override 167 + String toString() => _uri; 168 + }
+411
test/features/profile/cubit/profile_action_cubit_test.dart
··· 1 + import 'package:atproto/com_atproto_moderation_defs.dart'; 2 + import 'package:atproto_core/atproto_core.dart'; 3 + import 'package:bloc_test/bloc_test.dart'; 4 + import 'package:flutter_test/flutter_test.dart'; 5 + import 'package:lazurite/features/profile/cubit/profile_action_cubit.dart'; 6 + import 'package:lazurite/features/profile/data/profile_action_repository.dart'; 7 + import 'package:mocktail/mocktail.dart'; 8 + 9 + class MockProfileActionRepository extends Mock implements ProfileActionRepository {} 10 + 11 + void main() { 12 + late MockProfileActionRepository mockRepository; 13 + 14 + setUpAll(() { 15 + registerFallbackValue(AtUri.parse('at://did:plc:test/app.bsky.feed.post/fallback')); 16 + registerFallbackValue(const ReasonType.knownValue(data: KnownReasonType.comAtprotoModerationDefsReasonSpam)); 17 + }); 18 + 19 + setUp(() { 20 + mockRepository = MockProfileActionRepository(); 21 + }); 22 + 23 + const testActorDid = 'did:plc:testuser123'; 24 + const testFollowUri = 'at://did:plc:test/app.bsky.graph.follow/follow456'; 25 + const testBlockUri = 'at://did:plc:test/app.bsky.graph.block/block789'; 26 + const testPostUri = 'at://did:plc:other/app.bsky.feed.post/abc123'; 27 + const testCid = 'bafyreie5cvv4hhpwo4y6x4f4m6fsq3xrm5f3p5vzum5h5uv5x5x5x5x5x5'; 28 + 29 + group('ProfileActionCubit', () { 30 + test('initial state has correct values', () { 31 + final cubit = ProfileActionCubit(profileActionRepository: mockRepository, actorDid: testActorDid); 32 + 33 + expect(cubit.state.actorDid, testActorDid); 34 + expect(cubit.state.isFollowing, isFalse); 35 + expect(cubit.state.isMuted, isFalse); 36 + expect(cubit.state.isBlocked, isFalse); 37 + expect(cubit.state.isBlockedBy, isFalse); 38 + expect(cubit.state.canShowActions, isTrue); 39 + expect(cubit.state.isLoadingFollow, isFalse); 40 + expect(cubit.state.isLoadingMute, isFalse); 41 + expect(cubit.state.isLoadingBlock, isFalse); 42 + }); 43 + 44 + test('initial state respects provided values', () { 45 + final cubit = ProfileActionCubit( 46 + profileActionRepository: mockRepository, 47 + actorDid: testActorDid, 48 + isFollowing: true, 49 + isMuted: true, 50 + isBlocked: true, 51 + isBlockedBy: false, 52 + followUri: testFollowUri, 53 + blockUri: testBlockUri, 54 + ); 55 + 56 + expect(cubit.state.isFollowing, isTrue); 57 + expect(cubit.state.isMuted, isTrue); 58 + expect(cubit.state.isBlocked, isTrue); 59 + expect(cubit.state.followUri, testFollowUri); 60 + expect(cubit.state.blockUri, testBlockUri); 61 + }); 62 + 63 + test('canShowActions returns false when blockedBy', () { 64 + final cubit = ProfileActionCubit( 65 + profileActionRepository: mockRepository, 66 + actorDid: testActorDid, 67 + isBlockedBy: true, 68 + ); 69 + 70 + expect(cubit.state.canShowActions, isFalse); 71 + }); 72 + 73 + group('toggleFollow', () { 74 + blocTest<ProfileActionCubit, ProfileActionState>( 75 + 'emits loading state then following state when following', 76 + build: () { 77 + when(() => mockRepository.followActor(did: testActorDid)).thenAnswer((_) async => testFollowUri); 78 + return ProfileActionCubit(profileActionRepository: mockRepository, actorDid: testActorDid); 79 + }, 80 + act: (cubit) => cubit.toggleFollow(), 81 + expect: () => [ 82 + isA<ProfileActionState>() 83 + .having((s) => s.isFollowing, 'isFollowing', isTrue) 84 + .having((s) => s.isLoadingFollow, 'isLoadingFollow', isTrue) 85 + .having((s) => s.error, 'error', isNull), 86 + isA<ProfileActionState>() 87 + .having((s) => s.isFollowing, 'isFollowing', isTrue) 88 + .having((s) => s.followUri, 'followUri', testFollowUri) 89 + .having((s) => s.isLoadingFollow, 'isLoadingFollow', isFalse), 90 + ], 91 + ); 92 + 93 + blocTest<ProfileActionCubit, ProfileActionState>( 94 + 'emits loading state then unfollowed state when unfollowing', 95 + build: () { 96 + when(() => mockRepository.unfollowActor(followUri: testFollowUri)).thenAnswer((_) async {}); 97 + return ProfileActionCubit( 98 + profileActionRepository: mockRepository, 99 + actorDid: testActorDid, 100 + isFollowing: true, 101 + followUri: testFollowUri, 102 + ); 103 + }, 104 + act: (cubit) => cubit.toggleFollow(), 105 + expect: () => [ 106 + isA<ProfileActionState>() 107 + .having((s) => s.isFollowing, 'isFollowing', isFalse) 108 + .having((s) => s.isLoadingFollow, 'isLoadingFollow', isTrue), 109 + isA<ProfileActionState>() 110 + .having((s) => s.isFollowing, 'isFollowing', isFalse) 111 + .having((s) => s.isLoadingFollow, 'isLoadingFollow', isFalse), 112 + ], 113 + ); 114 + 115 + blocTest<ProfileActionCubit, ProfileActionState>( 116 + 'rolls back state on follow failure', 117 + build: () { 118 + when(() => mockRepository.followActor(did: testActorDid)).thenThrow(Exception('Network error')); 119 + return ProfileActionCubit(profileActionRepository: mockRepository, actorDid: testActorDid); 120 + }, 121 + act: (cubit) => cubit.toggleFollow(), 122 + expect: () => [ 123 + isA<ProfileActionState>() 124 + .having((s) => s.isFollowing, 'isFollowing', isTrue) 125 + .having((s) => s.isLoadingFollow, 'isLoadingFollow', isTrue), 126 + isA<ProfileActionState>() 127 + .having((s) => s.isFollowing, 'isFollowing', isFalse) 128 + .having((s) => s.isLoadingFollow, 'isLoadingFollow', isFalse) 129 + .having((s) => s.error, 'error', 'Failed to follow user'), 130 + ], 131 + ); 132 + 133 + blocTest<ProfileActionCubit, ProfileActionState>( 134 + 'does nothing when blocked by user', 135 + build: () => 136 + ProfileActionCubit(profileActionRepository: mockRepository, actorDid: testActorDid, isBlockedBy: true), 137 + act: (cubit) => cubit.toggleFollow(), 138 + expect: () => [], 139 + ); 140 + 141 + blocTest<ProfileActionCubit, ProfileActionState>( 142 + 'does nothing when already loading', 143 + build: () => ProfileActionCubit(profileActionRepository: mockRepository, actorDid: testActorDid), 144 + seed: () => const ProfileActionState(actorDid: testActorDid, isLoadingFollow: true), 145 + act: (cubit) => cubit.toggleFollow(), 146 + expect: () => [], 147 + ); 148 + }); 149 + 150 + group('toggleMute', () { 151 + blocTest<ProfileActionCubit, ProfileActionState>( 152 + 'emits loading state then muted state when muting', 153 + build: () { 154 + when(() => mockRepository.muteActor(did: testActorDid)).thenAnswer((_) async {}); 155 + return ProfileActionCubit(profileActionRepository: mockRepository, actorDid: testActorDid); 156 + }, 157 + act: (cubit) => cubit.toggleMute(), 158 + expect: () => [ 159 + isA<ProfileActionState>() 160 + .having((s) => s.isMuted, 'isMuted', isTrue) 161 + .having((s) => s.isLoadingMute, 'isLoadingMute', isTrue), 162 + isA<ProfileActionState>() 163 + .having((s) => s.isMuted, 'isMuted', isTrue) 164 + .having((s) => s.isLoadingMute, 'isLoadingMute', isFalse), 165 + ], 166 + ); 167 + 168 + blocTest<ProfileActionCubit, ProfileActionState>( 169 + 'emits loading state then unmuted state when unmuting', 170 + build: () { 171 + when(() => mockRepository.unmuteActor(did: testActorDid)).thenAnswer((_) async {}); 172 + return ProfileActionCubit(profileActionRepository: mockRepository, actorDid: testActorDid, isMuted: true); 173 + }, 174 + act: (cubit) => cubit.toggleMute(), 175 + expect: () => [ 176 + isA<ProfileActionState>() 177 + .having((s) => s.isMuted, 'isMuted', isFalse) 178 + .having((s) => s.isLoadingMute, 'isLoadingMute', isTrue), 179 + isA<ProfileActionState>() 180 + .having((s) => s.isMuted, 'isMuted', isFalse) 181 + .having((s) => s.isLoadingMute, 'isLoadingMute', isFalse), 182 + ], 183 + ); 184 + 185 + blocTest<ProfileActionCubit, ProfileActionState>( 186 + 'rolls back state on mute failure', 187 + build: () { 188 + when(() => mockRepository.muteActor(did: testActorDid)).thenThrow(Exception('Network error')); 189 + return ProfileActionCubit(profileActionRepository: mockRepository, actorDid: testActorDid); 190 + }, 191 + act: (cubit) => cubit.toggleMute(), 192 + expect: () => [ 193 + isA<ProfileActionState>() 194 + .having((s) => s.isMuted, 'isMuted', isTrue) 195 + .having((s) => s.isLoadingMute, 'isLoadingMute', isTrue), 196 + isA<ProfileActionState>() 197 + .having((s) => s.isMuted, 'isMuted', isFalse) 198 + .having((s) => s.isLoadingMute, 'isLoadingMute', isFalse) 199 + .having((s) => s.error, 'error', 'Failed to mute user'), 200 + ], 201 + ); 202 + }); 203 + 204 + group('toggleBlock', () { 205 + blocTest<ProfileActionCubit, ProfileActionState>( 206 + 'emits loading state then blocked state when blocking', 207 + build: () { 208 + when(() => mockRepository.blockActor(did: testActorDid)).thenAnswer((_) async => testBlockUri); 209 + return ProfileActionCubit(profileActionRepository: mockRepository, actorDid: testActorDid); 210 + }, 211 + act: (cubit) => cubit.toggleBlock(), 212 + expect: () => [ 213 + isA<ProfileActionState>() 214 + .having((s) => s.isBlocked, 'isBlocked', isTrue) 215 + .having((s) => s.isLoadingBlock, 'isLoadingBlock', isTrue), 216 + isA<ProfileActionState>() 217 + .having((s) => s.isBlocked, 'isBlocked', isTrue) 218 + .having((s) => s.blockUri, 'blockUri', testBlockUri) 219 + .having((s) => s.isLoadingBlock, 'isLoadingBlock', isFalse), 220 + ], 221 + ); 222 + 223 + blocTest<ProfileActionCubit, ProfileActionState>( 224 + 'emits loading state then unblocked state when unblocking', 225 + build: () { 226 + when(() => mockRepository.unblockActor(blockUri: testBlockUri)).thenAnswer((_) async {}); 227 + return ProfileActionCubit( 228 + profileActionRepository: mockRepository, 229 + actorDid: testActorDid, 230 + isBlocked: true, 231 + blockUri: testBlockUri, 232 + ); 233 + }, 234 + act: (cubit) => cubit.toggleBlock(), 235 + expect: () => [ 236 + isA<ProfileActionState>() 237 + .having((s) => s.isBlocked, 'isBlocked', isFalse) 238 + .having((s) => s.isLoadingBlock, 'isLoadingBlock', isTrue), 239 + isA<ProfileActionState>() 240 + .having((s) => s.isBlocked, 'isBlocked', isFalse) 241 + .having((s) => s.isLoadingBlock, 'isLoadingBlock', isFalse), 242 + ], 243 + ); 244 + 245 + blocTest<ProfileActionCubit, ProfileActionState>( 246 + 'rolls back state on block failure', 247 + build: () { 248 + when(() => mockRepository.blockActor(did: testActorDid)).thenThrow(Exception('Network error')); 249 + return ProfileActionCubit(profileActionRepository: mockRepository, actorDid: testActorDid); 250 + }, 251 + act: (cubit) => cubit.toggleBlock(), 252 + expect: () => [ 253 + isA<ProfileActionState>() 254 + .having((s) => s.isBlocked, 'isBlocked', isTrue) 255 + .having((s) => s.isLoadingBlock, 'isLoadingBlock', isTrue), 256 + isA<ProfileActionState>() 257 + .having((s) => s.isBlocked, 'isBlocked', isFalse) 258 + .having((s) => s.isLoadingBlock, 'isLoadingBlock', isFalse) 259 + .having((s) => s.error, 'error', 'Failed to block user'), 260 + ], 261 + ); 262 + }); 263 + 264 + group('reportPost', () { 265 + blocTest<ProfileActionCubit, ProfileActionState>( 266 + 'returns report ID on success', 267 + build: () { 268 + when( 269 + () => mockRepository.reportPost( 270 + postUri: any(named: 'postUri'), 271 + cid: any(named: 'cid'), 272 + reasonType: any(named: 'reasonType'), 273 + reason: any(named: 'reason'), 274 + ), 275 + ).thenAnswer((_) async => 'report_123'); 276 + return ProfileActionCubit(profileActionRepository: mockRepository, actorDid: testActorDid); 277 + }, 278 + act: (cubit) async { 279 + final result = await cubit.reportPost( 280 + postUri: AtUri.parse(testPostUri), 281 + cid: testCid, 282 + reasonType: const ReasonType.knownValue(data: KnownReasonType.comAtprotoModerationDefsReasonSpam), 283 + ); 284 + expect(result, 'report_123'); 285 + }, 286 + verify: (_) { 287 + verify( 288 + () => mockRepository.reportPost( 289 + postUri: any(named: 'postUri'), 290 + cid: testCid, 291 + reasonType: any(named: 'reasonType'), 292 + reason: null, 293 + ), 294 + ).called(1); 295 + }, 296 + ); 297 + 298 + blocTest<ProfileActionCubit, ProfileActionState>( 299 + 'returns null and emits error on failure', 300 + build: () { 301 + when( 302 + () => mockRepository.reportPost( 303 + postUri: any(named: 'postUri'), 304 + cid: any(named: 'cid'), 305 + reasonType: any(named: 'reasonType'), 306 + reason: any(named: 'reason'), 307 + ), 308 + ).thenThrow(Exception('Network error')); 309 + return ProfileActionCubit(profileActionRepository: mockRepository, actorDid: testActorDid); 310 + }, 311 + act: (cubit) async { 312 + final result = await cubit.reportPost( 313 + postUri: AtUri.parse(testPostUri), 314 + cid: testCid, 315 + reasonType: const ReasonType.knownValue(data: KnownReasonType.comAtprotoModerationDefsReasonSpam), 316 + ); 317 + expect(result, isNull); 318 + }, 319 + expect: () => [isA<ProfileActionState>().having((s) => s.error, 'error', 'Failed to report post')], 320 + ); 321 + }); 322 + 323 + group('reportActor', () { 324 + blocTest<ProfileActionCubit, ProfileActionState>( 325 + 'returns report ID on success', 326 + build: () { 327 + when( 328 + () => mockRepository.reportActor( 329 + did: testActorDid, 330 + reasonType: any(named: 'reasonType'), 331 + reason: any(named: 'reason'), 332 + ), 333 + ).thenAnswer((_) async => 'report_456'); 334 + return ProfileActionCubit(profileActionRepository: mockRepository, actorDid: testActorDid); 335 + }, 336 + act: (cubit) async { 337 + final result = await cubit.reportActor( 338 + reasonType: const ReasonType.knownValue(data: KnownReasonType.comAtprotoModerationDefsReasonViolation), 339 + reason: 'Inappropriate content', 340 + ); 341 + expect(result, 'report_456'); 342 + }, 343 + ); 344 + 345 + blocTest<ProfileActionCubit, ProfileActionState>( 346 + 'returns null and emits error on failure', 347 + build: () { 348 + when( 349 + () => mockRepository.reportActor( 350 + did: testActorDid, 351 + reasonType: any(named: 'reasonType'), 352 + reason: any(named: 'reason'), 353 + ), 354 + ).thenThrow(Exception('Network error')); 355 + return ProfileActionCubit(profileActionRepository: mockRepository, actorDid: testActorDid); 356 + }, 357 + act: (cubit) async { 358 + final result = await cubit.reportActor( 359 + reasonType: const ReasonType.knownValue(data: KnownReasonType.comAtprotoModerationDefsReasonViolation), 360 + ); 361 + expect(result, isNull); 362 + }, 363 + expect: () => [isA<ProfileActionState>().having((s) => s.error, 'error', 'Failed to report user')], 364 + ); 365 + }); 366 + 367 + group('ProfileActionState', () { 368 + test('props includes all fields', () { 369 + const state1 = ProfileActionState( 370 + actorDid: testActorDid, 371 + isFollowing: true, 372 + isMuted: true, 373 + isBlocked: false, 374 + isBlockedBy: true, 375 + followUri: testFollowUri, 376 + blockUri: testBlockUri, 377 + isLoadingFollow: true, 378 + isLoadingMute: false, 379 + isLoadingBlock: true, 380 + error: 'test error', 381 + ); 382 + 383 + const state2 = ProfileActionState( 384 + actorDid: testActorDid, 385 + isFollowing: true, 386 + isMuted: true, 387 + isBlocked: false, 388 + isBlockedBy: true, 389 + followUri: testFollowUri, 390 + blockUri: testBlockUri, 391 + isLoadingFollow: true, 392 + isLoadingMute: false, 393 + isLoadingBlock: true, 394 + error: 'test error', 395 + ); 396 + 397 + expect(state1, equals(state2)); 398 + }); 399 + 400 + test('copyWith creates new instance with updated values', () { 401 + const state = ProfileActionState(actorDid: testActorDid, isFollowing: false); 402 + 403 + final copied = state.copyWith(isFollowing: true, followUri: testFollowUri); 404 + 405 + expect(copied.isFollowing, isTrue); 406 + expect(copied.followUri, testFollowUri); 407 + expect(copied.actorDid, testActorDid); 408 + }); 409 + }); 410 + }); 411 + }
+229
test/features/profile/data/profile_action_repository_test.dart
··· 1 + import 'package:flutter_test/flutter_test.dart'; 2 + import 'package:lazurite/features/profile/data/profile_action_repository.dart'; 3 + 4 + class MockProfileActionRepository implements ProfileActionRepository { 5 + final Map<String, String> _follows = {}; 6 + final Map<String, String> _blocks = {}; 7 + final Set<String> _mutes = {}; 8 + final List<Map<String, dynamic>> _reports = []; 9 + 10 + @override 11 + Future<String> followActor({required String did}) async { 12 + final followUri = 'at://did:plc:test/app.bsky.graph.follow/${did}_follow'; 13 + _follows[did] = followUri; 14 + return followUri; 15 + } 16 + 17 + @override 18 + Future<void> unfollowActor({required String followUri}) async { 19 + _follows.removeWhere((key, value) => value == followUri); 20 + } 21 + 22 + @override 23 + Future<void> muteActor({required String did}) async { 24 + _mutes.add(did); 25 + } 26 + 27 + @override 28 + Future<void> unmuteActor({required String did}) async { 29 + _mutes.remove(did); 30 + } 31 + 32 + @override 33 + Future<String> blockActor({required String did}) async { 34 + final blockUri = 'at://did:plc:test/app.bsky.graph.block/${did}_block'; 35 + _blocks[did] = blockUri; 36 + return blockUri; 37 + } 38 + 39 + @override 40 + Future<void> unblockActor({required String blockUri}) async { 41 + _blocks.removeWhere((key, value) => value == blockUri); 42 + } 43 + 44 + @override 45 + Future<String> reportPost({ 46 + required dynamic postUri, 47 + required String cid, 48 + required dynamic reasonType, 49 + String? reason, 50 + }) async { 51 + final reportId = 'report_${_reports.length}'; 52 + _reports.add({ 53 + 'id': reportId, 54 + 'type': 'post', 55 + 'uri': postUri.toString(), 56 + 'cid': cid, 57 + 'reasonType': reasonType.toString(), 58 + 'reason': reason, 59 + }); 60 + return reportId; 61 + } 62 + 63 + @override 64 + Future<String> reportActor({required String did, required dynamic reasonType, String? reason}) async { 65 + final reportId = 'report_${_reports.length}'; 66 + _reports.add({'id': reportId, 'type': 'actor', 'did': did, 'reasonType': reasonType.toString(), 'reason': reason}); 67 + return reportId; 68 + } 69 + 70 + bool isFollowing(String did) => _follows.containsKey(did); 71 + bool isBlocked(String did) => _blocks.containsKey(did); 72 + bool isMuted(String did) => _mutes.contains(did); 73 + String? getFollowUri(String did) => _follows[did]; 74 + String? getBlockUri(String did) => _blocks[did]; 75 + int get reportCount => _reports.length; 76 + } 77 + 78 + void main() { 79 + late MockProfileActionRepository repository; 80 + 81 + setUp(() { 82 + repository = MockProfileActionRepository(); 83 + }); 84 + 85 + const testDid = 'did:plc:testuser123'; 86 + const testPostUri = 'at://did:plc:other/app.bsky.feed.post/abc123'; 87 + const testCid = 'bafyreie5cvv4hhpwo4y6x4f4m6fsq3xrm5f3p5vzum5h5uv5x5x5x5x5x5'; 88 + 89 + group('ProfileActionRepository Contract', () { 90 + group('followActor', () { 91 + test('should return follow URI when successful', () async { 92 + final result = await repository.followActor(did: testDid); 93 + 94 + expect(result, isNotNull); 95 + expect(result, contains('app.bsky.graph.follow')); 96 + expect(repository.isFollowing(testDid), isTrue); 97 + }); 98 + 99 + test('should return different URIs for different actors', () async { 100 + const did1 = 'did:plc:user1'; 101 + const did2 = 'did:plc:user2'; 102 + 103 + final result1 = await repository.followActor(did: did1); 104 + final result2 = await repository.followActor(did: did2); 105 + 106 + expect(result1, isNot(equals(result2))); 107 + }); 108 + }); 109 + 110 + group('unfollowActor', () { 111 + test('should remove follow relationship', () async { 112 + final followUri = await repository.followActor(did: testDid); 113 + expect(repository.isFollowing(testDid), isTrue); 114 + 115 + await repository.unfollowActor(followUri: followUri); 116 + 117 + expect(repository.isFollowing(testDid), isFalse); 118 + }); 119 + }); 120 + 121 + group('muteActor', () { 122 + test('should mute actor', () async { 123 + expect(repository.isMuted(testDid), isFalse); 124 + 125 + await repository.muteActor(did: testDid); 126 + 127 + expect(repository.isMuted(testDid), isTrue); 128 + }); 129 + }); 130 + 131 + group('unmuteActor', () { 132 + test('should unmute actor', () async { 133 + await repository.muteActor(did: testDid); 134 + expect(repository.isMuted(testDid), isTrue); 135 + 136 + await repository.unmuteActor(did: testDid); 137 + 138 + expect(repository.isMuted(testDid), isFalse); 139 + }); 140 + }); 141 + 142 + group('blockActor', () { 143 + test('should return block URI when successful', () async { 144 + final result = await repository.blockActor(did: testDid); 145 + 146 + expect(result, isNotNull); 147 + expect(result, contains('app.bsky.graph.block')); 148 + expect(repository.isBlocked(testDid), isTrue); 149 + }); 150 + }); 151 + 152 + group('unblockActor', () { 153 + test('should remove block relationship', () async { 154 + final blockUri = await repository.blockActor(did: testDid); 155 + expect(repository.isBlocked(testDid), isTrue); 156 + 157 + await repository.unblockActor(blockUri: blockUri); 158 + 159 + expect(repository.isBlocked(testDid), isFalse); 160 + }); 161 + }); 162 + 163 + group('reportPost', () { 164 + test('should create post report and return report ID', () async { 165 + final reportId = await repository.reportPost(postUri: testPostUri, cid: testCid, reasonType: 'reasonSpam'); 166 + 167 + expect(reportId, isNotNull); 168 + expect(reportId, startsWith('report_')); 169 + expect(repository.reportCount, 1); 170 + }); 171 + 172 + test('should include reason in report', () async { 173 + await repository.reportPost( 174 + postUri: testPostUri, 175 + cid: testCid, 176 + reasonType: 'reasonOther', 177 + reason: 'This is inappropriate', 178 + ); 179 + 180 + expect(repository.reportCount, 1); 181 + }); 182 + }); 183 + 184 + group('reportActor', () { 185 + test('should create actor report and return report ID', () async { 186 + final reportId = await repository.reportActor(did: testDid, reasonType: 'reasonSpam'); 187 + 188 + expect(reportId, isNotNull); 189 + expect(reportId, startsWith('report_')); 190 + expect(repository.reportCount, 1); 191 + }); 192 + 193 + test('should include reason in actor report', () async { 194 + await repository.reportActor( 195 + did: testDid, 196 + reasonType: 'reasonViolation', 197 + reason: 'Violating community guidelines', 198 + ); 199 + 200 + expect(repository.reportCount, 1); 201 + }); 202 + }); 203 + 204 + group('action independence', () { 205 + test('follow and block should be independent', () async { 206 + expect(repository.isFollowing(testDid), isFalse); 207 + expect(repository.isBlocked(testDid), isFalse); 208 + 209 + await repository.followActor(did: testDid); 210 + expect(repository.isFollowing(testDid), isTrue); 211 + expect(repository.isBlocked(testDid), isFalse); 212 + 213 + await repository.blockActor(did: testDid); 214 + expect(repository.isFollowing(testDid), isTrue); 215 + expect(repository.isBlocked(testDid), isTrue); 216 + }); 217 + 218 + test('mute should not affect follow/block status', () async { 219 + await repository.followActor(did: testDid); 220 + expect(repository.isFollowing(testDid), isTrue); 221 + expect(repository.isMuted(testDid), isFalse); 222 + 223 + await repository.muteActor(did: testDid); 224 + expect(repository.isFollowing(testDid), isTrue); 225 + expect(repository.isMuted(testDid), isTrue); 226 + }); 227 + }); 228 + }); 229 + }