From 602e345be10c2f47a097585c97181f115d441cf1 Mon Sep 17 00:00:00 2001 From: sorairo Date: Tue, 7 Nov 2023 06:54:56 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=8E=E3=83=BC=E3=83=88=E3=81=AE=E3=83=81?= =?UTF-8?q?=E3=83=A3=E3=83=B3=E3=83=8D=E3=83=AB=E6=83=85=E5=A0=B1=E3=81=AB?= =?UTF-8?q?=E3=83=95=E3=82=A3=E3=83=BC=E3=83=AB=E3=83=89=E3=82=92=E8=BF=BD?= =?UTF-8?q?=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/src/data/base/note.dart | 2 + lib/src/data/base/note.freezed.dart | 66 ++++++++++++++++++++++++++--- lib/src/data/base/note.g.dart | 4 ++ 3 files changed, 65 insertions(+), 7 deletions(-) diff --git a/lib/src/data/base/note.dart b/lib/src/data/base/note.dart index 9f4ccd8e..17bdadb6 100644 --- a/lib/src/data/base/note.dart +++ b/lib/src/data/base/note.dart @@ -53,6 +53,8 @@ class NoteChannelInfo with _$NoteChannelInfo { required String id, required String name, @NullableColorConverter() int? color, + @Default(false) isSensitive, + @Default(true) allowRenoteToExternal, }) = _NoteChannelInfo; factory NoteChannelInfo.fromJson(Map json) => diff --git a/lib/src/data/base/note.freezed.dart b/lib/src/data/base/note.freezed.dart index aec8ac1c..79d3abdd 100644 --- a/lib/src/data/base/note.freezed.dart +++ b/lib/src/data/base/note.freezed.dart @@ -960,6 +960,8 @@ mixin _$NoteChannelInfo { String get name => throw _privateConstructorUsedError; @NullableColorConverter() int? get color => throw _privateConstructorUsedError; + dynamic get isSensitive => throw _privateConstructorUsedError; + dynamic get allowRenoteToExternal => throw _privateConstructorUsedError; Map toJson() => throw _privateConstructorUsedError; @JsonKey(ignore: true) @@ -973,7 +975,12 @@ abstract class $NoteChannelInfoCopyWith<$Res> { NoteChannelInfo value, $Res Function(NoteChannelInfo) then) = _$NoteChannelInfoCopyWithImpl<$Res, NoteChannelInfo>; @useResult - $Res call({String id, String name, @NullableColorConverter() int? color}); + $Res call( + {String id, + String name, + @NullableColorConverter() int? color, + dynamic isSensitive, + dynamic allowRenoteToExternal}); } /// @nodoc @@ -992,6 +999,8 @@ class _$NoteChannelInfoCopyWithImpl<$Res, $Val extends NoteChannelInfo> Object? id = null, Object? name = null, Object? color = freezed, + Object? isSensitive = freezed, + Object? allowRenoteToExternal = freezed, }) { return _then(_value.copyWith( id: null == id @@ -1006,6 +1015,14 @@ class _$NoteChannelInfoCopyWithImpl<$Res, $Val extends NoteChannelInfo> ? _value.color : color // ignore: cast_nullable_to_non_nullable as int?, + isSensitive: freezed == isSensitive + ? _value.isSensitive + : isSensitive // ignore: cast_nullable_to_non_nullable + as dynamic, + allowRenoteToExternal: freezed == allowRenoteToExternal + ? _value.allowRenoteToExternal + : allowRenoteToExternal // ignore: cast_nullable_to_non_nullable + as dynamic, ) as $Val); } } @@ -1018,7 +1035,12 @@ abstract class _$$_NoteChannelInfoCopyWith<$Res> __$$_NoteChannelInfoCopyWithImpl<$Res>; @override @useResult - $Res call({String id, String name, @NullableColorConverter() int? color}); + $Res call( + {String id, + String name, + @NullableColorConverter() int? color, + dynamic isSensitive, + dynamic allowRenoteToExternal}); } /// @nodoc @@ -1035,6 +1057,8 @@ class __$$_NoteChannelInfoCopyWithImpl<$Res> Object? id = null, Object? name = null, Object? color = freezed, + Object? isSensitive = freezed, + Object? allowRenoteToExternal = freezed, }) { return _then(_$_NoteChannelInfo( id: null == id @@ -1049,6 +1073,10 @@ class __$$_NoteChannelInfoCopyWithImpl<$Res> ? _value.color : color // ignore: cast_nullable_to_non_nullable as int?, + isSensitive: freezed == isSensitive ? _value.isSensitive! : isSensitive, + allowRenoteToExternal: freezed == allowRenoteToExternal + ? _value.allowRenoteToExternal! + : allowRenoteToExternal, )); } } @@ -1059,7 +1087,9 @@ class _$_NoteChannelInfo implements _NoteChannelInfo { const _$_NoteChannelInfo( {required this.id, required this.name, - @NullableColorConverter() this.color}); + @NullableColorConverter() this.color, + this.isSensitive = false, + this.allowRenoteToExternal = true}); factory _$_NoteChannelInfo.fromJson(Map json) => _$$_NoteChannelInfoFromJson(json); @@ -1071,10 +1101,16 @@ class _$_NoteChannelInfo implements _NoteChannelInfo { @override @NullableColorConverter() final int? color; + @override + @JsonKey() + final dynamic isSensitive; + @override + @JsonKey() + final dynamic allowRenoteToExternal; @override String toString() { - return 'NoteChannelInfo(id: $id, name: $name, color: $color)'; + return 'NoteChannelInfo(id: $id, name: $name, color: $color, isSensitive: $isSensitive, allowRenoteToExternal: $allowRenoteToExternal)'; } @override @@ -1084,12 +1120,22 @@ class _$_NoteChannelInfo implements _NoteChannelInfo { other is _$_NoteChannelInfo && (identical(other.id, id) || other.id == id) && (identical(other.name, name) || other.name == name) && - (identical(other.color, color) || other.color == color)); + (identical(other.color, color) || other.color == color) && + const DeepCollectionEquality() + .equals(other.isSensitive, isSensitive) && + const DeepCollectionEquality() + .equals(other.allowRenoteToExternal, allowRenoteToExternal)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash(runtimeType, id, name, color); + int get hashCode => Object.hash( + runtimeType, + id, + name, + color, + const DeepCollectionEquality().hash(isSensitive), + const DeepCollectionEquality().hash(allowRenoteToExternal)); @JsonKey(ignore: true) @override @@ -1109,7 +1155,9 @@ abstract class _NoteChannelInfo implements NoteChannelInfo { const factory _NoteChannelInfo( {required final String id, required final String name, - @NullableColorConverter() final int? color}) = _$_NoteChannelInfo; + @NullableColorConverter() final int? color, + final dynamic isSensitive, + final dynamic allowRenoteToExternal}) = _$_NoteChannelInfo; factory _NoteChannelInfo.fromJson(Map json) = _$_NoteChannelInfo.fromJson; @@ -1122,6 +1170,10 @@ abstract class _NoteChannelInfo implements NoteChannelInfo { @NullableColorConverter() int? get color; @override + dynamic get isSensitive; + @override + dynamic get allowRenoteToExternal; + @override @JsonKey(ignore: true) _$$_NoteChannelInfoCopyWith<_$_NoteChannelInfo> get copyWith => throw _privateConstructorUsedError; diff --git a/lib/src/data/base/note.g.dart b/lib/src/data/base/note.g.dart index 59b6d79e..d65b36ee 100644 --- a/lib/src/data/base/note.g.dart +++ b/lib/src/data/base/note.g.dart @@ -124,6 +124,8 @@ _$_NoteChannelInfo _$$_NoteChannelInfoFromJson(Map json) => id: json['id'] as String, name: json['name'] as String, color: const NullableColorConverter().fromJson(json['color'] as String?), + isSensitive: json['isSensitive'] ?? false, + allowRenoteToExternal: json['allowRenoteToExternal'] ?? true, ); Map _$$_NoteChannelInfoToJson(_$_NoteChannelInfo instance) => @@ -131,6 +133,8 @@ Map _$$_NoteChannelInfoToJson(_$_NoteChannelInfo instance) => 'id': instance.id, 'name': instance.name, 'color': const NullableColorConverter().toJson(instance.color), + 'isSensitive': instance.isSensitive, + 'allowRenoteToExternal': instance.allowRenoteToExternal, }; _$_NotePoll _$$_NotePollFromJson(Map json) => _$_NotePoll(