Skip to content

Commit

Permalink
ノートのチャンネル情報にフィールドを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
shiosyakeyakini-info committed Nov 6, 2023
1 parent 89f3942 commit 602e345
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 7 deletions.
2 changes: 2 additions & 0 deletions lib/src/data/base/note.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, Object?> json) =>
Expand Down
66 changes: 59 additions & 7 deletions lib/src/data/base/note.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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);
}
}
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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,
));
}
}
Expand All @@ -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<String, dynamic> json) =>
_$$_NoteChannelInfoFromJson(json);
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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<String, dynamic> json) =
_$_NoteChannelInfo.fromJson;
Expand All @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions lib/src/data/base/note.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 602e345

Please sign in to comment.