diff --git a/lib/database/drift_db.dart b/lib/database/drift_db.dart index 18330a4..d87c4c0 100644 --- a/lib/database/drift_db.dart +++ b/lib/database/drift_db.dart @@ -14,7 +14,7 @@ class AppDatabase extends _$AppDatabase { // Methods for chat messages Future> getMessagesForRoom( - int roomId, { + String roomId, { int offset = 0, int limit = 20, }) { diff --git a/lib/database/drift_db.g.dart b/lib/database/drift_db.g.dart index ab80f8e..feb1d11 100644 --- a/lib/database/drift_db.g.dart +++ b/lib/database/drift_db.g.dart @@ -20,11 +20,11 @@ class $ChatMessagesTable extends ChatMessages ); static const VerificationMeta _roomIdMeta = const VerificationMeta('roomId'); @override - late final GeneratedColumn roomId = GeneratedColumn( + late final GeneratedColumn roomId = GeneratedColumn( 'room_id', aliasedName, false, - type: DriftSqlType.int, + type: DriftSqlType.string, requiredDuringInsert: true, ); static const VerificationMeta _senderIdMeta = const VerificationMeta( @@ -175,7 +175,7 @@ class $ChatMessagesTable extends ChatMessages )!, roomId: attachedDatabase.typeMapping.read( - DriftSqlType.int, + DriftSqlType.string, data['${effectivePrefix}room_id'], )!, senderId: @@ -221,7 +221,7 @@ class $ChatMessagesTable extends ChatMessages class ChatMessage extends DataClass implements Insertable { final String id; - final int roomId; + final String roomId; final String senderId; final String? content; final String? nonce; @@ -242,7 +242,7 @@ class ChatMessage extends DataClass implements Insertable { Map toColumns(bool nullToAbsent) { final map = {}; map['id'] = Variable(id); - map['room_id'] = Variable(roomId); + map['room_id'] = Variable(roomId); map['sender_id'] = Variable(senderId); if (!nullToAbsent || content != null) { map['content'] = Variable(content); @@ -284,7 +284,7 @@ class ChatMessage extends DataClass implements Insertable { serializer ??= driftRuntimeOptions.defaultSerializer; return ChatMessage( id: serializer.fromJson(json['id']), - roomId: serializer.fromJson(json['roomId']), + roomId: serializer.fromJson(json['roomId']), senderId: serializer.fromJson(json['senderId']), content: serializer.fromJson(json['content']), nonce: serializer.fromJson(json['nonce']), @@ -300,7 +300,7 @@ class ChatMessage extends DataClass implements Insertable { serializer ??= driftRuntimeOptions.defaultSerializer; return { 'id': serializer.toJson(id), - 'roomId': serializer.toJson(roomId), + 'roomId': serializer.toJson(roomId), 'senderId': serializer.toJson(senderId), 'content': serializer.toJson(content), 'nonce': serializer.toJson(nonce), @@ -314,7 +314,7 @@ class ChatMessage extends DataClass implements Insertable { ChatMessage copyWith({ String? id, - int? roomId, + String? roomId, String? senderId, Value content = const Value.absent(), Value nonce = const Value.absent(), @@ -386,7 +386,7 @@ class ChatMessage extends DataClass implements Insertable { class ChatMessagesCompanion extends UpdateCompanion { final Value id; - final Value roomId; + final Value roomId; final Value senderId; final Value content; final Value nonce; @@ -407,7 +407,7 @@ class ChatMessagesCompanion extends UpdateCompanion { }); ChatMessagesCompanion.insert({ required String id, - required int roomId, + required String roomId, required String senderId, this.content = const Value.absent(), this.nonce = const Value.absent(), @@ -423,7 +423,7 @@ class ChatMessagesCompanion extends UpdateCompanion { status = Value(status); static Insertable custom({ Expression? id, - Expression? roomId, + Expression? roomId, Expression? senderId, Expression? content, Expression? nonce, @@ -447,7 +447,7 @@ class ChatMessagesCompanion extends UpdateCompanion { ChatMessagesCompanion copyWith({ Value? id, - Value? roomId, + Value? roomId, Value? senderId, Value? content, Value? nonce, @@ -476,7 +476,7 @@ class ChatMessagesCompanion extends UpdateCompanion { map['id'] = Variable(id.value); } if (roomId.present) { - map['room_id'] = Variable(roomId.value); + map['room_id'] = Variable(roomId.value); } if (senderId.present) { map['sender_id'] = Variable(senderId.value); @@ -535,7 +535,7 @@ abstract class _$AppDatabase extends GeneratedDatabase { typedef $$ChatMessagesTableCreateCompanionBuilder = ChatMessagesCompanion Function({ required String id, - required int roomId, + required String roomId, required String senderId, Value content, Value nonce, @@ -547,7 +547,7 @@ typedef $$ChatMessagesTableCreateCompanionBuilder = typedef $$ChatMessagesTableUpdateCompanionBuilder = ChatMessagesCompanion Function({ Value id, - Value roomId, + Value roomId, Value senderId, Value content, Value nonce, @@ -571,7 +571,7 @@ class $$ChatMessagesTableFilterComposer builder: (column) => ColumnFilters(column), ); - ColumnFilters get roomId => $composableBuilder( + ColumnFilters get roomId => $composableBuilder( column: $table.roomId, builder: (column) => ColumnFilters(column), ); @@ -622,7 +622,7 @@ class $$ChatMessagesTableOrderingComposer builder: (column) => ColumnOrderings(column), ); - ColumnOrderings get roomId => $composableBuilder( + ColumnOrderings get roomId => $composableBuilder( column: $table.roomId, builder: (column) => ColumnOrderings(column), ); @@ -670,7 +670,7 @@ class $$ChatMessagesTableAnnotationComposer GeneratedColumn get id => $composableBuilder(column: $table.id, builder: (column) => column); - GeneratedColumn get roomId => + GeneratedColumn get roomId => $composableBuilder(column: $table.roomId, builder: (column) => column); GeneratedColumn get senderId => @@ -725,7 +725,7 @@ class $$ChatMessagesTableTableManager updateCompanionCallback: ({ Value id = const Value.absent(), - Value roomId = const Value.absent(), + Value roomId = const Value.absent(), Value senderId = const Value.absent(), Value content = const Value.absent(), Value nonce = const Value.absent(), @@ -747,7 +747,7 @@ class $$ChatMessagesTableTableManager createCompanionCallback: ({ required String id, - required int roomId, + required String roomId, required String senderId, Value content = const Value.absent(), Value nonce = const Value.absent(), diff --git a/lib/database/message.dart b/lib/database/message.dart index 1b25ca4..7e10946 100644 --- a/lib/database/message.dart +++ b/lib/database/message.dart @@ -3,7 +3,7 @@ import 'package:island/models/chat.dart'; class ChatMessages extends Table { TextColumn get id => text()(); - IntColumn get roomId => integer()(); + TextColumn get roomId => text()(); TextColumn get senderId => text()(); TextColumn get content => text().nullable()(); TextColumn get nonce => text().nullable()(); @@ -17,7 +17,7 @@ class ChatMessages extends Table { class LocalChatMessage { final String id; - final int roomId; + final String roomId; final String senderId; final Map data; final DateTime createdAt; diff --git a/lib/database/message_repository.dart b/lib/database/message_repository.dart index 321bae9..75aa6b4 100644 --- a/lib/database/message_repository.dart +++ b/lib/database/message_repository.dart @@ -102,7 +102,7 @@ class MessageRepository { } Future> _getCachedMessages( - int roomId, { + String roomId, { int offset = 0, int take = 20, }) async { @@ -136,7 +136,7 @@ class MessageRepository { } Future> _fetchAndCacheMessages( - int roomId, { + String roomId, { int offset = 0, int take = 20, }) async { @@ -172,7 +172,7 @@ class MessageRepository { Future sendMessage( String atk, String baseUrl, - int roomId, + String roomId, String content, String nonce, { required List attachments, diff --git a/lib/models/activity.dart b/lib/models/activity.dart index d93a461..9b36e4d 100644 --- a/lib/models/activity.dart +++ b/lib/models/activity.dart @@ -11,7 +11,7 @@ abstract class SnActivity with _$SnActivity { required String type, required String resourceIdentifier, required int visibility, - required int accountId, + required String accountId, required SnAccount account, required dynamic data, required DateTime createdAt, @@ -29,7 +29,7 @@ abstract class SnCheckInResult with _$SnCheckInResult { required String id, required int level, required List tips, - required int accountId, + required String accountId, required SnAccount? account, required DateTime createdAt, required DateTime updatedAt, diff --git a/lib/models/activity.freezed.dart b/lib/models/activity.freezed.dart index 518a8f7..05400e0 100644 --- a/lib/models/activity.freezed.dart +++ b/lib/models/activity.freezed.dart @@ -16,7 +16,7 @@ T _$identity(T value) => value; /// @nodoc mixin _$SnActivity { - String get id; String get type; String get resourceIdentifier; int get visibility; int get accountId; SnAccount get account; dynamic get data; DateTime get createdAt; DateTime get updatedAt; dynamic get deletedAt; + String get id; String get type; String get resourceIdentifier; int get visibility; String get accountId; SnAccount get account; dynamic get data; DateTime get createdAt; DateTime get updatedAt; dynamic get deletedAt; /// Create a copy of SnActivity /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @@ -49,7 +49,7 @@ abstract mixin class $SnActivityCopyWith<$Res> { factory $SnActivityCopyWith(SnActivity value, $Res Function(SnActivity) _then) = _$SnActivityCopyWithImpl; @useResult $Res call({ - String id, String type, String resourceIdentifier, int visibility, int accountId, SnAccount account, dynamic data, DateTime createdAt, DateTime updatedAt, dynamic deletedAt + String id, String type, String resourceIdentifier, int visibility, String accountId, SnAccount account, dynamic data, DateTime createdAt, DateTime updatedAt, dynamic deletedAt }); @@ -73,7 +73,7 @@ as String,type: null == type ? _self.type : type // ignore: cast_nullable_to_non as String,resourceIdentifier: null == resourceIdentifier ? _self.resourceIdentifier : resourceIdentifier // ignore: cast_nullable_to_non_nullable as String,visibility: null == visibility ? _self.visibility : visibility // ignore: cast_nullable_to_non_nullable as int,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable -as int,account: null == account ? _self.account : account // ignore: cast_nullable_to_non_nullable +as String,account: null == account ? _self.account : account // ignore: cast_nullable_to_non_nullable as SnAccount,data: freezed == data ? _self.data : data // ignore: cast_nullable_to_non_nullable as dynamic,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable @@ -105,7 +105,7 @@ class _SnActivity implements SnActivity { @override final String type; @override final String resourceIdentifier; @override final int visibility; -@override final int accountId; +@override final String accountId; @override final SnAccount account; @override final dynamic data; @override final DateTime createdAt; @@ -145,7 +145,7 @@ abstract mixin class _$SnActivityCopyWith<$Res> implements $SnActivityCopyWith<$ factory _$SnActivityCopyWith(_SnActivity value, $Res Function(_SnActivity) _then) = __$SnActivityCopyWithImpl; @override @useResult $Res call({ - String id, String type, String resourceIdentifier, int visibility, int accountId, SnAccount account, dynamic data, DateTime createdAt, DateTime updatedAt, dynamic deletedAt + String id, String type, String resourceIdentifier, int visibility, String accountId, SnAccount account, dynamic data, DateTime createdAt, DateTime updatedAt, dynamic deletedAt }); @@ -169,7 +169,7 @@ as String,type: null == type ? _self.type : type // ignore: cast_nullable_to_non as String,resourceIdentifier: null == resourceIdentifier ? _self.resourceIdentifier : resourceIdentifier // ignore: cast_nullable_to_non_nullable as String,visibility: null == visibility ? _self.visibility : visibility // ignore: cast_nullable_to_non_nullable as int,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable -as int,account: null == account ? _self.account : account // ignore: cast_nullable_to_non_nullable +as String,account: null == account ? _self.account : account // ignore: cast_nullable_to_non_nullable as SnAccount,data: freezed == data ? _self.data : data // ignore: cast_nullable_to_non_nullable as dynamic,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable @@ -194,7 +194,7 @@ $SnAccountCopyWith<$Res> get account { /// @nodoc mixin _$SnCheckInResult { - String get id; int get level; List get tips; int get accountId; SnAccount? get account; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; + String get id; int get level; List get tips; String get accountId; SnAccount? get account; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; /// Create a copy of SnCheckInResult /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @@ -227,7 +227,7 @@ abstract mixin class $SnCheckInResultCopyWith<$Res> { factory $SnCheckInResultCopyWith(SnCheckInResult value, $Res Function(SnCheckInResult) _then) = _$SnCheckInResultCopyWithImpl; @useResult $Res call({ - String id, int level, List tips, int accountId, SnAccount? account, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt + String id, int level, List tips, String accountId, SnAccount? account, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt }); @@ -250,7 +250,7 @@ id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable as String,level: null == level ? _self.level : level // ignore: cast_nullable_to_non_nullable as int,tips: null == tips ? _self.tips : tips // ignore: cast_nullable_to_non_nullable as List,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable -as int,account: freezed == account ? _self.account : account // ignore: cast_nullable_to_non_nullable +as String,account: freezed == account ? _self.account : account // ignore: cast_nullable_to_non_nullable as SnAccount?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable as DateTime,deletedAt: freezed == deletedAt ? _self.deletedAt : deletedAt // ignore: cast_nullable_to_non_nullable @@ -289,7 +289,7 @@ class _SnCheckInResult implements SnCheckInResult { return EqualUnmodifiableListView(_tips); } -@override final int accountId; +@override final String accountId; @override final SnAccount? account; @override final DateTime createdAt; @override final DateTime updatedAt; @@ -328,7 +328,7 @@ abstract mixin class _$SnCheckInResultCopyWith<$Res> implements $SnCheckInResult factory _$SnCheckInResultCopyWith(_SnCheckInResult value, $Res Function(_SnCheckInResult) _then) = __$SnCheckInResultCopyWithImpl; @override @useResult $Res call({ - String id, int level, List tips, int accountId, SnAccount? account, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt + String id, int level, List tips, String accountId, SnAccount? account, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt }); @@ -351,7 +351,7 @@ id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable as String,level: null == level ? _self.level : level // ignore: cast_nullable_to_non_nullable as int,tips: null == tips ? _self._tips : tips // ignore: cast_nullable_to_non_nullable as List,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable -as int,account: freezed == account ? _self.account : account // ignore: cast_nullable_to_non_nullable +as String,account: freezed == account ? _self.account : account // ignore: cast_nullable_to_non_nullable as SnAccount?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable as DateTime,deletedAt: freezed == deletedAt ? _self.deletedAt : deletedAt // ignore: cast_nullable_to_non_nullable diff --git a/lib/models/activity.g.dart b/lib/models/activity.g.dart index 82d69df..ebb056d 100644 --- a/lib/models/activity.g.dart +++ b/lib/models/activity.g.dart @@ -11,7 +11,7 @@ _SnActivity _$SnActivityFromJson(Map json) => _SnActivity( type: json['type'] as String, resourceIdentifier: json['resource_identifier'] as String, visibility: (json['visibility'] as num).toInt(), - accountId: (json['account_id'] as num).toInt(), + accountId: json['account_id'] as String, account: SnAccount.fromJson(json['account'] as Map), data: json['data'], createdAt: DateTime.parse(json['created_at'] as String), @@ -41,7 +41,7 @@ _SnCheckInResult _$SnCheckInResultFromJson(Map json) => (json['tips'] as List) .map((e) => SnFortuneTip.fromJson(e as Map)) .toList(), - accountId: (json['account_id'] as num).toInt(), + accountId: json['account_id'] as String, account: json['account'] == null ? null diff --git a/lib/models/auth.dart b/lib/models/auth.dart index 805dbe8..84d35f9 100644 --- a/lib/models/auth.dart +++ b/lib/models/auth.dart @@ -40,7 +40,7 @@ abstract class SnAuthChallenge with _$SnAuthChallenge { @freezed abstract class SnAuthFactor with _$SnAuthFactor { const factory SnAuthFactor({ - required int id, + required String id, required int type, required DateTime createdAt, required DateTime updatedAt, diff --git a/lib/models/auth.freezed.dart b/lib/models/auth.freezed.dart index 86721f2..d77304d 100644 --- a/lib/models/auth.freezed.dart +++ b/lib/models/auth.freezed.dart @@ -342,7 +342,7 @@ as DateTime?, /// @nodoc mixin _$SnAuthFactor { - int get id; int get type; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; + String get id; int get type; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; /// Create a copy of SnAuthFactor /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @@ -375,7 +375,7 @@ abstract mixin class $SnAuthFactorCopyWith<$Res> { factory $SnAuthFactorCopyWith(SnAuthFactor value, $Res Function(SnAuthFactor) _then) = _$SnAuthFactorCopyWithImpl; @useResult $Res call({ - int id, int type, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt + String id, int type, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt }); @@ -395,7 +395,7 @@ class _$SnAuthFactorCopyWithImpl<$Res> @pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? type = null,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,}) { return _then(_self.copyWith( id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as int,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as String,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable as int,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable as DateTime,deletedAt: freezed == deletedAt ? _self.deletedAt : deletedAt // ignore: cast_nullable_to_non_nullable @@ -413,7 +413,7 @@ class _SnAuthFactor implements SnAuthFactor { const _SnAuthFactor({required this.id, required this.type, required this.createdAt, required this.updatedAt, required this.deletedAt}); factory _SnAuthFactor.fromJson(Map json) => _$SnAuthFactorFromJson(json); -@override final int id; +@override final String id; @override final int type; @override final DateTime createdAt; @override final DateTime updatedAt; @@ -452,7 +452,7 @@ abstract mixin class _$SnAuthFactorCopyWith<$Res> implements $SnAuthFactorCopyWi factory _$SnAuthFactorCopyWith(_SnAuthFactor value, $Res Function(_SnAuthFactor) _then) = __$SnAuthFactorCopyWithImpl; @override @useResult $Res call({ - int id, int type, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt + String id, int type, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt }); @@ -472,7 +472,7 @@ class __$SnAuthFactorCopyWithImpl<$Res> @override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? type = null,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,}) { return _then(_SnAuthFactor( id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as int,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable +as String,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable as int,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable as DateTime,deletedAt: freezed == deletedAt ? _self.deletedAt : deletedAt // ignore: cast_nullable_to_non_nullable diff --git a/lib/models/auth.g.dart b/lib/models/auth.g.dart index 4231e7f..cdeeac8 100644 --- a/lib/models/auth.g.dart +++ b/lib/models/auth.g.dart @@ -64,7 +64,7 @@ Map _$SnAuthChallengeToJson(_SnAuthChallenge instance) => _SnAuthFactor _$SnAuthFactorFromJson(Map json) => _SnAuthFactor( - id: (json['id'] as num).toInt(), + id: json['id'] as String, type: (json['type'] as num).toInt(), createdAt: DateTime.parse(json['created_at'] as String), updatedAt: DateTime.parse(json['updated_at'] as String), diff --git a/lib/models/chat.dart b/lib/models/chat.dart index 139678f..621df2d 100644 --- a/lib/models/chat.dart +++ b/lib/models/chat.dart @@ -9,7 +9,7 @@ part 'chat.g.dart'; @freezed abstract class SnChatRoom with _$SnChatRoom { const factory SnChatRoom({ - required int id, + required String id, required String name, required String description, required int type, @@ -18,7 +18,7 @@ abstract class SnChatRoom with _$SnChatRoom { required SnCloudFile? picture, required String? backgroundId, required SnCloudFile? background, - required int? realmId, + required String? realmId, required SnRealm? realm, required DateTime createdAt, required DateTime updatedAt, @@ -48,7 +48,7 @@ abstract class SnChatMessage with _$SnChatMessage { String? forwardedMessageId, required String senderId, required SnChatMember sender, - required int chatRoomId, + required String chatRoomId, }) = _SnChatMessage; factory SnChatMessage.fromJson(Map json) => @@ -80,9 +80,9 @@ abstract class SnChatMember with _$SnChatMember { required DateTime updatedAt, required DateTime? deletedAt, required String id, - required int chatRoomId, + required String chatRoomId, required SnChatRoom? chatRoom, - required int accountId, + required String accountId, required SnAccount account, required String? nick, required int role, diff --git a/lib/models/chat.freezed.dart b/lib/models/chat.freezed.dart index 64f719a..1cf5137 100644 --- a/lib/models/chat.freezed.dart +++ b/lib/models/chat.freezed.dart @@ -16,7 +16,7 @@ T _$identity(T value) => value; /// @nodoc mixin _$SnChatRoom { - int get id; String get name; String get description; int get type; bool get isPublic; String? get pictureId; SnCloudFile? get picture; String? get backgroundId; SnCloudFile? get background; int? get realmId; SnRealm? get realm; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; List? get members; + String get id; String get name; String get description; int get type; bool get isPublic; String? get pictureId; SnCloudFile? get picture; String? get backgroundId; SnCloudFile? get background; String? get realmId; SnRealm? get realm; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; List? get members; /// Create a copy of SnChatRoom /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @@ -49,7 +49,7 @@ abstract mixin class $SnChatRoomCopyWith<$Res> { factory $SnChatRoomCopyWith(SnChatRoom value, $Res Function(SnChatRoom) _then) = _$SnChatRoomCopyWithImpl; @useResult $Res call({ - int id, String name, String description, int type, bool isPublic, String? pictureId, SnCloudFile? picture, String? backgroundId, SnCloudFile? background, int? realmId, SnRealm? realm, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, List? members + String id, String name, String description, int type, bool isPublic, String? pictureId, SnCloudFile? picture, String? backgroundId, SnCloudFile? background, String? realmId, SnRealm? realm, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, List? members }); @@ -69,7 +69,7 @@ class _$SnChatRoomCopyWithImpl<$Res> @pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? name = null,Object? description = null,Object? type = null,Object? isPublic = null,Object? pictureId = freezed,Object? picture = freezed,Object? backgroundId = freezed,Object? background = freezed,Object? realmId = freezed,Object? realm = freezed,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,Object? members = freezed,}) { return _then(_self.copyWith( id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as int,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable as String,description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable as String,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable as int,isPublic: null == isPublic ? _self.isPublic : isPublic // ignore: cast_nullable_to_non_nullable @@ -78,7 +78,7 @@ as String?,picture: freezed == picture ? _self.picture : picture // ignore: cast as SnCloudFile?,backgroundId: freezed == backgroundId ? _self.backgroundId : backgroundId // ignore: cast_nullable_to_non_nullable as String?,background: freezed == background ? _self.background : background // ignore: cast_nullable_to_non_nullable as SnCloudFile?,realmId: freezed == realmId ? _self.realmId : realmId // ignore: cast_nullable_to_non_nullable -as int?,realm: freezed == realm ? _self.realm : realm // ignore: cast_nullable_to_non_nullable +as String?,realm: freezed == realm ? _self.realm : realm // ignore: cast_nullable_to_non_nullable as SnRealm?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable as DateTime,deletedAt: freezed == deletedAt ? _self.deletedAt : deletedAt // ignore: cast_nullable_to_non_nullable @@ -133,7 +133,7 @@ class _SnChatRoom implements SnChatRoom { const _SnChatRoom({required this.id, required this.name, required this.description, required this.type, required this.isPublic, required this.pictureId, required this.picture, required this.backgroundId, required this.background, required this.realmId, required this.realm, required this.createdAt, required this.updatedAt, required this.deletedAt, required final List? members}): _members = members; factory _SnChatRoom.fromJson(Map json) => _$SnChatRoomFromJson(json); -@override final int id; +@override final String id; @override final String name; @override final String description; @override final int type; @@ -142,7 +142,7 @@ class _SnChatRoom implements SnChatRoom { @override final SnCloudFile? picture; @override final String? backgroundId; @override final SnCloudFile? background; -@override final int? realmId; +@override final String? realmId; @override final SnRealm? realm; @override final DateTime createdAt; @override final DateTime updatedAt; @@ -190,7 +190,7 @@ abstract mixin class _$SnChatRoomCopyWith<$Res> implements $SnChatRoomCopyWith<$ factory _$SnChatRoomCopyWith(_SnChatRoom value, $Res Function(_SnChatRoom) _then) = __$SnChatRoomCopyWithImpl; @override @useResult $Res call({ - int id, String name, String description, int type, bool isPublic, String? pictureId, SnCloudFile? picture, String? backgroundId, SnCloudFile? background, int? realmId, SnRealm? realm, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, List? members + String id, String name, String description, int type, bool isPublic, String? pictureId, SnCloudFile? picture, String? backgroundId, SnCloudFile? background, String? realmId, SnRealm? realm, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, List? members }); @@ -210,7 +210,7 @@ class __$SnChatRoomCopyWithImpl<$Res> @override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? name = null,Object? description = null,Object? type = null,Object? isPublic = null,Object? pictureId = freezed,Object? picture = freezed,Object? backgroundId = freezed,Object? background = freezed,Object? realmId = freezed,Object? realm = freezed,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,Object? members = freezed,}) { return _then(_SnChatRoom( id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as int,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable as String,description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable as String,type: null == type ? _self.type : type // ignore: cast_nullable_to_non_nullable as int,isPublic: null == isPublic ? _self.isPublic : isPublic // ignore: cast_nullable_to_non_nullable @@ -219,7 +219,7 @@ as String?,picture: freezed == picture ? _self.picture : picture // ignore: cast as SnCloudFile?,backgroundId: freezed == backgroundId ? _self.backgroundId : backgroundId // ignore: cast_nullable_to_non_nullable as String?,background: freezed == background ? _self.background : background // ignore: cast_nullable_to_non_nullable as SnCloudFile?,realmId: freezed == realmId ? _self.realmId : realmId // ignore: cast_nullable_to_non_nullable -as int?,realm: freezed == realm ? _self.realm : realm // ignore: cast_nullable_to_non_nullable +as String?,realm: freezed == realm ? _self.realm : realm // ignore: cast_nullable_to_non_nullable as SnRealm?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable as DateTime,deletedAt: freezed == deletedAt ? _self.deletedAt : deletedAt // ignore: cast_nullable_to_non_nullable @@ -271,7 +271,7 @@ $SnRealmCopyWith<$Res>? get realm { /// @nodoc mixin _$SnChatMessage { - DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; String get id; String? get content; String? get nonce; Map get meta; List get membersMetioned; DateTime? get editedAt; List get attachments; List get reactions; String? get repliedMessageId; String? get forwardedMessageId; String get senderId; SnChatMember get sender; int get chatRoomId; + DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; String get id; String? get content; String? get nonce; Map get meta; List get membersMetioned; DateTime? get editedAt; List get attachments; List get reactions; String? get repliedMessageId; String? get forwardedMessageId; String get senderId; SnChatMember get sender; String get chatRoomId; /// Create a copy of SnChatMessage /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @@ -304,7 +304,7 @@ abstract mixin class $SnChatMessageCopyWith<$Res> { factory $SnChatMessageCopyWith(SnChatMessage value, $Res Function(SnChatMessage) _then) = _$SnChatMessageCopyWithImpl; @useResult $Res call({ - DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, String id, String? content, String? nonce, Map meta, List membersMetioned, DateTime? editedAt, List attachments, List reactions, String? repliedMessageId, String? forwardedMessageId, String senderId, SnChatMember sender, int chatRoomId + DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, String id, String? content, String? nonce, Map meta, List membersMetioned, DateTime? editedAt, List attachments, List reactions, String? repliedMessageId, String? forwardedMessageId, String senderId, SnChatMember sender, String chatRoomId }); @@ -339,7 +339,7 @@ as String?,forwardedMessageId: freezed == forwardedMessageId ? _self.forwardedMe as String?,senderId: null == senderId ? _self.senderId : senderId // ignore: cast_nullable_to_non_nullable as String,sender: null == sender ? _self.sender : sender // ignore: cast_nullable_to_non_nullable as SnChatMember,chatRoomId: null == chatRoomId ? _self.chatRoomId : chatRoomId // ignore: cast_nullable_to_non_nullable -as int, +as String, )); } /// Create a copy of SnChatMessage @@ -401,7 +401,7 @@ class _SnChatMessage implements SnChatMessage { @override final String? forwardedMessageId; @override final String senderId; @override final SnChatMember sender; -@override final int chatRoomId; +@override final String chatRoomId; /// Create a copy of SnChatMessage /// with the given fields replaced by the non-null parameter values. @@ -436,7 +436,7 @@ abstract mixin class _$SnChatMessageCopyWith<$Res> implements $SnChatMessageCopy factory _$SnChatMessageCopyWith(_SnChatMessage value, $Res Function(_SnChatMessage) _then) = __$SnChatMessageCopyWithImpl; @override @useResult $Res call({ - DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, String id, String? content, String? nonce, Map meta, List membersMetioned, DateTime? editedAt, List attachments, List reactions, String? repliedMessageId, String? forwardedMessageId, String senderId, SnChatMember sender, int chatRoomId + DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, String id, String? content, String? nonce, Map meta, List membersMetioned, DateTime? editedAt, List attachments, List reactions, String? repliedMessageId, String? forwardedMessageId, String senderId, SnChatMember sender, String chatRoomId }); @@ -471,7 +471,7 @@ as String?,forwardedMessageId: freezed == forwardedMessageId ? _self.forwardedMe as String?,senderId: null == senderId ? _self.senderId : senderId // ignore: cast_nullable_to_non_nullable as String,sender: null == sender ? _self.sender : sender // ignore: cast_nullable_to_non_nullable as SnChatMember,chatRoomId: null == chatRoomId ? _self.chatRoomId : chatRoomId // ignore: cast_nullable_to_non_nullable -as int, +as String, )); } @@ -666,7 +666,7 @@ $SnChatMemberCopyWith<$Res> get sender { /// @nodoc mixin _$SnChatMember { - DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; String get id; int get chatRoomId; SnChatRoom? get chatRoom; int get accountId; SnAccount get account; String? get nick; int get role; int get notify; DateTime? get joinedAt; bool get isBot; + DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; String get id; String get chatRoomId; SnChatRoom? get chatRoom; String get accountId; SnAccount get account; String? get nick; int get role; int get notify; DateTime? get joinedAt; bool get isBot; /// Create a copy of SnChatMember /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @@ -699,7 +699,7 @@ abstract mixin class $SnChatMemberCopyWith<$Res> { factory $SnChatMemberCopyWith(SnChatMember value, $Res Function(SnChatMember) _then) = _$SnChatMemberCopyWithImpl; @useResult $Res call({ - DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, String id, int chatRoomId, SnChatRoom? chatRoom, int accountId, SnAccount account, String? nick, int role, int notify, DateTime? joinedAt, bool isBot + DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, String id, String chatRoomId, SnChatRoom? chatRoom, String accountId, SnAccount account, String? nick, int role, int notify, DateTime? joinedAt, bool isBot }); @@ -723,9 +723,9 @@ as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore as DateTime,deletedAt: freezed == deletedAt ? _self.deletedAt : deletedAt // ignore: cast_nullable_to_non_nullable as DateTime?,id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable as String,chatRoomId: null == chatRoomId ? _self.chatRoomId : chatRoomId // ignore: cast_nullable_to_non_nullable -as int,chatRoom: freezed == chatRoom ? _self.chatRoom : chatRoom // ignore: cast_nullable_to_non_nullable +as String,chatRoom: freezed == chatRoom ? _self.chatRoom : chatRoom // ignore: cast_nullable_to_non_nullable as SnChatRoom?,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable -as int,account: null == account ? _self.account : account // ignore: cast_nullable_to_non_nullable +as String,account: null == account ? _self.account : account // ignore: cast_nullable_to_non_nullable as SnAccount,nick: freezed == nick ? _self.nick : nick // ignore: cast_nullable_to_non_nullable as String?,role: null == role ? _self.role : role // ignore: cast_nullable_to_non_nullable as int,notify: null == notify ? _self.notify : notify // ignore: cast_nullable_to_non_nullable @@ -770,9 +770,9 @@ class _SnChatMember implements SnChatMember { @override final DateTime updatedAt; @override final DateTime? deletedAt; @override final String id; -@override final int chatRoomId; +@override final String chatRoomId; @override final SnChatRoom? chatRoom; -@override final int accountId; +@override final String accountId; @override final SnAccount account; @override final String? nick; @override final int role; @@ -813,7 +813,7 @@ abstract mixin class _$SnChatMemberCopyWith<$Res> implements $SnChatMemberCopyWi factory _$SnChatMemberCopyWith(_SnChatMember value, $Res Function(_SnChatMember) _then) = __$SnChatMemberCopyWithImpl; @override @useResult $Res call({ - DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, String id, int chatRoomId, SnChatRoom? chatRoom, int accountId, SnAccount account, String? nick, int role, int notify, DateTime? joinedAt, bool isBot + DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, String id, String chatRoomId, SnChatRoom? chatRoom, String accountId, SnAccount account, String? nick, int role, int notify, DateTime? joinedAt, bool isBot }); @@ -837,9 +837,9 @@ as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore as DateTime,deletedAt: freezed == deletedAt ? _self.deletedAt : deletedAt // ignore: cast_nullable_to_non_nullable as DateTime?,id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable as String,chatRoomId: null == chatRoomId ? _self.chatRoomId : chatRoomId // ignore: cast_nullable_to_non_nullable -as int,chatRoom: freezed == chatRoom ? _self.chatRoom : chatRoom // ignore: cast_nullable_to_non_nullable +as String,chatRoom: freezed == chatRoom ? _self.chatRoom : chatRoom // ignore: cast_nullable_to_non_nullable as SnChatRoom?,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable -as int,account: null == account ? _self.account : account // ignore: cast_nullable_to_non_nullable +as String,account: null == account ? _self.account : account // ignore: cast_nullable_to_non_nullable as SnAccount,nick: freezed == nick ? _self.nick : nick // ignore: cast_nullable_to_non_nullable as String?,role: null == role ? _self.role : role // ignore: cast_nullable_to_non_nullable as int,notify: null == notify ? _self.notify : notify // ignore: cast_nullable_to_non_nullable diff --git a/lib/models/chat.g.dart b/lib/models/chat.g.dart index 2dc61b0..cf559b0 100644 --- a/lib/models/chat.g.dart +++ b/lib/models/chat.g.dart @@ -7,7 +7,7 @@ part of 'chat.dart'; // ************************************************************************** _SnChatRoom _$SnChatRoomFromJson(Map json) => _SnChatRoom( - id: (json['id'] as num).toInt(), + id: json['id'] as String, name: json['name'] as String, description: json['description'] as String, type: (json['type'] as num).toInt(), @@ -22,7 +22,7 @@ _SnChatRoom _$SnChatRoomFromJson(Map json) => _SnChatRoom( json['background'] == null ? null : SnCloudFile.fromJson(json['background'] as Map), - realmId: (json['realm_id'] as num?)?.toInt(), + realmId: json['realm_id'] as String?, realm: json['realm'] == null ? null @@ -93,7 +93,7 @@ _SnChatMessage _$SnChatMessageFromJson(Map json) => forwardedMessageId: json['forwarded_message_id'] as String?, senderId: json['sender_id'] as String, sender: SnChatMember.fromJson(json['sender'] as Map), - chatRoomId: (json['chat_room_id'] as num).toInt(), + chatRoomId: json['chat_room_id'] as String, ); Map _$SnChatMessageToJson(_SnChatMessage instance) => @@ -154,12 +154,12 @@ _SnChatMember _$SnChatMemberFromJson(Map json) => ? null : DateTime.parse(json['deleted_at'] as String), id: json['id'] as String, - chatRoomId: (json['chat_room_id'] as num).toInt(), + chatRoomId: json['chat_room_id'] as String, chatRoom: json['chat_room'] == null ? null : SnChatRoom.fromJson(json['chat_room'] as Map), - accountId: (json['account_id'] as num).toInt(), + accountId: json['account_id'] as String, account: SnAccount.fromJson(json['account'] as Map), nick: json['nick'] as String?, role: (json['role'] as num).toInt(), diff --git a/lib/models/post.dart b/lib/models/post.dart index cffe712..16270a6 100644 --- a/lib/models/post.dart +++ b/lib/models/post.dart @@ -7,7 +7,7 @@ part 'post.g.dart'; @freezed abstract class SnPost with _$SnPost { const factory SnPost({ - required int id, + required String id, required String? title, required String? description, required String? language, @@ -21,12 +21,12 @@ abstract class SnPost with _$SnPost { required int viewsTotal, required int upvotes, required int downvotes, - required dynamic threadedPostId, - required dynamic threadedPost, - required dynamic repliedPostId, - required dynamic repliedPost, - required dynamic forwardedPostId, - required dynamic forwardedPost, + required String? threadedPostId, + required SnPost? threadedPost, + required String? repliedPostId, + required SnPost? repliedPost, + required String? forwardedPostId, + required SnPost? forwardedPost, required List attachments, required SnPublisher publisher, @Default({}) Map reactionsCount, @@ -45,7 +45,7 @@ abstract class SnPost with _$SnPost { @freezed abstract class SnPublisher with _$SnPublisher { const factory SnPublisher({ - required int id, + required String id, required int publisherType, required String name, required String nick, @@ -54,7 +54,7 @@ abstract class SnPublisher with _$SnPublisher { required SnCloudFile? picture, required String? backgroundId, required SnCloudFile? background, - required int accountId, + required String? accountId, required DateTime createdAt, required DateTime updatedAt, required DateTime? deletedAt, diff --git a/lib/models/post.freezed.dart b/lib/models/post.freezed.dart index d4e41ff..0f16088 100644 --- a/lib/models/post.freezed.dart +++ b/lib/models/post.freezed.dart @@ -16,7 +16,7 @@ T _$identity(T value) => value; /// @nodoc mixin _$SnPost { - int get id; String? get title; String? get description; String? get language; DateTime? get editedAt; DateTime get publishedAt; int get visibility; String? get content; int get type; Map? get meta; int get viewsUnique; int get viewsTotal; int get upvotes; int get downvotes; dynamic get threadedPostId; dynamic get threadedPost; dynamic get repliedPostId; dynamic get repliedPost; dynamic get forwardedPostId; dynamic get forwardedPost; List get attachments; SnPublisher get publisher; Map get reactionsCount; List get reactions; List get tags; List get categories; List get collections; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; + String get id; String? get title; String? get description; String? get language; DateTime? get editedAt; DateTime get publishedAt; int get visibility; String? get content; int get type; Map? get meta; int get viewsUnique; int get viewsTotal; int get upvotes; int get downvotes; String? get threadedPostId; SnPost? get threadedPost; String? get repliedPostId; SnPost? get repliedPost; String? get forwardedPostId; SnPost? get forwardedPost; List get attachments; SnPublisher get publisher; Map get reactionsCount; List get reactions; List get tags; List get categories; List get collections; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; /// Create a copy of SnPost /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @@ -29,12 +29,12 @@ $SnPostCopyWith get copyWith => _$SnPostCopyWithImpl(this as SnP @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is SnPost&&(identical(other.id, id) || other.id == id)&&(identical(other.title, title) || other.title == title)&&(identical(other.description, description) || other.description == description)&&(identical(other.language, language) || other.language == language)&&(identical(other.editedAt, editedAt) || other.editedAt == editedAt)&&(identical(other.publishedAt, publishedAt) || other.publishedAt == publishedAt)&&(identical(other.visibility, visibility) || other.visibility == visibility)&&(identical(other.content, content) || other.content == content)&&(identical(other.type, type) || other.type == type)&&const DeepCollectionEquality().equals(other.meta, meta)&&(identical(other.viewsUnique, viewsUnique) || other.viewsUnique == viewsUnique)&&(identical(other.viewsTotal, viewsTotal) || other.viewsTotal == viewsTotal)&&(identical(other.upvotes, upvotes) || other.upvotes == upvotes)&&(identical(other.downvotes, downvotes) || other.downvotes == downvotes)&&const DeepCollectionEquality().equals(other.threadedPostId, threadedPostId)&&const DeepCollectionEquality().equals(other.threadedPost, threadedPost)&&const DeepCollectionEquality().equals(other.repliedPostId, repliedPostId)&&const DeepCollectionEquality().equals(other.repliedPost, repliedPost)&&const DeepCollectionEquality().equals(other.forwardedPostId, forwardedPostId)&&const DeepCollectionEquality().equals(other.forwardedPost, forwardedPost)&&const DeepCollectionEquality().equals(other.attachments, attachments)&&(identical(other.publisher, publisher) || other.publisher == publisher)&&const DeepCollectionEquality().equals(other.reactionsCount, reactionsCount)&&const DeepCollectionEquality().equals(other.reactions, reactions)&&const DeepCollectionEquality().equals(other.tags, tags)&&const DeepCollectionEquality().equals(other.categories, categories)&&const DeepCollectionEquality().equals(other.collections, collections)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt)); + return identical(this, other) || (other.runtimeType == runtimeType&&other is SnPost&&(identical(other.id, id) || other.id == id)&&(identical(other.title, title) || other.title == title)&&(identical(other.description, description) || other.description == description)&&(identical(other.language, language) || other.language == language)&&(identical(other.editedAt, editedAt) || other.editedAt == editedAt)&&(identical(other.publishedAt, publishedAt) || other.publishedAt == publishedAt)&&(identical(other.visibility, visibility) || other.visibility == visibility)&&(identical(other.content, content) || other.content == content)&&(identical(other.type, type) || other.type == type)&&const DeepCollectionEquality().equals(other.meta, meta)&&(identical(other.viewsUnique, viewsUnique) || other.viewsUnique == viewsUnique)&&(identical(other.viewsTotal, viewsTotal) || other.viewsTotal == viewsTotal)&&(identical(other.upvotes, upvotes) || other.upvotes == upvotes)&&(identical(other.downvotes, downvotes) || other.downvotes == downvotes)&&(identical(other.threadedPostId, threadedPostId) || other.threadedPostId == threadedPostId)&&(identical(other.threadedPost, threadedPost) || other.threadedPost == threadedPost)&&(identical(other.repliedPostId, repliedPostId) || other.repliedPostId == repliedPostId)&&(identical(other.repliedPost, repliedPost) || other.repliedPost == repliedPost)&&(identical(other.forwardedPostId, forwardedPostId) || other.forwardedPostId == forwardedPostId)&&(identical(other.forwardedPost, forwardedPost) || other.forwardedPost == forwardedPost)&&const DeepCollectionEquality().equals(other.attachments, attachments)&&(identical(other.publisher, publisher) || other.publisher == publisher)&&const DeepCollectionEquality().equals(other.reactionsCount, reactionsCount)&&const DeepCollectionEquality().equals(other.reactions, reactions)&&const DeepCollectionEquality().equals(other.tags, tags)&&const DeepCollectionEquality().equals(other.categories, categories)&&const DeepCollectionEquality().equals(other.collections, collections)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt)); } @JsonKey(includeFromJson: false, includeToJson: false) @override -int get hashCode => Object.hashAll([runtimeType,id,title,description,language,editedAt,publishedAt,visibility,content,type,const DeepCollectionEquality().hash(meta),viewsUnique,viewsTotal,upvotes,downvotes,const DeepCollectionEquality().hash(threadedPostId),const DeepCollectionEquality().hash(threadedPost),const DeepCollectionEquality().hash(repliedPostId),const DeepCollectionEquality().hash(repliedPost),const DeepCollectionEquality().hash(forwardedPostId),const DeepCollectionEquality().hash(forwardedPost),const DeepCollectionEquality().hash(attachments),publisher,const DeepCollectionEquality().hash(reactionsCount),const DeepCollectionEquality().hash(reactions),const DeepCollectionEquality().hash(tags),const DeepCollectionEquality().hash(categories),const DeepCollectionEquality().hash(collections),createdAt,updatedAt,deletedAt]); +int get hashCode => Object.hashAll([runtimeType,id,title,description,language,editedAt,publishedAt,visibility,content,type,const DeepCollectionEquality().hash(meta),viewsUnique,viewsTotal,upvotes,downvotes,threadedPostId,threadedPost,repliedPostId,repliedPost,forwardedPostId,forwardedPost,const DeepCollectionEquality().hash(attachments),publisher,const DeepCollectionEquality().hash(reactionsCount),const DeepCollectionEquality().hash(reactions),const DeepCollectionEquality().hash(tags),const DeepCollectionEquality().hash(categories),const DeepCollectionEquality().hash(collections),createdAt,updatedAt,deletedAt]); @override String toString() { @@ -49,11 +49,11 @@ abstract mixin class $SnPostCopyWith<$Res> { factory $SnPostCopyWith(SnPost value, $Res Function(SnPost) _then) = _$SnPostCopyWithImpl; @useResult $Res call({ - int id, String? title, String? description, String? language, DateTime? editedAt, DateTime publishedAt, int visibility, String? content, int type, Map? meta, int viewsUnique, int viewsTotal, int upvotes, int downvotes, dynamic threadedPostId, dynamic threadedPost, dynamic repliedPostId, dynamic repliedPost, dynamic forwardedPostId, dynamic forwardedPost, List attachments, SnPublisher publisher, Map reactionsCount, List reactions, List tags, List categories, List collections, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt + String id, String? title, String? description, String? language, DateTime? editedAt, DateTime publishedAt, int visibility, String? content, int type, Map? meta, int viewsUnique, int viewsTotal, int upvotes, int downvotes, String? threadedPostId, SnPost? threadedPost, String? repliedPostId, SnPost? repliedPost, String? forwardedPostId, SnPost? forwardedPost, List attachments, SnPublisher publisher, Map reactionsCount, List reactions, List tags, List categories, List collections, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt }); -$SnPublisherCopyWith<$Res> get publisher; +$SnPostCopyWith<$Res>? get threadedPost;$SnPostCopyWith<$Res>? get repliedPost;$SnPostCopyWith<$Res>? get forwardedPost;$SnPublisherCopyWith<$Res> get publisher; } /// @nodoc @@ -69,7 +69,7 @@ class _$SnPostCopyWithImpl<$Res> @pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? title = freezed,Object? description = freezed,Object? language = freezed,Object? editedAt = freezed,Object? publishedAt = null,Object? visibility = null,Object? content = freezed,Object? type = null,Object? meta = freezed,Object? viewsUnique = null,Object? viewsTotal = null,Object? upvotes = null,Object? downvotes = null,Object? threadedPostId = freezed,Object? threadedPost = freezed,Object? repliedPostId = freezed,Object? repliedPost = freezed,Object? forwardedPostId = freezed,Object? forwardedPost = freezed,Object? attachments = null,Object? publisher = null,Object? reactionsCount = null,Object? reactions = null,Object? tags = null,Object? categories = null,Object? collections = null,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,}) { return _then(_self.copyWith( id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as int,title: freezed == title ? _self.title : title // ignore: cast_nullable_to_non_nullable +as String,title: freezed == title ? _self.title : title // ignore: cast_nullable_to_non_nullable as String?,description: freezed == description ? _self.description : description // ignore: cast_nullable_to_non_nullable as String?,language: freezed == language ? _self.language : language // ignore: cast_nullable_to_non_nullable as String?,editedAt: freezed == editedAt ? _self.editedAt : editedAt // ignore: cast_nullable_to_non_nullable @@ -83,12 +83,12 @@ as int,viewsTotal: null == viewsTotal ? _self.viewsTotal : viewsTotal // ignore: as int,upvotes: null == upvotes ? _self.upvotes : upvotes // ignore: cast_nullable_to_non_nullable as int,downvotes: null == downvotes ? _self.downvotes : downvotes // ignore: cast_nullable_to_non_nullable as int,threadedPostId: freezed == threadedPostId ? _self.threadedPostId : threadedPostId // ignore: cast_nullable_to_non_nullable -as dynamic,threadedPost: freezed == threadedPost ? _self.threadedPost : threadedPost // ignore: cast_nullable_to_non_nullable -as dynamic,repliedPostId: freezed == repliedPostId ? _self.repliedPostId : repliedPostId // ignore: cast_nullable_to_non_nullable -as dynamic,repliedPost: freezed == repliedPost ? _self.repliedPost : repliedPost // ignore: cast_nullable_to_non_nullable -as dynamic,forwardedPostId: freezed == forwardedPostId ? _self.forwardedPostId : forwardedPostId // ignore: cast_nullable_to_non_nullable -as dynamic,forwardedPost: freezed == forwardedPost ? _self.forwardedPost : forwardedPost // ignore: cast_nullable_to_non_nullable -as dynamic,attachments: null == attachments ? _self.attachments : attachments // ignore: cast_nullable_to_non_nullable +as String?,threadedPost: freezed == threadedPost ? _self.threadedPost : threadedPost // ignore: cast_nullable_to_non_nullable +as SnPost?,repliedPostId: freezed == repliedPostId ? _self.repliedPostId : repliedPostId // ignore: cast_nullable_to_non_nullable +as String?,repliedPost: freezed == repliedPost ? _self.repliedPost : repliedPost // ignore: cast_nullable_to_non_nullable +as SnPost?,forwardedPostId: freezed == forwardedPostId ? _self.forwardedPostId : forwardedPostId // ignore: cast_nullable_to_non_nullable +as String?,forwardedPost: freezed == forwardedPost ? _self.forwardedPost : forwardedPost // ignore: cast_nullable_to_non_nullable +as SnPost?,attachments: null == attachments ? _self.attachments : attachments // ignore: cast_nullable_to_non_nullable as List,publisher: null == publisher ? _self.publisher : publisher // ignore: cast_nullable_to_non_nullable as SnPublisher,reactionsCount: null == reactionsCount ? _self.reactionsCount : reactionsCount // ignore: cast_nullable_to_non_nullable as Map,reactions: null == reactions ? _self.reactions : reactions // ignore: cast_nullable_to_non_nullable @@ -105,6 +105,42 @@ as DateTime?, /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') +$SnPostCopyWith<$Res>? get threadedPost { + if (_self.threadedPost == null) { + return null; + } + + return $SnPostCopyWith<$Res>(_self.threadedPost!, (value) { + return _then(_self.copyWith(threadedPost: value)); + }); +}/// Create a copy of SnPost +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$SnPostCopyWith<$Res>? get repliedPost { + if (_self.repliedPost == null) { + return null; + } + + return $SnPostCopyWith<$Res>(_self.repliedPost!, (value) { + return _then(_self.copyWith(repliedPost: value)); + }); +}/// Create a copy of SnPost +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$SnPostCopyWith<$Res>? get forwardedPost { + if (_self.forwardedPost == null) { + return null; + } + + return $SnPostCopyWith<$Res>(_self.forwardedPost!, (value) { + return _then(_self.copyWith(forwardedPost: value)); + }); +}/// Create a copy of SnPost +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') $SnPublisherCopyWith<$Res> get publisher { return $SnPublisherCopyWith<$Res>(_self.publisher, (value) { @@ -121,7 +157,7 @@ class _SnPost implements SnPost { const _SnPost({required this.id, required this.title, required this.description, required this.language, required this.editedAt, required this.publishedAt, required this.visibility, required this.content, required this.type, required final Map? meta, required this.viewsUnique, required this.viewsTotal, required this.upvotes, required this.downvotes, required this.threadedPostId, required this.threadedPost, required this.repliedPostId, required this.repliedPost, required this.forwardedPostId, required this.forwardedPost, required final List attachments, required this.publisher, final Map reactionsCount = const {}, required final List reactions, required final List tags, required final List categories, required final List collections, required this.createdAt, required this.updatedAt, required this.deletedAt}): _meta = meta,_attachments = attachments,_reactionsCount = reactionsCount,_reactions = reactions,_tags = tags,_categories = categories,_collections = collections; factory _SnPost.fromJson(Map json) => _$SnPostFromJson(json); -@override final int id; +@override final String id; @override final String? title; @override final String? description; @override final String? language; @@ -143,12 +179,12 @@ class _SnPost implements SnPost { @override final int viewsTotal; @override final int upvotes; @override final int downvotes; -@override final dynamic threadedPostId; -@override final dynamic threadedPost; -@override final dynamic repliedPostId; -@override final dynamic repliedPost; -@override final dynamic forwardedPostId; -@override final dynamic forwardedPost; +@override final String? threadedPostId; +@override final SnPost? threadedPost; +@override final String? repliedPostId; +@override final SnPost? repliedPost; +@override final String? forwardedPostId; +@override final SnPost? forwardedPost; final List _attachments; @override List get attachments { if (_attachments is EqualUnmodifiableListView) return _attachments; @@ -209,12 +245,12 @@ Map toJson() { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _SnPost&&(identical(other.id, id) || other.id == id)&&(identical(other.title, title) || other.title == title)&&(identical(other.description, description) || other.description == description)&&(identical(other.language, language) || other.language == language)&&(identical(other.editedAt, editedAt) || other.editedAt == editedAt)&&(identical(other.publishedAt, publishedAt) || other.publishedAt == publishedAt)&&(identical(other.visibility, visibility) || other.visibility == visibility)&&(identical(other.content, content) || other.content == content)&&(identical(other.type, type) || other.type == type)&&const DeepCollectionEquality().equals(other._meta, _meta)&&(identical(other.viewsUnique, viewsUnique) || other.viewsUnique == viewsUnique)&&(identical(other.viewsTotal, viewsTotal) || other.viewsTotal == viewsTotal)&&(identical(other.upvotes, upvotes) || other.upvotes == upvotes)&&(identical(other.downvotes, downvotes) || other.downvotes == downvotes)&&const DeepCollectionEquality().equals(other.threadedPostId, threadedPostId)&&const DeepCollectionEquality().equals(other.threadedPost, threadedPost)&&const DeepCollectionEquality().equals(other.repliedPostId, repliedPostId)&&const DeepCollectionEquality().equals(other.repliedPost, repliedPost)&&const DeepCollectionEquality().equals(other.forwardedPostId, forwardedPostId)&&const DeepCollectionEquality().equals(other.forwardedPost, forwardedPost)&&const DeepCollectionEquality().equals(other._attachments, _attachments)&&(identical(other.publisher, publisher) || other.publisher == publisher)&&const DeepCollectionEquality().equals(other._reactionsCount, _reactionsCount)&&const DeepCollectionEquality().equals(other._reactions, _reactions)&&const DeepCollectionEquality().equals(other._tags, _tags)&&const DeepCollectionEquality().equals(other._categories, _categories)&&const DeepCollectionEquality().equals(other._collections, _collections)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt)); + return identical(this, other) || (other.runtimeType == runtimeType&&other is _SnPost&&(identical(other.id, id) || other.id == id)&&(identical(other.title, title) || other.title == title)&&(identical(other.description, description) || other.description == description)&&(identical(other.language, language) || other.language == language)&&(identical(other.editedAt, editedAt) || other.editedAt == editedAt)&&(identical(other.publishedAt, publishedAt) || other.publishedAt == publishedAt)&&(identical(other.visibility, visibility) || other.visibility == visibility)&&(identical(other.content, content) || other.content == content)&&(identical(other.type, type) || other.type == type)&&const DeepCollectionEquality().equals(other._meta, _meta)&&(identical(other.viewsUnique, viewsUnique) || other.viewsUnique == viewsUnique)&&(identical(other.viewsTotal, viewsTotal) || other.viewsTotal == viewsTotal)&&(identical(other.upvotes, upvotes) || other.upvotes == upvotes)&&(identical(other.downvotes, downvotes) || other.downvotes == downvotes)&&(identical(other.threadedPostId, threadedPostId) || other.threadedPostId == threadedPostId)&&(identical(other.threadedPost, threadedPost) || other.threadedPost == threadedPost)&&(identical(other.repliedPostId, repliedPostId) || other.repliedPostId == repliedPostId)&&(identical(other.repliedPost, repliedPost) || other.repliedPost == repliedPost)&&(identical(other.forwardedPostId, forwardedPostId) || other.forwardedPostId == forwardedPostId)&&(identical(other.forwardedPost, forwardedPost) || other.forwardedPost == forwardedPost)&&const DeepCollectionEquality().equals(other._attachments, _attachments)&&(identical(other.publisher, publisher) || other.publisher == publisher)&&const DeepCollectionEquality().equals(other._reactionsCount, _reactionsCount)&&const DeepCollectionEquality().equals(other._reactions, _reactions)&&const DeepCollectionEquality().equals(other._tags, _tags)&&const DeepCollectionEquality().equals(other._categories, _categories)&&const DeepCollectionEquality().equals(other._collections, _collections)&&(identical(other.createdAt, createdAt) || other.createdAt == createdAt)&&(identical(other.updatedAt, updatedAt) || other.updatedAt == updatedAt)&&(identical(other.deletedAt, deletedAt) || other.deletedAt == deletedAt)); } @JsonKey(includeFromJson: false, includeToJson: false) @override -int get hashCode => Object.hashAll([runtimeType,id,title,description,language,editedAt,publishedAt,visibility,content,type,const DeepCollectionEquality().hash(_meta),viewsUnique,viewsTotal,upvotes,downvotes,const DeepCollectionEquality().hash(threadedPostId),const DeepCollectionEquality().hash(threadedPost),const DeepCollectionEquality().hash(repliedPostId),const DeepCollectionEquality().hash(repliedPost),const DeepCollectionEquality().hash(forwardedPostId),const DeepCollectionEquality().hash(forwardedPost),const DeepCollectionEquality().hash(_attachments),publisher,const DeepCollectionEquality().hash(_reactionsCount),const DeepCollectionEquality().hash(_reactions),const DeepCollectionEquality().hash(_tags),const DeepCollectionEquality().hash(_categories),const DeepCollectionEquality().hash(_collections),createdAt,updatedAt,deletedAt]); +int get hashCode => Object.hashAll([runtimeType,id,title,description,language,editedAt,publishedAt,visibility,content,type,const DeepCollectionEquality().hash(_meta),viewsUnique,viewsTotal,upvotes,downvotes,threadedPostId,threadedPost,repliedPostId,repliedPost,forwardedPostId,forwardedPost,const DeepCollectionEquality().hash(_attachments),publisher,const DeepCollectionEquality().hash(_reactionsCount),const DeepCollectionEquality().hash(_reactions),const DeepCollectionEquality().hash(_tags),const DeepCollectionEquality().hash(_categories),const DeepCollectionEquality().hash(_collections),createdAt,updatedAt,deletedAt]); @override String toString() { @@ -229,11 +265,11 @@ abstract mixin class _$SnPostCopyWith<$Res> implements $SnPostCopyWith<$Res> { factory _$SnPostCopyWith(_SnPost value, $Res Function(_SnPost) _then) = __$SnPostCopyWithImpl; @override @useResult $Res call({ - int id, String? title, String? description, String? language, DateTime? editedAt, DateTime publishedAt, int visibility, String? content, int type, Map? meta, int viewsUnique, int viewsTotal, int upvotes, int downvotes, dynamic threadedPostId, dynamic threadedPost, dynamic repliedPostId, dynamic repliedPost, dynamic forwardedPostId, dynamic forwardedPost, List attachments, SnPublisher publisher, Map reactionsCount, List reactions, List tags, List categories, List collections, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt + String id, String? title, String? description, String? language, DateTime? editedAt, DateTime publishedAt, int visibility, String? content, int type, Map? meta, int viewsUnique, int viewsTotal, int upvotes, int downvotes, String? threadedPostId, SnPost? threadedPost, String? repliedPostId, SnPost? repliedPost, String? forwardedPostId, SnPost? forwardedPost, List attachments, SnPublisher publisher, Map reactionsCount, List reactions, List tags, List categories, List collections, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt }); -@override $SnPublisherCopyWith<$Res> get publisher; +@override $SnPostCopyWith<$Res>? get threadedPost;@override $SnPostCopyWith<$Res>? get repliedPost;@override $SnPostCopyWith<$Res>? get forwardedPost;@override $SnPublisherCopyWith<$Res> get publisher; } /// @nodoc @@ -249,7 +285,7 @@ class __$SnPostCopyWithImpl<$Res> @override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? title = freezed,Object? description = freezed,Object? language = freezed,Object? editedAt = freezed,Object? publishedAt = null,Object? visibility = null,Object? content = freezed,Object? type = null,Object? meta = freezed,Object? viewsUnique = null,Object? viewsTotal = null,Object? upvotes = null,Object? downvotes = null,Object? threadedPostId = freezed,Object? threadedPost = freezed,Object? repliedPostId = freezed,Object? repliedPost = freezed,Object? forwardedPostId = freezed,Object? forwardedPost = freezed,Object? attachments = null,Object? publisher = null,Object? reactionsCount = null,Object? reactions = null,Object? tags = null,Object? categories = null,Object? collections = null,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,}) { return _then(_SnPost( id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as int,title: freezed == title ? _self.title : title // ignore: cast_nullable_to_non_nullable +as String,title: freezed == title ? _self.title : title // ignore: cast_nullable_to_non_nullable as String?,description: freezed == description ? _self.description : description // ignore: cast_nullable_to_non_nullable as String?,language: freezed == language ? _self.language : language // ignore: cast_nullable_to_non_nullable as String?,editedAt: freezed == editedAt ? _self.editedAt : editedAt // ignore: cast_nullable_to_non_nullable @@ -263,12 +299,12 @@ as int,viewsTotal: null == viewsTotal ? _self.viewsTotal : viewsTotal // ignore: as int,upvotes: null == upvotes ? _self.upvotes : upvotes // ignore: cast_nullable_to_non_nullable as int,downvotes: null == downvotes ? _self.downvotes : downvotes // ignore: cast_nullable_to_non_nullable as int,threadedPostId: freezed == threadedPostId ? _self.threadedPostId : threadedPostId // ignore: cast_nullable_to_non_nullable -as dynamic,threadedPost: freezed == threadedPost ? _self.threadedPost : threadedPost // ignore: cast_nullable_to_non_nullable -as dynamic,repliedPostId: freezed == repliedPostId ? _self.repliedPostId : repliedPostId // ignore: cast_nullable_to_non_nullable -as dynamic,repliedPost: freezed == repliedPost ? _self.repliedPost : repliedPost // ignore: cast_nullable_to_non_nullable -as dynamic,forwardedPostId: freezed == forwardedPostId ? _self.forwardedPostId : forwardedPostId // ignore: cast_nullable_to_non_nullable -as dynamic,forwardedPost: freezed == forwardedPost ? _self.forwardedPost : forwardedPost // ignore: cast_nullable_to_non_nullable -as dynamic,attachments: null == attachments ? _self._attachments : attachments // ignore: cast_nullable_to_non_nullable +as String?,threadedPost: freezed == threadedPost ? _self.threadedPost : threadedPost // ignore: cast_nullable_to_non_nullable +as SnPost?,repliedPostId: freezed == repliedPostId ? _self.repliedPostId : repliedPostId // ignore: cast_nullable_to_non_nullable +as String?,repliedPost: freezed == repliedPost ? _self.repliedPost : repliedPost // ignore: cast_nullable_to_non_nullable +as SnPost?,forwardedPostId: freezed == forwardedPostId ? _self.forwardedPostId : forwardedPostId // ignore: cast_nullable_to_non_nullable +as String?,forwardedPost: freezed == forwardedPost ? _self.forwardedPost : forwardedPost // ignore: cast_nullable_to_non_nullable +as SnPost?,attachments: null == attachments ? _self._attachments : attachments // ignore: cast_nullable_to_non_nullable as List,publisher: null == publisher ? _self.publisher : publisher // ignore: cast_nullable_to_non_nullable as SnPublisher,reactionsCount: null == reactionsCount ? _self._reactionsCount : reactionsCount // ignore: cast_nullable_to_non_nullable as Map,reactions: null == reactions ? _self._reactions : reactions // ignore: cast_nullable_to_non_nullable @@ -286,6 +322,42 @@ as DateTime?, /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') +$SnPostCopyWith<$Res>? get threadedPost { + if (_self.threadedPost == null) { + return null; + } + + return $SnPostCopyWith<$Res>(_self.threadedPost!, (value) { + return _then(_self.copyWith(threadedPost: value)); + }); +}/// Create a copy of SnPost +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$SnPostCopyWith<$Res>? get repliedPost { + if (_self.repliedPost == null) { + return null; + } + + return $SnPostCopyWith<$Res>(_self.repliedPost!, (value) { + return _then(_self.copyWith(repliedPost: value)); + }); +}/// Create a copy of SnPost +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$SnPostCopyWith<$Res>? get forwardedPost { + if (_self.forwardedPost == null) { + return null; + } + + return $SnPostCopyWith<$Res>(_self.forwardedPost!, (value) { + return _then(_self.copyWith(forwardedPost: value)); + }); +}/// Create a copy of SnPost +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') $SnPublisherCopyWith<$Res> get publisher { return $SnPublisherCopyWith<$Res>(_self.publisher, (value) { @@ -298,7 +370,7 @@ $SnPublisherCopyWith<$Res> get publisher { /// @nodoc mixin _$SnPublisher { - int get id; int get publisherType; String get name; String get nick; String get bio; String? get pictureId; SnCloudFile? get picture; String? get backgroundId; SnCloudFile? get background; int get accountId; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; + String get id; int get publisherType; String get name; String get nick; String get bio; String? get pictureId; SnCloudFile? get picture; String? get backgroundId; SnCloudFile? get background; String? get accountId; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; /// Create a copy of SnPublisher /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @@ -331,7 +403,7 @@ abstract mixin class $SnPublisherCopyWith<$Res> { factory $SnPublisherCopyWith(SnPublisher value, $Res Function(SnPublisher) _then) = _$SnPublisherCopyWithImpl; @useResult $Res call({ - int id, int publisherType, String name, String nick, String bio, String? pictureId, SnCloudFile? picture, String? backgroundId, SnCloudFile? background, int accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt + String id, int publisherType, String name, String nick, String bio, String? pictureId, SnCloudFile? picture, String? backgroundId, SnCloudFile? background, String? accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt }); @@ -348,10 +420,10 @@ class _$SnPublisherCopyWithImpl<$Res> /// Create a copy of SnPublisher /// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? publisherType = null,Object? name = null,Object? nick = null,Object? bio = null,Object? pictureId = freezed,Object? picture = freezed,Object? backgroundId = freezed,Object? background = freezed,Object? accountId = null,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,}) { +@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? publisherType = null,Object? name = null,Object? nick = null,Object? bio = null,Object? pictureId = freezed,Object? picture = freezed,Object? backgroundId = freezed,Object? background = freezed,Object? accountId = freezed,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,}) { return _then(_self.copyWith( id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as int,publisherType: null == publisherType ? _self.publisherType : publisherType // ignore: cast_nullable_to_non_nullable +as String,publisherType: null == publisherType ? _self.publisherType : publisherType // ignore: cast_nullable_to_non_nullable as int,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable as String,nick: null == nick ? _self.nick : nick // ignore: cast_nullable_to_non_nullable as String,bio: null == bio ? _self.bio : bio // ignore: cast_nullable_to_non_nullable @@ -359,8 +431,8 @@ as String,pictureId: freezed == pictureId ? _self.pictureId : pictureId // ignor as String?,picture: freezed == picture ? _self.picture : picture // ignore: cast_nullable_to_non_nullable as SnCloudFile?,backgroundId: freezed == backgroundId ? _self.backgroundId : backgroundId // ignore: cast_nullable_to_non_nullable as String?,background: freezed == background ? _self.background : background // ignore: cast_nullable_to_non_nullable -as SnCloudFile?,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable -as int,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable +as SnCloudFile?,accountId: freezed == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable +as String?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable as DateTime,deletedAt: freezed == deletedAt ? _self.deletedAt : deletedAt // ignore: cast_nullable_to_non_nullable as DateTime?, @@ -401,7 +473,7 @@ class _SnPublisher implements SnPublisher { const _SnPublisher({required this.id, required this.publisherType, required this.name, required this.nick, required this.bio, required this.pictureId, required this.picture, required this.backgroundId, required this.background, required this.accountId, required this.createdAt, required this.updatedAt, required this.deletedAt}); factory _SnPublisher.fromJson(Map json) => _$SnPublisherFromJson(json); -@override final int id; +@override final String id; @override final int publisherType; @override final String name; @override final String nick; @@ -410,7 +482,7 @@ class _SnPublisher implements SnPublisher { @override final SnCloudFile? picture; @override final String? backgroundId; @override final SnCloudFile? background; -@override final int accountId; +@override final String? accountId; @override final DateTime createdAt; @override final DateTime updatedAt; @override final DateTime? deletedAt; @@ -448,7 +520,7 @@ abstract mixin class _$SnPublisherCopyWith<$Res> implements $SnPublisherCopyWith factory _$SnPublisherCopyWith(_SnPublisher value, $Res Function(_SnPublisher) _then) = __$SnPublisherCopyWithImpl; @override @useResult $Res call({ - int id, int publisherType, String name, String nick, String bio, String? pictureId, SnCloudFile? picture, String? backgroundId, SnCloudFile? background, int accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt + String id, int publisherType, String name, String nick, String bio, String? pictureId, SnCloudFile? picture, String? backgroundId, SnCloudFile? background, String? accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt }); @@ -465,10 +537,10 @@ class __$SnPublisherCopyWithImpl<$Res> /// Create a copy of SnPublisher /// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? publisherType = null,Object? name = null,Object? nick = null,Object? bio = null,Object? pictureId = freezed,Object? picture = freezed,Object? backgroundId = freezed,Object? background = freezed,Object? accountId = null,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,}) { +@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? publisherType = null,Object? name = null,Object? nick = null,Object? bio = null,Object? pictureId = freezed,Object? picture = freezed,Object? backgroundId = freezed,Object? background = freezed,Object? accountId = freezed,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,}) { return _then(_SnPublisher( id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as int,publisherType: null == publisherType ? _self.publisherType : publisherType // ignore: cast_nullable_to_non_nullable +as String,publisherType: null == publisherType ? _self.publisherType : publisherType // ignore: cast_nullable_to_non_nullable as int,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable as String,nick: null == nick ? _self.nick : nick // ignore: cast_nullable_to_non_nullable as String,bio: null == bio ? _self.bio : bio // ignore: cast_nullable_to_non_nullable @@ -476,8 +548,8 @@ as String,pictureId: freezed == pictureId ? _self.pictureId : pictureId // ignor as String?,picture: freezed == picture ? _self.picture : picture // ignore: cast_nullable_to_non_nullable as SnCloudFile?,backgroundId: freezed == backgroundId ? _self.backgroundId : backgroundId // ignore: cast_nullable_to_non_nullable as String?,background: freezed == background ? _self.background : background // ignore: cast_nullable_to_non_nullable -as SnCloudFile?,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable -as int,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable +as SnCloudFile?,accountId: freezed == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable +as String?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable as DateTime,deletedAt: freezed == deletedAt ? _self.deletedAt : deletedAt // ignore: cast_nullable_to_non_nullable as DateTime?, diff --git a/lib/models/post.g.dart b/lib/models/post.g.dart index 71aafa1..b0f63ee 100644 --- a/lib/models/post.g.dart +++ b/lib/models/post.g.dart @@ -7,7 +7,7 @@ part of 'post.dart'; // ************************************************************************** _SnPost _$SnPostFromJson(Map json) => _SnPost( - id: (json['id'] as num).toInt(), + id: json['id'] as String, title: json['title'] as String?, description: json['description'] as String?, language: json['language'] as String?, @@ -24,12 +24,21 @@ _SnPost _$SnPostFromJson(Map json) => _SnPost( viewsTotal: (json['views_total'] as num).toInt(), upvotes: (json['upvotes'] as num).toInt(), downvotes: (json['downvotes'] as num).toInt(), - threadedPostId: json['threaded_post_id'], - threadedPost: json['threaded_post'], - repliedPostId: json['replied_post_id'], - repliedPost: json['replied_post'], - forwardedPostId: json['forwarded_post_id'], - forwardedPost: json['forwarded_post'], + threadedPostId: json['threaded_post_id'] as String?, + threadedPost: + json['threaded_post'] == null + ? null + : SnPost.fromJson(json['threaded_post'] as Map), + repliedPostId: json['replied_post_id'] as String?, + repliedPost: + json['replied_post'] == null + ? null + : SnPost.fromJson(json['replied_post'] as Map), + forwardedPostId: json['forwarded_post_id'] as String?, + forwardedPost: + json['forwarded_post'] == null + ? null + : SnPost.fromJson(json['forwarded_post'] as Map), attachments: (json['attachments'] as List) .map((e) => SnCloudFile.fromJson(e as Map)) @@ -68,11 +77,11 @@ Map _$SnPostToJson(_SnPost instance) => { 'upvotes': instance.upvotes, 'downvotes': instance.downvotes, 'threaded_post_id': instance.threadedPostId, - 'threaded_post': instance.threadedPost, + 'threaded_post': instance.threadedPost?.toJson(), 'replied_post_id': instance.repliedPostId, - 'replied_post': instance.repliedPost, + 'replied_post': instance.repliedPost?.toJson(), 'forwarded_post_id': instance.forwardedPostId, - 'forwarded_post': instance.forwardedPost, + 'forwarded_post': instance.forwardedPost?.toJson(), 'attachments': instance.attachments.map((e) => e.toJson()).toList(), 'publisher': instance.publisher.toJson(), 'reactions_count': instance.reactionsCount, @@ -86,7 +95,7 @@ Map _$SnPostToJson(_SnPost instance) => { }; _SnPublisher _$SnPublisherFromJson(Map json) => _SnPublisher( - id: (json['id'] as num).toInt(), + id: json['id'] as String, publisherType: (json['publisher_type'] as num).toInt(), name: json['name'] as String, nick: json['nick'] as String, @@ -101,7 +110,7 @@ _SnPublisher _$SnPublisherFromJson(Map json) => _SnPublisher( json['background'] == null ? null : SnCloudFile.fromJson(json['background'] as Map), - accountId: (json['account_id'] as num).toInt(), + accountId: json['account_id'] as String?, createdAt: DateTime.parse(json['created_at'] as String), updatedAt: DateTime.parse(json['updated_at'] as String), deletedAt: diff --git a/lib/models/realm.dart b/lib/models/realm.dart index 53e58bc..717d938 100644 --- a/lib/models/realm.dart +++ b/lib/models/realm.dart @@ -8,7 +8,7 @@ part 'realm.g.dart'; @freezed abstract class SnRealm with _$SnRealm { const factory SnRealm({ - required int id, + required String id, required String slug, required String name, required String description, @@ -20,7 +20,7 @@ abstract class SnRealm with _$SnRealm { required SnCloudFile? picture, required String? backgroundId, required SnCloudFile? background, - required int accountId, + required String accountId, required DateTime createdAt, required DateTime updatedAt, required DateTime? deletedAt, @@ -33,9 +33,9 @@ abstract class SnRealm with _$SnRealm { @freezed abstract class SnRealmMember with _$SnRealmMember { const factory SnRealmMember({ - required int realmId, + required String realmId, required SnRealm? realm, - required int accountId, + required String accountId, required SnAccount? account, required int role, required DateTime? joinedAt, diff --git a/lib/models/realm.freezed.dart b/lib/models/realm.freezed.dart index a38ba3d..b96480c 100644 --- a/lib/models/realm.freezed.dart +++ b/lib/models/realm.freezed.dart @@ -16,7 +16,7 @@ T _$identity(T value) => value; /// @nodoc mixin _$SnRealm { - int get id; String get slug; String get name; String get description; String? get verifiedAs; DateTime? get verifiedAt; bool get isCommunity; bool get isPublic; String? get pictureId; SnCloudFile? get picture; String? get backgroundId; SnCloudFile? get background; int get accountId; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; + String get id; String get slug; String get name; String get description; String? get verifiedAs; DateTime? get verifiedAt; bool get isCommunity; bool get isPublic; String? get pictureId; SnCloudFile? get picture; String? get backgroundId; SnCloudFile? get background; String get accountId; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; /// Create a copy of SnRealm /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @@ -49,7 +49,7 @@ abstract mixin class $SnRealmCopyWith<$Res> { factory $SnRealmCopyWith(SnRealm value, $Res Function(SnRealm) _then) = _$SnRealmCopyWithImpl; @useResult $Res call({ - int id, String slug, String name, String description, String? verifiedAs, DateTime? verifiedAt, bool isCommunity, bool isPublic, String? pictureId, SnCloudFile? picture, String? backgroundId, SnCloudFile? background, int accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt + String id, String slug, String name, String description, String? verifiedAs, DateTime? verifiedAt, bool isCommunity, bool isPublic, String? pictureId, SnCloudFile? picture, String? backgroundId, SnCloudFile? background, String accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt }); @@ -69,7 +69,7 @@ class _$SnRealmCopyWithImpl<$Res> @pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? slug = null,Object? name = null,Object? description = null,Object? verifiedAs = freezed,Object? verifiedAt = freezed,Object? isCommunity = null,Object? isPublic = null,Object? pictureId = freezed,Object? picture = freezed,Object? backgroundId = freezed,Object? background = freezed,Object? accountId = null,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,}) { return _then(_self.copyWith( id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as int,slug: null == slug ? _self.slug : slug // ignore: cast_nullable_to_non_nullable +as String,slug: null == slug ? _self.slug : slug // ignore: cast_nullable_to_non_nullable as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable as String,description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable as String,verifiedAs: freezed == verifiedAs ? _self.verifiedAs : verifiedAs // ignore: cast_nullable_to_non_nullable @@ -81,7 +81,7 @@ as String?,picture: freezed == picture ? _self.picture : picture // ignore: cast as SnCloudFile?,backgroundId: freezed == backgroundId ? _self.backgroundId : backgroundId // ignore: cast_nullable_to_non_nullable as String?,background: freezed == background ? _self.background : background // ignore: cast_nullable_to_non_nullable as SnCloudFile?,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable -as int,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable +as String,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable as DateTime,deletedAt: freezed == deletedAt ? _self.deletedAt : deletedAt // ignore: cast_nullable_to_non_nullable as DateTime?, @@ -122,7 +122,7 @@ class _SnRealm implements SnRealm { const _SnRealm({required this.id, required this.slug, required this.name, required this.description, required this.verifiedAs, required this.verifiedAt, required this.isCommunity, required this.isPublic, required this.pictureId, required this.picture, required this.backgroundId, required this.background, required this.accountId, required this.createdAt, required this.updatedAt, required this.deletedAt}); factory _SnRealm.fromJson(Map json) => _$SnRealmFromJson(json); -@override final int id; +@override final String id; @override final String slug; @override final String name; @override final String description; @@ -134,7 +134,7 @@ class _SnRealm implements SnRealm { @override final SnCloudFile? picture; @override final String? backgroundId; @override final SnCloudFile? background; -@override final int accountId; +@override final String accountId; @override final DateTime createdAt; @override final DateTime updatedAt; @override final DateTime? deletedAt; @@ -172,7 +172,7 @@ abstract mixin class _$SnRealmCopyWith<$Res> implements $SnRealmCopyWith<$Res> { factory _$SnRealmCopyWith(_SnRealm value, $Res Function(_SnRealm) _then) = __$SnRealmCopyWithImpl; @override @useResult $Res call({ - int id, String slug, String name, String description, String? verifiedAs, DateTime? verifiedAt, bool isCommunity, bool isPublic, String? pictureId, SnCloudFile? picture, String? backgroundId, SnCloudFile? background, int accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt + String id, String slug, String name, String description, String? verifiedAs, DateTime? verifiedAt, bool isCommunity, bool isPublic, String? pictureId, SnCloudFile? picture, String? backgroundId, SnCloudFile? background, String accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt }); @@ -192,7 +192,7 @@ class __$SnRealmCopyWithImpl<$Res> @override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? slug = null,Object? name = null,Object? description = null,Object? verifiedAs = freezed,Object? verifiedAt = freezed,Object? isCommunity = null,Object? isPublic = null,Object? pictureId = freezed,Object? picture = freezed,Object? backgroundId = freezed,Object? background = freezed,Object? accountId = null,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,}) { return _then(_SnRealm( id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as int,slug: null == slug ? _self.slug : slug // ignore: cast_nullable_to_non_nullable +as String,slug: null == slug ? _self.slug : slug // ignore: cast_nullable_to_non_nullable as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable as String,description: null == description ? _self.description : description // ignore: cast_nullable_to_non_nullable as String,verifiedAs: freezed == verifiedAs ? _self.verifiedAs : verifiedAs // ignore: cast_nullable_to_non_nullable @@ -204,7 +204,7 @@ as String?,picture: freezed == picture ? _self.picture : picture // ignore: cast as SnCloudFile?,backgroundId: freezed == backgroundId ? _self.backgroundId : backgroundId // ignore: cast_nullable_to_non_nullable as String?,background: freezed == background ? _self.background : background // ignore: cast_nullable_to_non_nullable as SnCloudFile?,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable -as int,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable +as String,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable as DateTime,deletedAt: freezed == deletedAt ? _self.deletedAt : deletedAt // ignore: cast_nullable_to_non_nullable as DateTime?, @@ -242,7 +242,7 @@ $SnCloudFileCopyWith<$Res>? get background { /// @nodoc mixin _$SnRealmMember { - int get realmId; SnRealm? get realm; int get accountId; SnAccount? get account; int get role; DateTime? get joinedAt; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; + String get realmId; SnRealm? get realm; String get accountId; SnAccount? get account; int get role; DateTime? get joinedAt; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; /// Create a copy of SnRealmMember /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @@ -275,7 +275,7 @@ abstract mixin class $SnRealmMemberCopyWith<$Res> { factory $SnRealmMemberCopyWith(SnRealmMember value, $Res Function(SnRealmMember) _then) = _$SnRealmMemberCopyWithImpl; @useResult $Res call({ - int realmId, SnRealm? realm, int accountId, SnAccount? account, int role, DateTime? joinedAt, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt + String realmId, SnRealm? realm, String accountId, SnAccount? account, int role, DateTime? joinedAt, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt }); @@ -295,9 +295,9 @@ class _$SnRealmMemberCopyWithImpl<$Res> @pragma('vm:prefer-inline') @override $Res call({Object? realmId = null,Object? realm = freezed,Object? accountId = null,Object? account = freezed,Object? role = null,Object? joinedAt = freezed,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,}) { return _then(_self.copyWith( realmId: null == realmId ? _self.realmId : realmId // ignore: cast_nullable_to_non_nullable -as int,realm: freezed == realm ? _self.realm : realm // ignore: cast_nullable_to_non_nullable +as String,realm: freezed == realm ? _self.realm : realm // ignore: cast_nullable_to_non_nullable as SnRealm?,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable -as int,account: freezed == account ? _self.account : account // ignore: cast_nullable_to_non_nullable +as String,account: freezed == account ? _self.account : account // ignore: cast_nullable_to_non_nullable as SnAccount?,role: null == role ? _self.role : role // ignore: cast_nullable_to_non_nullable as int,joinedAt: freezed == joinedAt ? _self.joinedAt : joinedAt // ignore: cast_nullable_to_non_nullable as DateTime?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable @@ -341,9 +341,9 @@ class _SnRealmMember implements SnRealmMember { const _SnRealmMember({required this.realmId, required this.realm, required this.accountId, required this.account, required this.role, required this.joinedAt, required this.createdAt, required this.updatedAt, required this.deletedAt}); factory _SnRealmMember.fromJson(Map json) => _$SnRealmMemberFromJson(json); -@override final int realmId; +@override final String realmId; @override final SnRealm? realm; -@override final int accountId; +@override final String accountId; @override final SnAccount? account; @override final int role; @override final DateTime? joinedAt; @@ -384,7 +384,7 @@ abstract mixin class _$SnRealmMemberCopyWith<$Res> implements $SnRealmMemberCopy factory _$SnRealmMemberCopyWith(_SnRealmMember value, $Res Function(_SnRealmMember) _then) = __$SnRealmMemberCopyWithImpl; @override @useResult $Res call({ - int realmId, SnRealm? realm, int accountId, SnAccount? account, int role, DateTime? joinedAt, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt + String realmId, SnRealm? realm, String accountId, SnAccount? account, int role, DateTime? joinedAt, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt }); @@ -404,9 +404,9 @@ class __$SnRealmMemberCopyWithImpl<$Res> @override @pragma('vm:prefer-inline') $Res call({Object? realmId = null,Object? realm = freezed,Object? accountId = null,Object? account = freezed,Object? role = null,Object? joinedAt = freezed,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,}) { return _then(_SnRealmMember( realmId: null == realmId ? _self.realmId : realmId // ignore: cast_nullable_to_non_nullable -as int,realm: freezed == realm ? _self.realm : realm // ignore: cast_nullable_to_non_nullable +as String,realm: freezed == realm ? _self.realm : realm // ignore: cast_nullable_to_non_nullable as SnRealm?,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable -as int,account: freezed == account ? _self.account : account // ignore: cast_nullable_to_non_nullable +as String,account: freezed == account ? _self.account : account // ignore: cast_nullable_to_non_nullable as SnAccount?,role: null == role ? _self.role : role // ignore: cast_nullable_to_non_nullable as int,joinedAt: freezed == joinedAt ? _self.joinedAt : joinedAt // ignore: cast_nullable_to_non_nullable as DateTime?,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable diff --git a/lib/models/realm.g.dart b/lib/models/realm.g.dart index 2085358..c96a71b 100644 --- a/lib/models/realm.g.dart +++ b/lib/models/realm.g.dart @@ -7,7 +7,7 @@ part of 'realm.dart'; // ************************************************************************** _SnRealm _$SnRealmFromJson(Map json) => _SnRealm( - id: (json['id'] as num).toInt(), + id: json['id'] as String, slug: json['slug'] as String, name: json['name'] as String, description: json['description'] as String, @@ -28,7 +28,7 @@ _SnRealm _$SnRealmFromJson(Map json) => _SnRealm( json['background'] == null ? null : SnCloudFile.fromJson(json['background'] as Map), - accountId: (json['account_id'] as num).toInt(), + accountId: json['account_id'] as String, createdAt: DateTime.parse(json['created_at'] as String), updatedAt: DateTime.parse(json['updated_at'] as String), deletedAt: @@ -58,12 +58,12 @@ Map _$SnRealmToJson(_SnRealm instance) => { _SnRealmMember _$SnRealmMemberFromJson(Map json) => _SnRealmMember( - realmId: (json['realm_id'] as num).toInt(), + realmId: json['realm_id'] as String, realm: json['realm'] == null ? null : SnRealm.fromJson(json['realm'] as Map), - accountId: (json['account_id'] as num).toInt(), + accountId: json['account_id'] as String, account: json['account'] == null ? null diff --git a/lib/models/user.dart b/lib/models/user.dart index f696ece..99f3d94 100644 --- a/lib/models/user.dart +++ b/lib/models/user.dart @@ -7,7 +7,7 @@ part 'user.g.dart'; @freezed abstract class SnAccount with _$SnAccount { const factory SnAccount({ - required int id, + required String id, required String name, required String nick, required String language, @@ -26,7 +26,7 @@ abstract class SnAccount with _$SnAccount { @freezed abstract class SnAccountProfile with _$SnAccountProfile { const factory SnAccountProfile({ - required int id, + required String id, required String? firstName, required String? middleName, required String? lastName, @@ -55,7 +55,7 @@ abstract class SnAccountStatus with _$SnAccountStatus { required bool isCustomized, @Default("") String label, required DateTime? clearedAt, - required int accountId, + required String accountId, required DateTime createdAt, required DateTime updatedAt, required DateTime? deletedAt, @@ -74,7 +74,7 @@ abstract class SnAccountBadge with _$SnAccountBadge { required String? caption, required Map meta, required DateTime? expiredAt, - required int accountId, + required String accountId, required DateTime createdAt, required DateTime updatedAt, required DateTime? deletedAt, diff --git a/lib/models/user.freezed.dart b/lib/models/user.freezed.dart index d11215b..21fac45 100644 --- a/lib/models/user.freezed.dart +++ b/lib/models/user.freezed.dart @@ -16,7 +16,7 @@ T _$identity(T value) => value; /// @nodoc mixin _$SnAccount { - int get id; String get name; String get nick; String get language; bool get isSuperuser; SnAccountProfile get profile; List get badges; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; + String get id; String get name; String get nick; String get language; bool get isSuperuser; SnAccountProfile get profile; List get badges; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; /// Create a copy of SnAccount /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @@ -49,7 +49,7 @@ abstract mixin class $SnAccountCopyWith<$Res> { factory $SnAccountCopyWith(SnAccount value, $Res Function(SnAccount) _then) = _$SnAccountCopyWithImpl; @useResult $Res call({ - int id, String name, String nick, String language, bool isSuperuser, SnAccountProfile profile, List badges, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt + String id, String name, String nick, String language, bool isSuperuser, SnAccountProfile profile, List badges, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt }); @@ -69,7 +69,7 @@ class _$SnAccountCopyWithImpl<$Res> @pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? name = null,Object? nick = null,Object? language = null,Object? isSuperuser = null,Object? profile = null,Object? badges = null,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,}) { return _then(_self.copyWith( id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as int,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable as String,nick: null == nick ? _self.nick : nick // ignore: cast_nullable_to_non_nullable as String,language: null == language ? _self.language : language // ignore: cast_nullable_to_non_nullable as String,isSuperuser: null == isSuperuser ? _self.isSuperuser : isSuperuser // ignore: cast_nullable_to_non_nullable @@ -101,7 +101,7 @@ class _SnAccount implements SnAccount { const _SnAccount({required this.id, required this.name, required this.nick, required this.language, required this.isSuperuser, required this.profile, final List badges = const [], required this.createdAt, required this.updatedAt, required this.deletedAt}): _badges = badges; factory _SnAccount.fromJson(Map json) => _$SnAccountFromJson(json); -@override final int id; +@override final String id; @override final String name; @override final String nick; @override final String language; @@ -151,7 +151,7 @@ abstract mixin class _$SnAccountCopyWith<$Res> implements $SnAccountCopyWith<$Re factory _$SnAccountCopyWith(_SnAccount value, $Res Function(_SnAccount) _then) = __$SnAccountCopyWithImpl; @override @useResult $Res call({ - int id, String name, String nick, String language, bool isSuperuser, SnAccountProfile profile, List badges, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt + String id, String name, String nick, String language, bool isSuperuser, SnAccountProfile profile, List badges, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt }); @@ -171,7 +171,7 @@ class __$SnAccountCopyWithImpl<$Res> @override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? name = null,Object? nick = null,Object? language = null,Object? isSuperuser = null,Object? profile = null,Object? badges = null,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,}) { return _then(_SnAccount( id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as int,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String,name: null == name ? _self.name : name // ignore: cast_nullable_to_non_nullable as String,nick: null == nick ? _self.nick : nick // ignore: cast_nullable_to_non_nullable as String,language: null == language ? _self.language : language // ignore: cast_nullable_to_non_nullable as String,isSuperuser: null == isSuperuser ? _self.isSuperuser : isSuperuser // ignore: cast_nullable_to_non_nullable @@ -200,7 +200,7 @@ $SnAccountProfileCopyWith<$Res> get profile { /// @nodoc mixin _$SnAccountProfile { - int get id; String? get firstName; String? get middleName; String? get lastName; String? get bio; String? get pictureId; SnCloudFile? get picture; String? get backgroundId; SnCloudFile? get background; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; + String get id; String? get firstName; String? get middleName; String? get lastName; String? get bio; String? get pictureId; SnCloudFile? get picture; String? get backgroundId; SnCloudFile? get background; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; /// Create a copy of SnAccountProfile /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @@ -233,7 +233,7 @@ abstract mixin class $SnAccountProfileCopyWith<$Res> { factory $SnAccountProfileCopyWith(SnAccountProfile value, $Res Function(SnAccountProfile) _then) = _$SnAccountProfileCopyWithImpl; @useResult $Res call({ - int id, String? firstName, String? middleName, String? lastName, String? bio, String? pictureId, SnCloudFile? picture, String? backgroundId, SnCloudFile? background, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt + String id, String? firstName, String? middleName, String? lastName, String? bio, String? pictureId, SnCloudFile? picture, String? backgroundId, SnCloudFile? background, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt }); @@ -253,7 +253,7 @@ class _$SnAccountProfileCopyWithImpl<$Res> @pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? firstName = freezed,Object? middleName = freezed,Object? lastName = freezed,Object? bio = freezed,Object? pictureId = freezed,Object? picture = freezed,Object? backgroundId = freezed,Object? background = freezed,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,}) { return _then(_self.copyWith( id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as int,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable +as String,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable as String?,middleName: freezed == middleName ? _self.middleName : middleName // ignore: cast_nullable_to_non_nullable as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable as String?,bio: freezed == bio ? _self.bio : bio // ignore: cast_nullable_to_non_nullable @@ -302,7 +302,7 @@ class _SnAccountProfile implements SnAccountProfile { const _SnAccountProfile({required this.id, required this.firstName, required this.middleName, required this.lastName, required this.bio, required this.pictureId, required this.picture, required this.backgroundId, required this.background, required this.createdAt, required this.updatedAt, required this.deletedAt}); factory _SnAccountProfile.fromJson(Map json) => _$SnAccountProfileFromJson(json); -@override final int id; +@override final String id; @override final String? firstName; @override final String? middleName; @override final String? lastName; @@ -348,7 +348,7 @@ abstract mixin class _$SnAccountProfileCopyWith<$Res> implements $SnAccountProfi factory _$SnAccountProfileCopyWith(_SnAccountProfile value, $Res Function(_SnAccountProfile) _then) = __$SnAccountProfileCopyWithImpl; @override @useResult $Res call({ - int id, String? firstName, String? middleName, String? lastName, String? bio, String? pictureId, SnCloudFile? picture, String? backgroundId, SnCloudFile? background, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt + String id, String? firstName, String? middleName, String? lastName, String? bio, String? pictureId, SnCloudFile? picture, String? backgroundId, SnCloudFile? background, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt }); @@ -368,7 +368,7 @@ class __$SnAccountProfileCopyWithImpl<$Res> @override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? firstName = freezed,Object? middleName = freezed,Object? lastName = freezed,Object? bio = freezed,Object? pictureId = freezed,Object? picture = freezed,Object? backgroundId = freezed,Object? background = freezed,Object? createdAt = null,Object? updatedAt = null,Object? deletedAt = freezed,}) { return _then(_SnAccountProfile( id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as int,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable +as String,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable as String?,middleName: freezed == middleName ? _self.middleName : middleName // ignore: cast_nullable_to_non_nullable as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable as String?,bio: freezed == bio ? _self.bio : bio // ignore: cast_nullable_to_non_nullable @@ -414,7 +414,7 @@ $SnCloudFileCopyWith<$Res>? get background { /// @nodoc mixin _$SnAccountStatus { - String get id; int get attitude; bool get isOnline; bool get isInvisible; bool get isNotDisturb; bool get isCustomized; String get label; DateTime? get clearedAt; int get accountId; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; + String get id; int get attitude; bool get isOnline; bool get isInvisible; bool get isNotDisturb; bool get isCustomized; String get label; DateTime? get clearedAt; String get accountId; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; /// Create a copy of SnAccountStatus /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @@ -447,7 +447,7 @@ abstract mixin class $SnAccountStatusCopyWith<$Res> { factory $SnAccountStatusCopyWith(SnAccountStatus value, $Res Function(SnAccountStatus) _then) = _$SnAccountStatusCopyWithImpl; @useResult $Res call({ - String id, int attitude, bool isOnline, bool isInvisible, bool isNotDisturb, bool isCustomized, String label, DateTime? clearedAt, int accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt + String id, int attitude, bool isOnline, bool isInvisible, bool isNotDisturb, bool isCustomized, String label, DateTime? clearedAt, String accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt }); @@ -475,7 +475,7 @@ as bool,isCustomized: null == isCustomized ? _self.isCustomized : isCustomized / as bool,label: null == label ? _self.label : label // ignore: cast_nullable_to_non_nullable as String,clearedAt: freezed == clearedAt ? _self.clearedAt : clearedAt // ignore: cast_nullable_to_non_nullable as DateTime?,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable -as int,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable +as String,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable as DateTime,deletedAt: freezed == deletedAt ? _self.deletedAt : deletedAt // ignore: cast_nullable_to_non_nullable as DateTime?, @@ -500,7 +500,7 @@ class _SnAccountStatus implements SnAccountStatus { @override final bool isCustomized; @override@JsonKey() final String label; @override final DateTime? clearedAt; -@override final int accountId; +@override final String accountId; @override final DateTime createdAt; @override final DateTime updatedAt; @override final DateTime? deletedAt; @@ -538,7 +538,7 @@ abstract mixin class _$SnAccountStatusCopyWith<$Res> implements $SnAccountStatus factory _$SnAccountStatusCopyWith(_SnAccountStatus value, $Res Function(_SnAccountStatus) _then) = __$SnAccountStatusCopyWithImpl; @override @useResult $Res call({ - String id, int attitude, bool isOnline, bool isInvisible, bool isNotDisturb, bool isCustomized, String label, DateTime? clearedAt, int accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt + String id, int attitude, bool isOnline, bool isInvisible, bool isNotDisturb, bool isCustomized, String label, DateTime? clearedAt, String accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt }); @@ -566,7 +566,7 @@ as bool,isCustomized: null == isCustomized ? _self.isCustomized : isCustomized / as bool,label: null == label ? _self.label : label // ignore: cast_nullable_to_non_nullable as String,clearedAt: freezed == clearedAt ? _self.clearedAt : clearedAt // ignore: cast_nullable_to_non_nullable as DateTime?,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable -as int,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable +as String,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable as DateTime,deletedAt: freezed == deletedAt ? _self.deletedAt : deletedAt // ignore: cast_nullable_to_non_nullable as DateTime?, @@ -580,7 +580,7 @@ as DateTime?, /// @nodoc mixin _$SnAccountBadge { - String get id; String get type; String? get label; String? get caption; Map get meta; DateTime? get expiredAt; int get accountId; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; + String get id; String get type; String? get label; String? get caption; Map get meta; DateTime? get expiredAt; String get accountId; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt; /// Create a copy of SnAccountBadge /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @@ -613,7 +613,7 @@ abstract mixin class $SnAccountBadgeCopyWith<$Res> { factory $SnAccountBadgeCopyWith(SnAccountBadge value, $Res Function(SnAccountBadge) _then) = _$SnAccountBadgeCopyWithImpl; @useResult $Res call({ - String id, String type, String? label, String? caption, Map meta, DateTime? expiredAt, int accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt + String id, String type, String? label, String? caption, Map meta, DateTime? expiredAt, String accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt }); @@ -639,7 +639,7 @@ as String?,caption: freezed == caption ? _self.caption : caption // ignore: cast as String?,meta: null == meta ? _self.meta : meta // ignore: cast_nullable_to_non_nullable as Map,expiredAt: freezed == expiredAt ? _self.expiredAt : expiredAt // ignore: cast_nullable_to_non_nullable as DateTime?,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable -as int,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable +as String,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable as DateTime,deletedAt: freezed == deletedAt ? _self.deletedAt : deletedAt // ignore: cast_nullable_to_non_nullable as DateTime?, @@ -668,7 +668,7 @@ class _SnAccountBadge implements SnAccountBadge { } @override final DateTime? expiredAt; -@override final int accountId; +@override final String accountId; @override final DateTime createdAt; @override final DateTime updatedAt; @override final DateTime? deletedAt; @@ -706,7 +706,7 @@ abstract mixin class _$SnAccountBadgeCopyWith<$Res> implements $SnAccountBadgeCo factory _$SnAccountBadgeCopyWith(_SnAccountBadge value, $Res Function(_SnAccountBadge) _then) = __$SnAccountBadgeCopyWithImpl; @override @useResult $Res call({ - String id, String type, String? label, String? caption, Map meta, DateTime? expiredAt, int accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt + String id, String type, String? label, String? caption, Map meta, DateTime? expiredAt, String accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt }); @@ -732,7 +732,7 @@ as String?,caption: freezed == caption ? _self.caption : caption // ignore: cast as String?,meta: null == meta ? _self._meta : meta // ignore: cast_nullable_to_non_nullable as Map,expiredAt: freezed == expiredAt ? _self.expiredAt : expiredAt // ignore: cast_nullable_to_non_nullable as DateTime?,accountId: null == accountId ? _self.accountId : accountId // ignore: cast_nullable_to_non_nullable -as int,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable +as String,createdAt: null == createdAt ? _self.createdAt : createdAt // ignore: cast_nullable_to_non_nullable as DateTime,updatedAt: null == updatedAt ? _self.updatedAt : updatedAt // ignore: cast_nullable_to_non_nullable as DateTime,deletedAt: freezed == deletedAt ? _self.deletedAt : deletedAt // ignore: cast_nullable_to_non_nullable as DateTime?, diff --git a/lib/models/user.g.dart b/lib/models/user.g.dart index c785488..f1a5145 100644 --- a/lib/models/user.g.dart +++ b/lib/models/user.g.dart @@ -7,7 +7,7 @@ part of 'user.dart'; // ************************************************************************** _SnAccount _$SnAccountFromJson(Map json) => _SnAccount( - id: (json['id'] as num).toInt(), + id: json['id'] as String, name: json['name'] as String, nick: json['nick'] as String, language: json['language'] as String, @@ -42,7 +42,7 @@ Map _$SnAccountToJson(_SnAccount instance) => _SnAccountProfile _$SnAccountProfileFromJson(Map json) => _SnAccountProfile( - id: (json['id'] as num).toInt(), + id: json['id'] as String, firstName: json['first_name'] as String?, middleName: json['middle_name'] as String?, lastName: json['last_name'] as String?, @@ -96,7 +96,7 @@ _SnAccountStatus _$SnAccountStatusFromJson(Map json) => json['cleared_at'] == null ? null : DateTime.parse(json['cleared_at'] as String), - accountId: (json['account_id'] as num).toInt(), + accountId: json['account_id'] as String, createdAt: DateTime.parse(json['created_at'] as String), updatedAt: DateTime.parse(json['updated_at'] as String), deletedAt: @@ -132,7 +132,7 @@ _SnAccountBadge _$SnAccountBadgeFromJson(Map json) => json['expired_at'] == null ? null : DateTime.parse(json['expired_at'] as String), - accountId: (json['account_id'] as num).toInt(), + accountId: json['account_id'] as String, createdAt: DateTime.parse(json['created_at'] as String), updatedAt: DateTime.parse(json['updated_at'] as String), deletedAt: diff --git a/lib/route.gr.dart b/lib/route.gr.dart index d1dc0da..7a73320 100644 --- a/lib/route.gr.dart +++ b/lib/route.gr.dart @@ -98,7 +98,7 @@ class AccountRoute extends _i23.PageRouteInfo { class ChatDetailRoute extends _i23.PageRouteInfo { ChatDetailRoute({ _i24.Key? key, - required int id, + required String id, List<_i23.PageRouteInfo>? children, }) : super( ChatDetailRoute.name, @@ -114,7 +114,7 @@ class ChatDetailRoute extends _i23.PageRouteInfo { builder: (data) { final pathParams = data.inheritedPathParams; final args = data.argsAs( - orElse: () => ChatDetailRouteArgs(id: pathParams.getInt('id')), + orElse: () => ChatDetailRouteArgs(id: pathParams.getString('id')), ); return _i3.ChatDetailScreen(key: args.key, id: args.id); }, @@ -126,7 +126,7 @@ class ChatDetailRouteArgs { final _i24.Key? key; - final int id; + final String id; @override String toString() { @@ -155,7 +155,7 @@ class ChatListRoute extends _i23.PageRouteInfo { class ChatRoomRoute extends _i23.PageRouteInfo { ChatRoomRoute({ _i24.Key? key, - required int id, + required String id, List<_i23.PageRouteInfo>? children, }) : super( ChatRoomRoute.name, @@ -171,7 +171,7 @@ class ChatRoomRoute extends _i23.PageRouteInfo { builder: (data) { final pathParams = data.inheritedPathParams; final args = data.argsAs( - orElse: () => ChatRoomRouteArgs(id: pathParams.getInt('id')), + orElse: () => ChatRoomRouteArgs(id: pathParams.getString('id')), ); return _i5.ChatRoomScreen(key: args.key, id: args.id); }, @@ -183,7 +183,7 @@ class ChatRoomRouteArgs { final _i24.Key? key; - final int id; + final String id; @override String toString() { @@ -226,7 +226,7 @@ class CreatorHubRoute extends _i23.PageRouteInfo { /// generated route for /// [_i4.EditChatScreen] class EditChatRoute extends _i23.PageRouteInfo { - EditChatRoute({_i24.Key? key, int? id, List<_i23.PageRouteInfo>? children}) + EditChatRoute({_i24.Key? key, String? id, List<_i23.PageRouteInfo>? children}) : super( EditChatRoute.name, args: EditChatRouteArgs(key: key, id: id), @@ -241,7 +241,7 @@ class EditChatRoute extends _i23.PageRouteInfo { builder: (data) { final pathParams = data.inheritedPathParams; final args = data.argsAs( - orElse: () => EditChatRouteArgs(id: pathParams.optInt('id')), + orElse: () => EditChatRouteArgs(id: pathParams.optString('id')), ); return _i4.EditChatScreen(key: args.key, id: args.id); }, @@ -253,7 +253,7 @@ class EditChatRouteArgs { final _i24.Key? key; - final int? id; + final String? id; @override String toString() { @@ -721,7 +721,7 @@ class PostComposeRouteArgs { class PostDetailRoute extends _i23.PageRouteInfo { PostDetailRoute({ _i24.Key? key, - required int id, + required String id, List<_i23.PageRouteInfo>? children, }) : super( PostDetailRoute.name, @@ -737,7 +737,7 @@ class PostDetailRoute extends _i23.PageRouteInfo { builder: (data) { final pathParams = data.inheritedPathParams; final args = data.argsAs( - orElse: () => PostDetailRouteArgs(id: pathParams.getInt('id')), + orElse: () => PostDetailRouteArgs(id: pathParams.getString('id')), ); return _i17.PostDetailScreen(key: args.key, id: args.id); }, @@ -749,7 +749,7 @@ class PostDetailRouteArgs { final _i24.Key? key; - final int id; + final String id; @override String toString() { @@ -762,7 +762,7 @@ class PostDetailRouteArgs { class PostEditRoute extends _i23.PageRouteInfo { PostEditRoute({ _i24.Key? key, - required int id, + required String id, List<_i23.PageRouteInfo>? children, }) : super( PostEditRoute.name, @@ -778,7 +778,7 @@ class PostEditRoute extends _i23.PageRouteInfo { builder: (data) { final pathParams = data.inheritedPathParams; final args = data.argsAs( - orElse: () => PostEditRouteArgs(id: pathParams.getInt('id')), + orElse: () => PostEditRouteArgs(id: pathParams.getString('id')), ); return _i16.PostEditScreen(key: args.key, id: args.id); }, @@ -790,7 +790,7 @@ class PostEditRouteArgs { final _i24.Key? key; - final int id; + final String id; @override String toString() { diff --git a/lib/screens/auth/login.dart b/lib/screens/auth/login.dart index 1568fce..2b2ac2e 100644 --- a/lib/screens/auth/login.dart +++ b/lib/screens/auth/login.dart @@ -232,7 +232,7 @@ class _LoginPickerScreen extends HookConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { final isBusy = useState(false); - final factorPicked = useState(null); + final factorPicked = useState(null); final unfocusColor = Theme.of( context, diff --git a/lib/screens/chat/chat.dart b/lib/screens/chat/chat.dart index 52f92a1..5f4cbe4 100644 --- a/lib/screens/chat/chat.dart +++ b/lib/screens/chat/chat.dart @@ -191,7 +191,7 @@ class ChatListScreen extends HookConsumerWidget { } @riverpod -Future chatroom(Ref ref, int? identifier) async { +Future chatroom(Ref ref, String? identifier) async { if (identifier == null) return null; final client = ref.watch(apiClientProvider); final resp = await client.get('/chat/$identifier'); @@ -199,7 +199,7 @@ Future chatroom(Ref ref, int? identifier) async { } @riverpod -Future chatroomIdentity(Ref ref, int? identifier) async { +Future chatroomIdentity(Ref ref, String? identifier) async { if (identifier == null) return null; final client = ref.watch(apiClientProvider); final resp = await client.get('/chat/$identifier/members/me'); @@ -218,7 +218,7 @@ class NewChatScreen extends StatelessWidget { @RoutePage() class EditChatScreen extends HookConsumerWidget { - final int? id; + final String? id; const EditChatScreen({super.key, @PathParam("id") this.id}); @override diff --git a/lib/screens/chat/chat.g.dart b/lib/screens/chat/chat.g.dart index 7b20b7b..c9d6d91 100644 --- a/lib/screens/chat/chat.g.dart +++ b/lib/screens/chat/chat.g.dart @@ -25,7 +25,7 @@ final chatroomsJoinedProvider = @Deprecated('Will be removed in 3.0. Use Ref instead') // ignore: unused_element typedef ChatroomsJoinedRef = AutoDisposeFutureProviderRef>; -String _$chatroomHash() => r'3a945a61ea434f860fbeae9d40778fbfceddc5db'; +String _$chatroomHash() => r'dce3c0fc407f178bb7c306a08b9fa545795a9205'; /// Copied from Dart SDK class _SystemHash { @@ -58,7 +58,7 @@ class ChatroomFamily extends Family> { const ChatroomFamily(); /// See also [chatroom]. - ChatroomProvider call(int? identifier) { + ChatroomProvider call(String? identifier) { return ChatroomProvider(identifier); } @@ -85,7 +85,7 @@ class ChatroomFamily extends Family> { /// See also [chatroom]. class ChatroomProvider extends AutoDisposeFutureProvider { /// See also [chatroom]. - ChatroomProvider(int? identifier) + ChatroomProvider(String? identifier) : this._internal( (ref) => chatroom(ref as ChatroomRef, identifier), from: chatroomProvider, @@ -109,7 +109,7 @@ class ChatroomProvider extends AutoDisposeFutureProvider { required this.identifier, }) : super.internal(); - final int? identifier; + final String? identifier; @override Override overrideWith( @@ -152,7 +152,7 @@ class ChatroomProvider extends AutoDisposeFutureProvider { // ignore: unused_element mixin ChatroomRef on AutoDisposeFutureProviderRef { /// The parameter `identifier` of this provider. - int? get identifier; + String? get identifier; } class _ChatroomProviderElement @@ -161,10 +161,10 @@ class _ChatroomProviderElement _ChatroomProviderElement(super.provider); @override - int? get identifier => (origin as ChatroomProvider).identifier; + String? get identifier => (origin as ChatroomProvider).identifier; } -String _$chatroomIdentityHash() => r'b20322591279d0336f2f309729e7e0cb9809063f'; +String _$chatroomIdentityHash() => r'4c349ea4265df7b0498cf26c82dbaabe3d868727'; /// See also [chatroomIdentity]. @ProviderFor(chatroomIdentity) @@ -176,7 +176,7 @@ class ChatroomIdentityFamily extends Family> { const ChatroomIdentityFamily(); /// See also [chatroomIdentity]. - ChatroomIdentityProvider call(int? identifier) { + ChatroomIdentityProvider call(String? identifier) { return ChatroomIdentityProvider(identifier); } @@ -206,7 +206,7 @@ class ChatroomIdentityFamily extends Family> { class ChatroomIdentityProvider extends AutoDisposeFutureProvider { /// See also [chatroomIdentity]. - ChatroomIdentityProvider(int? identifier) + ChatroomIdentityProvider(String? identifier) : this._internal( (ref) => chatroomIdentity(ref as ChatroomIdentityRef, identifier), from: chatroomIdentityProvider, @@ -231,7 +231,7 @@ class ChatroomIdentityProvider required this.identifier, }) : super.internal(); - final int? identifier; + final String? identifier; @override Override overrideWith( @@ -274,7 +274,7 @@ class ChatroomIdentityProvider // ignore: unused_element mixin ChatroomIdentityRef on AutoDisposeFutureProviderRef { /// The parameter `identifier` of this provider. - int? get identifier; + String? get identifier; } class _ChatroomIdentityProviderElement @@ -283,7 +283,7 @@ class _ChatroomIdentityProviderElement _ChatroomIdentityProviderElement(super.provider); @override - int? get identifier => (origin as ChatroomIdentityProvider).identifier; + String? get identifier => (origin as ChatroomIdentityProvider).identifier; } String _$chatroomInvitesHash() => r'c15f06c1e9c6074e6159d9d1f4404f31250ce523'; diff --git a/lib/screens/chat/room.dart b/lib/screens/chat/room.dart index 845632e..6c485dd 100644 --- a/lib/screens/chat/room.dart +++ b/lib/screens/chat/room.dart @@ -24,27 +24,26 @@ import 'package:super_context_menu/super_context_menu.dart'; import 'package:uuid/uuid.dart'; import 'chat.dart'; -final messageRepositoryProvider = FutureProvider.family( - (ref, roomId) async { - final room = await ref.watch(chatroomProvider(roomId).future); - final identity = await ref.watch(chatroomIdentityProvider(roomId).future); - final apiClient = ref.watch(apiClientProvider); - final database = ref.watch(databaseProvider); - return MessageRepository(room!, identity!, apiClient, database); - }, -); +final messageRepositoryProvider = + FutureProvider.family((ref, roomId) async { + final room = await ref.watch(chatroomProvider(roomId).future); + final identity = await ref.watch(chatroomIdentityProvider(roomId).future); + final apiClient = ref.watch(apiClientProvider); + final database = ref.watch(databaseProvider); + return MessageRepository(room!, identity!, apiClient, database); + }); // Provider for messages with pagination final messagesProvider = StateNotifierProvider.family< MessagesNotifier, AsyncValue>, - int + String >((ref, roomId) => MessagesNotifier(ref, roomId)); class MessagesNotifier extends StateNotifier>> { final Ref _ref; - final int _roomId; + final String _roomId; int _currentPage = 0; static const int _pageSize = 20; bool _hasMore = true; @@ -334,7 +333,7 @@ class MessagesNotifier @RoutePage() class ChatRoomScreen extends HookConsumerWidget { - final int id; + final String id; const ChatRoomScreen({super.key, @PathParam("id") required this.id}); @override diff --git a/lib/screens/chat/room_detail.dart b/lib/screens/chat/room_detail.dart index 96f441d..7df73c5 100644 --- a/lib/screens/chat/room_detail.dart +++ b/lib/screens/chat/room_detail.dart @@ -21,7 +21,7 @@ part 'room_detail.freezed.dart'; @RoutePage() class ChatDetailScreen extends HookConsumerWidget { - final int id; + final String id; const ChatDetailScreen({super.key, @PathParam("id") required this.id}); @override @@ -129,7 +129,7 @@ class ChatDetailScreen extends HookConsumerWidget { } class _ChatRoomActionMenu extends HookConsumerWidget { - final int id; + final String id; final Shadow iconShadow; const _ChatRoomActionMenu({required this.id, required this.iconShadow}); @@ -199,17 +199,17 @@ abstract class ChatRoomMemberState with _$ChatRoomMemberState { }) = _ChatRoomMemberState; } -final chatMemberStateProvider = - StateNotifierProvider.family(( - ref, - roomId, - ) { - final apiClient = ref.watch(apiClientProvider); - return ChatMemberNotifier(apiClient, roomId); - }); +final chatMemberStateProvider = StateNotifierProvider.family< + ChatMemberNotifier, + ChatRoomMemberState, + String +>((ref, roomId) { + final apiClient = ref.watch(apiClientProvider); + return ChatMemberNotifier(apiClient, roomId); +}); class ChatMemberNotifier extends StateNotifier { - final int roomId; + final String roomId; final Dio _apiClient; ChatMemberNotifier(this._apiClient, this.roomId) @@ -247,7 +247,7 @@ class ChatMemberNotifier extends StateNotifier { } class _ChatMemberListSheet extends HookConsumerWidget { - final int roomId; + final String roomId; const _ChatMemberListSheet({required this.roomId}); @override diff --git a/lib/screens/posts/compose.dart b/lib/screens/posts/compose.dart index 08893e7..bee9b24 100644 --- a/lib/screens/posts/compose.dart +++ b/lib/screens/posts/compose.dart @@ -27,7 +27,7 @@ import 'package:styled_widget/styled_widget.dart'; @RoutePage() class PostEditScreen extends HookConsumerWidget { - final int id; + final String id; const PostEditScreen({super.key, @PathParam('id') required this.id}); @override diff --git a/lib/screens/posts/detail.dart b/lib/screens/posts/detail.dart index 2d4e724..cd0dd8f 100644 --- a/lib/screens/posts/detail.dart +++ b/lib/screens/posts/detail.dart @@ -14,7 +14,7 @@ import 'package:styled_widget/styled_widget.dart'; part 'detail.g.dart'; @riverpod -Future post(Ref ref, int id) async { +Future post(Ref ref, String id) async { final client = ref.watch(apiClientProvider); final resp = await client.get('/posts/$id'); return SnPost.fromJson(resp.data); @@ -22,7 +22,7 @@ Future post(Ref ref, int id) async { @RoutePage() class PostDetailScreen extends HookConsumerWidget { - final int id; + final String id; const PostDetailScreen({super.key, @PathParam('id') required this.id}); @override diff --git a/lib/screens/posts/detail.g.dart b/lib/screens/posts/detail.g.dart index adee3ac..d196b89 100644 --- a/lib/screens/posts/detail.g.dart +++ b/lib/screens/posts/detail.g.dart @@ -6,7 +6,7 @@ part of 'detail.dart'; // RiverpodGenerator // ************************************************************************** -String _$postHash() => r'58de03954e284b5c04544b61ccb9cadfc45e9422'; +String _$postHash() => r'a5f66f47ed0eaef57e49518f6b764cdbfa725ad8'; /// Copied from Dart SDK class _SystemHash { @@ -39,7 +39,7 @@ class PostFamily extends Family> { const PostFamily(); /// See also [post]. - PostProvider call(int id) { + PostProvider call(String id) { return PostProvider(id); } @@ -66,7 +66,7 @@ class PostFamily extends Family> { /// See also [post]. class PostProvider extends AutoDisposeFutureProvider { /// See also [post]. - PostProvider(int id) + PostProvider(String id) : this._internal( (ref) => post(ref as PostRef, id), from: postProvider, @@ -88,7 +88,7 @@ class PostProvider extends AutoDisposeFutureProvider { required this.id, }) : super.internal(); - final int id; + final String id; @override Override overrideWith(FutureOr Function(PostRef provider) create) { @@ -129,7 +129,7 @@ class PostProvider extends AutoDisposeFutureProvider { // ignore: unused_element mixin PostRef on AutoDisposeFutureProviderRef { /// The parameter `id` of this provider. - int get id; + String get id; } class _PostProviderElement extends AutoDisposeFutureProviderElement @@ -137,7 +137,7 @@ class _PostProviderElement extends AutoDisposeFutureProviderElement _PostProviderElement(super.provider); @override - int get id => (origin as PostProvider).id; + String get id => (origin as PostProvider).id; } // ignore_for_file: type=lint diff --git a/lib/widgets/post/post_item.dart b/lib/widgets/post/post_item.dart index 6135765..d201ba2 100644 --- a/lib/widgets/post/post_item.dart +++ b/lib/widgets/post/post_item.dart @@ -169,7 +169,7 @@ class PostItem extends HookConsumerWidget { } class PostReactionList extends HookConsumerWidget { - final int parentId; + final String parentId; final Map reactions; final Function(String symbol, int attitude, int delta) onReact; final EdgeInsets? padding; diff --git a/lib/widgets/post/post_replies.dart b/lib/widgets/post/post_replies.dart index 44e53f7..ad7ef0b 100644 --- a/lib/widgets/post/post_replies.dart +++ b/lib/widgets/post/post_replies.dart @@ -8,7 +8,7 @@ import 'package:styled_widget/styled_widget.dart'; import 'package:very_good_infinite_list/very_good_infinite_list.dart'; class PostRepliesList extends HookConsumerWidget { - final int postId; + final String postId; const PostRepliesList({super.key, required this.postId}); @override @@ -68,21 +68,19 @@ class PostRepliesList extends HookConsumerWidget { } } -final postRepliesProvider = FutureProviderFamily<_PostRepliesController, int>(( - ref, - postId, -) async { - final client = ref.watch(apiClientProvider); - final controller = _PostRepliesController(client, postId); - await controller.fetchMore(); - return controller; -}); +final postRepliesProvider = + FutureProviderFamily<_PostRepliesController, String>((ref, postId) async { + final client = ref.watch(apiClientProvider); + final controller = _PostRepliesController(client, postId); + await controller.fetchMore(); + return controller; + }); class _PostRepliesController { _PostRepliesController(this._dio, this.parentId); final Dio _dio; - final int parentId; + final String parentId; final List posts = []; bool isLoading = false; bool hasReachedMax = false;