💥 Switch all id to uuid

This commit is contained in:
LittleSheep 2025-05-14 20:03:57 +08:00
parent 661d07716b
commit 2759c009ad
33 changed files with 360 additions and 282 deletions

View File

@ -14,7 +14,7 @@ class AppDatabase extends _$AppDatabase {
// Methods for chat messages
Future<List<ChatMessage>> getMessagesForRoom(
int roomId, {
String roomId, {
int offset = 0,
int limit = 20,
}) {

View File

@ -20,11 +20,11 @@ class $ChatMessagesTable extends ChatMessages
);
static const VerificationMeta _roomIdMeta = const VerificationMeta('roomId');
@override
late final GeneratedColumn<int> roomId = GeneratedColumn<int>(
late final GeneratedColumn<String> roomId = GeneratedColumn<String>(
'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<ChatMessage> {
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<ChatMessage> {
Map<String, Expression> toColumns(bool nullToAbsent) {
final map = <String, Expression>{};
map['id'] = Variable<String>(id);
map['room_id'] = Variable<int>(roomId);
map['room_id'] = Variable<String>(roomId);
map['sender_id'] = Variable<String>(senderId);
if (!nullToAbsent || content != null) {
map['content'] = Variable<String>(content);
@ -284,7 +284,7 @@ class ChatMessage extends DataClass implements Insertable<ChatMessage> {
serializer ??= driftRuntimeOptions.defaultSerializer;
return ChatMessage(
id: serializer.fromJson<String>(json['id']),
roomId: serializer.fromJson<int>(json['roomId']),
roomId: serializer.fromJson<String>(json['roomId']),
senderId: serializer.fromJson<String>(json['senderId']),
content: serializer.fromJson<String?>(json['content']),
nonce: serializer.fromJson<String?>(json['nonce']),
@ -300,7 +300,7 @@ class ChatMessage extends DataClass implements Insertable<ChatMessage> {
serializer ??= driftRuntimeOptions.defaultSerializer;
return <String, dynamic>{
'id': serializer.toJson<String>(id),
'roomId': serializer.toJson<int>(roomId),
'roomId': serializer.toJson<String>(roomId),
'senderId': serializer.toJson<String>(senderId),
'content': serializer.toJson<String?>(content),
'nonce': serializer.toJson<String?>(nonce),
@ -314,7 +314,7 @@ class ChatMessage extends DataClass implements Insertable<ChatMessage> {
ChatMessage copyWith({
String? id,
int? roomId,
String? roomId,
String? senderId,
Value<String?> content = const Value.absent(),
Value<String?> nonce = const Value.absent(),
@ -386,7 +386,7 @@ class ChatMessage extends DataClass implements Insertable<ChatMessage> {
class ChatMessagesCompanion extends UpdateCompanion<ChatMessage> {
final Value<String> id;
final Value<int> roomId;
final Value<String> roomId;
final Value<String> senderId;
final Value<String?> content;
final Value<String?> nonce;
@ -407,7 +407,7 @@ class ChatMessagesCompanion extends UpdateCompanion<ChatMessage> {
});
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<ChatMessage> {
status = Value(status);
static Insertable<ChatMessage> custom({
Expression<String>? id,
Expression<int>? roomId,
Expression<String>? roomId,
Expression<String>? senderId,
Expression<String>? content,
Expression<String>? nonce,
@ -447,7 +447,7 @@ class ChatMessagesCompanion extends UpdateCompanion<ChatMessage> {
ChatMessagesCompanion copyWith({
Value<String>? id,
Value<int>? roomId,
Value<String>? roomId,
Value<String>? senderId,
Value<String?>? content,
Value<String?>? nonce,
@ -476,7 +476,7 @@ class ChatMessagesCompanion extends UpdateCompanion<ChatMessage> {
map['id'] = Variable<String>(id.value);
}
if (roomId.present) {
map['room_id'] = Variable<int>(roomId.value);
map['room_id'] = Variable<String>(roomId.value);
}
if (senderId.present) {
map['sender_id'] = Variable<String>(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<String?> content,
Value<String?> nonce,
@ -547,7 +547,7 @@ typedef $$ChatMessagesTableCreateCompanionBuilder =
typedef $$ChatMessagesTableUpdateCompanionBuilder =
ChatMessagesCompanion Function({
Value<String> id,
Value<int> roomId,
Value<String> roomId,
Value<String> senderId,
Value<String?> content,
Value<String?> nonce,
@ -571,7 +571,7 @@ class $$ChatMessagesTableFilterComposer
builder: (column) => ColumnFilters(column),
);
ColumnFilters<int> get roomId => $composableBuilder(
ColumnFilters<String> get roomId => $composableBuilder(
column: $table.roomId,
builder: (column) => ColumnFilters(column),
);
@ -622,7 +622,7 @@ class $$ChatMessagesTableOrderingComposer
builder: (column) => ColumnOrderings(column),
);
ColumnOrderings<int> get roomId => $composableBuilder(
ColumnOrderings<String> get roomId => $composableBuilder(
column: $table.roomId,
builder: (column) => ColumnOrderings(column),
);
@ -670,7 +670,7 @@ class $$ChatMessagesTableAnnotationComposer
GeneratedColumn<String> get id =>
$composableBuilder(column: $table.id, builder: (column) => column);
GeneratedColumn<int> get roomId =>
GeneratedColumn<String> get roomId =>
$composableBuilder(column: $table.roomId, builder: (column) => column);
GeneratedColumn<String> get senderId =>
@ -725,7 +725,7 @@ class $$ChatMessagesTableTableManager
updateCompanionCallback:
({
Value<String> id = const Value.absent(),
Value<int> roomId = const Value.absent(),
Value<String> roomId = const Value.absent(),
Value<String> senderId = const Value.absent(),
Value<String?> content = const Value.absent(),
Value<String?> nonce = const Value.absent(),
@ -747,7 +747,7 @@ class $$ChatMessagesTableTableManager
createCompanionCallback:
({
required String id,
required int roomId,
required String roomId,
required String senderId,
Value<String?> content = const Value.absent(),
Value<String?> nonce = const Value.absent(),

View File

@ -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<String, dynamic> data;
final DateTime createdAt;

View File

@ -102,7 +102,7 @@ class MessageRepository {
}
Future<List<LocalChatMessage>> _getCachedMessages(
int roomId, {
String roomId, {
int offset = 0,
int take = 20,
}) async {
@ -136,7 +136,7 @@ class MessageRepository {
}
Future<List<LocalChatMessage>> _fetchAndCacheMessages(
int roomId, {
String roomId, {
int offset = 0,
int take = 20,
}) async {
@ -172,7 +172,7 @@ class MessageRepository {
Future<LocalChatMessage> sendMessage(
String atk,
String baseUrl,
int roomId,
String roomId,
String content,
String nonce, {
required List<UniversalFile> attachments,

View File

@ -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<SnFortuneTip> tips,
required int accountId,
required String accountId,
required SnAccount? account,
required DateTime createdAt,
required DateTime updatedAt,

View File

@ -16,7 +16,7 @@ T _$identity<T>(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<SnFortuneTip> get tips; int get accountId; SnAccount? get account; DateTime get createdAt; DateTime get updatedAt; DateTime? get deletedAt;
String get id; int get level; List<SnFortuneTip> 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<SnFortuneTip> tips, int accountId, SnAccount? account, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt
String id, int level, List<SnFortuneTip> 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<SnFortuneTip>,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<SnFortuneTip> tips, int accountId, SnAccount? account, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt
String id, int level, List<SnFortuneTip> 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<SnFortuneTip>,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

View File

@ -11,7 +11,7 @@ _SnActivity _$SnActivityFromJson(Map<String, dynamic> 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<String, dynamic>),
data: json['data'],
createdAt: DateTime.parse(json['created_at'] as String),
@ -41,7 +41,7 @@ _SnCheckInResult _$SnCheckInResultFromJson(Map<String, dynamic> json) =>
(json['tips'] as List<dynamic>)
.map((e) => SnFortuneTip.fromJson(e as Map<String, dynamic>))
.toList(),
accountId: (json['account_id'] as num).toInt(),
accountId: json['account_id'] as String,
account:
json['account'] == null
? null

View File

@ -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,

View File

@ -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<String, dynamic> 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

View File

@ -64,7 +64,7 @@ Map<String, dynamic> _$SnAuthChallengeToJson(_SnAuthChallenge instance) =>
_SnAuthFactor _$SnAuthFactorFromJson(Map<String, dynamic> 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),

View File

@ -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<String, dynamic> 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,

View File

@ -16,7 +16,7 @@ T _$identity<T>(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<SnChatMember>? 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<SnChatMember>? 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<SnChatMember>? 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<SnChatMember>? 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<SnChatMember>? members}): _members = members;
factory _SnChatRoom.fromJson(Map<String, dynamic> 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<SnChatMember>? 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<SnChatMember>? 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<String, dynamic> get meta; List<String> get membersMetioned; DateTime? get editedAt; List<SnCloudFile> get attachments; List<SnChatReaction> 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<String, dynamic> get meta; List<String> get membersMetioned; DateTime? get editedAt; List<SnCloudFile> get attachments; List<SnChatReaction> 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<String, dynamic> meta, List<String> membersMetioned, DateTime? editedAt, List<SnCloudFile> attachments, List<SnChatReaction> reactions, String? repliedMessageId, String? forwardedMessageId, String senderId, SnChatMember sender, int chatRoomId
DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, String id, String? content, String? nonce, Map<String, dynamic> meta, List<String> membersMetioned, DateTime? editedAt, List<SnCloudFile> attachments, List<SnChatReaction> 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<String, dynamic> meta, List<String> membersMetioned, DateTime? editedAt, List<SnCloudFile> attachments, List<SnChatReaction> reactions, String? repliedMessageId, String? forwardedMessageId, String senderId, SnChatMember sender, int chatRoomId
DateTime createdAt, DateTime updatedAt, DateTime? deletedAt, String id, String? content, String? nonce, Map<String, dynamic> meta, List<String> membersMetioned, DateTime? editedAt, List<SnCloudFile> attachments, List<SnChatReaction> 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

View File

@ -7,7 +7,7 @@ part of 'chat.dart';
// **************************************************************************
_SnChatRoom _$SnChatRoomFromJson(Map<String, dynamic> 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<String, dynamic> json) => _SnChatRoom(
json['background'] == null
? null
: SnCloudFile.fromJson(json['background'] as Map<String, dynamic>),
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<String, dynamic> json) =>
forwardedMessageId: json['forwarded_message_id'] as String?,
senderId: json['sender_id'] as String,
sender: SnChatMember.fromJson(json['sender'] as Map<String, dynamic>),
chatRoomId: (json['chat_room_id'] as num).toInt(),
chatRoomId: json['chat_room_id'] as String,
);
Map<String, dynamic> _$SnChatMessageToJson(_SnChatMessage instance) =>
@ -154,12 +154,12 @@ _SnChatMember _$SnChatMemberFromJson(Map<String, dynamic> 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<String, dynamic>),
accountId: (json['account_id'] as num).toInt(),
accountId: json['account_id'] as String,
account: SnAccount.fromJson(json['account'] as Map<String, dynamic>),
nick: json['nick'] as String?,
role: (json['role'] as num).toInt(),

View File

@ -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<SnCloudFile> attachments,
required SnPublisher publisher,
@Default({}) Map<String, int> 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,

View File

@ -16,7 +16,7 @@ T _$identity<T>(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<String, dynamic>? 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<SnCloudFile> get attachments; SnPublisher get publisher; Map<String, int> get reactionsCount; List<dynamic> get reactions; List<dynamic> get tags; List<dynamic> get categories; List<dynamic> 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<String, dynamic>? 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<SnCloudFile> get attachments; SnPublisher get publisher; Map<String, int> get reactionsCount; List<dynamic> get reactions; List<dynamic> get tags; List<dynamic> get categories; List<dynamic> 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<SnPost> get copyWith => _$SnPostCopyWithImpl<SnPost>(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<String, dynamic>? meta, int viewsUnique, int viewsTotal, int upvotes, int downvotes, dynamic threadedPostId, dynamic threadedPost, dynamic repliedPostId, dynamic repliedPost, dynamic forwardedPostId, dynamic forwardedPost, List<SnCloudFile> attachments, SnPublisher publisher, Map<String, int> reactionsCount, List<dynamic> reactions, List<dynamic> tags, List<dynamic> categories, List<dynamic> 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<String, dynamic>? meta, int viewsUnique, int viewsTotal, int upvotes, int downvotes, String? threadedPostId, SnPost? threadedPost, String? repliedPostId, SnPost? repliedPost, String? forwardedPostId, SnPost? forwardedPost, List<SnCloudFile> attachments, SnPublisher publisher, Map<String, int> reactionsCount, List<dynamic> reactions, List<dynamic> tags, List<dynamic> categories, List<dynamic> 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<SnCloudFile>,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<String, int>,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<String, dynamic>? 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<SnCloudFile> attachments, required this.publisher, final Map<String, int> reactionsCount = const {}, required final List<dynamic> reactions, required final List<dynamic> tags, required final List<dynamic> categories, required final List<dynamic> 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<String, dynamic> 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<SnCloudFile> _attachments;
@override List<SnCloudFile> get attachments {
if (_attachments is EqualUnmodifiableListView) return _attachments;
@ -209,12 +245,12 @@ Map<String, dynamic> 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<String, dynamic>? meta, int viewsUnique, int viewsTotal, int upvotes, int downvotes, dynamic threadedPostId, dynamic threadedPost, dynamic repliedPostId, dynamic repliedPost, dynamic forwardedPostId, dynamic forwardedPost, List<SnCloudFile> attachments, SnPublisher publisher, Map<String, int> reactionsCount, List<dynamic> reactions, List<dynamic> tags, List<dynamic> categories, List<dynamic> 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<String, dynamic>? meta, int viewsUnique, int viewsTotal, int upvotes, int downvotes, String? threadedPostId, SnPost? threadedPost, String? repliedPostId, SnPost? repliedPost, String? forwardedPostId, SnPost? forwardedPost, List<SnCloudFile> attachments, SnPublisher publisher, Map<String, int> reactionsCount, List<dynamic> reactions, List<dynamic> tags, List<dynamic> categories, List<dynamic> 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<SnCloudFile>,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<String, int>,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<String, dynamic> 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?,

View File

@ -7,7 +7,7 @@ part of 'post.dart';
// **************************************************************************
_SnPost _$SnPostFromJson(Map<String, dynamic> 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<String, dynamic> 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<String, dynamic>),
repliedPostId: json['replied_post_id'] as String?,
repliedPost:
json['replied_post'] == null
? null
: SnPost.fromJson(json['replied_post'] as Map<String, dynamic>),
forwardedPostId: json['forwarded_post_id'] as String?,
forwardedPost:
json['forwarded_post'] == null
? null
: SnPost.fromJson(json['forwarded_post'] as Map<String, dynamic>),
attachments:
(json['attachments'] as List<dynamic>)
.map((e) => SnCloudFile.fromJson(e as Map<String, dynamic>))
@ -68,11 +77,11 @@ Map<String, dynamic> _$SnPostToJson(_SnPost instance) => <String, dynamic>{
'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<String, dynamic> _$SnPostToJson(_SnPost instance) => <String, dynamic>{
};
_SnPublisher _$SnPublisherFromJson(Map<String, dynamic> 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<String, dynamic> json) => _SnPublisher(
json['background'] == null
? null
: SnCloudFile.fromJson(json['background'] as Map<String, dynamic>),
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:

View File

@ -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,

View File

@ -16,7 +16,7 @@ T _$identity<T>(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<String, dynamic> 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<String, dynamic> 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

View File

@ -7,7 +7,7 @@ part of 'realm.dart';
// **************************************************************************
_SnRealm _$SnRealmFromJson(Map<String, dynamic> 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<String, dynamic> json) => _SnRealm(
json['background'] == null
? null
: SnCloudFile.fromJson(json['background'] as Map<String, dynamic>),
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<String, dynamic> _$SnRealmToJson(_SnRealm instance) => <String, dynamic>{
_SnRealmMember _$SnRealmMemberFromJson(Map<String, dynamic> 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<String, dynamic>),
accountId: (json['account_id'] as num).toInt(),
accountId: json['account_id'] as String,
account:
json['account'] == null
? null

View File

@ -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<String, dynamic> meta,
required DateTime? expiredAt,
required int accountId,
required String accountId,
required DateTime createdAt,
required DateTime updatedAt,
required DateTime? deletedAt,

View File

@ -16,7 +16,7 @@ T _$identity<T>(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<SnAccountBadge> 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<SnAccountBadge> 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<SnAccountBadge> badges, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt
String id, String name, String nick, String language, bool isSuperuser, SnAccountProfile profile, List<SnAccountBadge> 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<SnAccountBadge> badges = const [], required this.createdAt, required this.updatedAt, required this.deletedAt}): _badges = badges;
factory _SnAccount.fromJson(Map<String, dynamic> 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<SnAccountBadge> badges, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt
String id, String name, String nick, String language, bool isSuperuser, SnAccountProfile profile, List<SnAccountBadge> 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<String, dynamic> 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<String, dynamic> 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<String, dynamic> 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<String, dynamic> meta, DateTime? expiredAt, int accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt
String id, String type, String? label, String? caption, Map<String, dynamic> 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<String, dynamic>,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<String, dynamic> meta, DateTime? expiredAt, int accountId, DateTime createdAt, DateTime updatedAt, DateTime? deletedAt
String id, String type, String? label, String? caption, Map<String, dynamic> 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<String, dynamic>,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?,

View File

@ -7,7 +7,7 @@ part of 'user.dart';
// **************************************************************************
_SnAccount _$SnAccountFromJson(Map<String, dynamic> 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<String, dynamic> _$SnAccountToJson(_SnAccount instance) =>
_SnAccountProfile _$SnAccountProfileFromJson(Map<String, dynamic> 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<String, dynamic> 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<String, dynamic> 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:

View File

@ -98,7 +98,7 @@ class AccountRoute extends _i23.PageRouteInfo<void> {
class ChatDetailRoute extends _i23.PageRouteInfo<ChatDetailRouteArgs> {
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<ChatDetailRouteArgs> {
builder: (data) {
final pathParams = data.inheritedPathParams;
final args = data.argsAs<ChatDetailRouteArgs>(
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<void> {
class ChatRoomRoute extends _i23.PageRouteInfo<ChatRoomRouteArgs> {
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<ChatRoomRouteArgs> {
builder: (data) {
final pathParams = data.inheritedPathParams;
final args = data.argsAs<ChatRoomRouteArgs>(
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<void> {
/// generated route for
/// [_i4.EditChatScreen]
class EditChatRoute extends _i23.PageRouteInfo<EditChatRouteArgs> {
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<EditChatRouteArgs> {
builder: (data) {
final pathParams = data.inheritedPathParams;
final args = data.argsAs<EditChatRouteArgs>(
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<PostDetailRouteArgs> {
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<PostDetailRouteArgs> {
builder: (data) {
final pathParams = data.inheritedPathParams;
final args = data.argsAs<PostDetailRouteArgs>(
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<PostEditRouteArgs> {
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<PostEditRouteArgs> {
builder: (data) {
final pathParams = data.inheritedPathParams;
final args = data.argsAs<PostEditRouteArgs>(
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() {

View File

@ -232,7 +232,7 @@ class _LoginPickerScreen extends HookConsumerWidget {
@override
Widget build(BuildContext context, WidgetRef ref) {
final isBusy = useState(false);
final factorPicked = useState<int?>(null);
final factorPicked = useState<String?>(null);
final unfocusColor = Theme.of(
context,

View File

@ -191,7 +191,7 @@ class ChatListScreen extends HookConsumerWidget {
}
@riverpod
Future<SnChatRoom?> chatroom(Ref ref, int? identifier) async {
Future<SnChatRoom?> 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<SnChatRoom?> chatroom(Ref ref, int? identifier) async {
}
@riverpod
Future<SnChatMember?> chatroomIdentity(Ref ref, int? identifier) async {
Future<SnChatMember?> 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

View File

@ -25,7 +25,7 @@ final chatroomsJoinedProvider =
@Deprecated('Will be removed in 3.0. Use Ref instead')
// ignore: unused_element
typedef ChatroomsJoinedRef = AutoDisposeFutureProviderRef<List<SnChatRoom>>;
String _$chatroomHash() => r'3a945a61ea434f860fbeae9d40778fbfceddc5db';
String _$chatroomHash() => r'dce3c0fc407f178bb7c306a08b9fa545795a9205';
/// Copied from Dart SDK
class _SystemHash {
@ -58,7 +58,7 @@ class ChatroomFamily extends Family<AsyncValue<SnChatRoom?>> {
const ChatroomFamily();
/// See also [chatroom].
ChatroomProvider call(int? identifier) {
ChatroomProvider call(String? identifier) {
return ChatroomProvider(identifier);
}
@ -85,7 +85,7 @@ class ChatroomFamily extends Family<AsyncValue<SnChatRoom?>> {
/// See also [chatroom].
class ChatroomProvider extends AutoDisposeFutureProvider<SnChatRoom?> {
/// 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<SnChatRoom?> {
required this.identifier,
}) : super.internal();
final int? identifier;
final String? identifier;
@override
Override overrideWith(
@ -152,7 +152,7 @@ class ChatroomProvider extends AutoDisposeFutureProvider<SnChatRoom?> {
// ignore: unused_element
mixin ChatroomRef on AutoDisposeFutureProviderRef<SnChatRoom?> {
/// 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<AsyncValue<SnChatMember?>> {
const ChatroomIdentityFamily();
/// See also [chatroomIdentity].
ChatroomIdentityProvider call(int? identifier) {
ChatroomIdentityProvider call(String? identifier) {
return ChatroomIdentityProvider(identifier);
}
@ -206,7 +206,7 @@ class ChatroomIdentityFamily extends Family<AsyncValue<SnChatMember?>> {
class ChatroomIdentityProvider
extends AutoDisposeFutureProvider<SnChatMember?> {
/// 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<SnChatMember?> {
/// 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';

View File

@ -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<MessageRepository, int>(
(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<MessageRepository, String>((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<List<LocalChatMessage>>,
int
String
>((ref, roomId) => MessagesNotifier(ref, roomId));
class MessagesNotifier
extends StateNotifier<AsyncValue<List<LocalChatMessage>>> {
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

View File

@ -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<ChatMemberNotifier, ChatRoomMemberState, int>((
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<ChatRoomMemberState> {
final int roomId;
final String roomId;
final Dio _apiClient;
ChatMemberNotifier(this._apiClient, this.roomId)
@ -247,7 +247,7 @@ class ChatMemberNotifier extends StateNotifier<ChatRoomMemberState> {
}
class _ChatMemberListSheet extends HookConsumerWidget {
final int roomId;
final String roomId;
const _ChatMemberListSheet({required this.roomId});
@override

View File

@ -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

View File

@ -14,7 +14,7 @@ import 'package:styled_widget/styled_widget.dart';
part 'detail.g.dart';
@riverpod
Future<SnPost?> post(Ref ref, int id) async {
Future<SnPost?> 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<SnPost?> 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

View File

@ -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<AsyncValue<SnPost?>> {
const PostFamily();
/// See also [post].
PostProvider call(int id) {
PostProvider call(String id) {
return PostProvider(id);
}
@ -66,7 +66,7 @@ class PostFamily extends Family<AsyncValue<SnPost?>> {
/// See also [post].
class PostProvider extends AutoDisposeFutureProvider<SnPost?> {
/// 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<SnPost?> {
required this.id,
}) : super.internal();
final int id;
final String id;
@override
Override overrideWith(FutureOr<SnPost?> Function(PostRef provider) create) {
@ -129,7 +129,7 @@ class PostProvider extends AutoDisposeFutureProvider<SnPost?> {
// ignore: unused_element
mixin PostRef on AutoDisposeFutureProviderRef<SnPost?> {
/// The parameter `id` of this provider.
int get id;
String get id;
}
class _PostProviderElement extends AutoDisposeFutureProviderElement<SnPost?>
@ -137,7 +137,7 @@ class _PostProviderElement extends AutoDisposeFutureProviderElement<SnPost?>
_PostProviderElement(super.provider);
@override
int get id => (origin as PostProvider).id;
String get id => (origin as PostProvider).id;
}
// ignore_for_file: type=lint

View File

@ -169,7 +169,7 @@ class PostItem extends HookConsumerWidget {
}
class PostReactionList extends HookConsumerWidget {
final int parentId;
final String parentId;
final Map<String, int> reactions;
final Function(String symbol, int attitude, int delta) onReact;
final EdgeInsets? padding;

View File

@ -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<SnPost> posts = [];
bool isLoading = false;
bool hasReachedMax = false;