Skip to content

Commit

Permalink
クリップにnotesCountを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
poppingmoon committed May 4, 2024
1 parent 91d4c3f commit 668d748
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 8 deletions.
1 change: 1 addition & 0 deletions lib/src/data/base/clip.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class Clip with _$Clip {
required bool isPublic,
required int favoritedCount,
bool? isFavorited,
int? notesCount,
}) = _Clip;

factory Clip.fromJson(Map<String, Object?> json) => _$ClipFromJson(json);
Expand Down
48 changes: 40 additions & 8 deletions lib/src/data/base/clip.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ mixin _$Clip {
bool get isPublic => throw _privateConstructorUsedError;
int get favoritedCount => throw _privateConstructorUsedError;
bool? get isFavorited => throw _privateConstructorUsedError;
int? get notesCount => throw _privateConstructorUsedError;

Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
Expand All @@ -53,7 +54,8 @@ abstract class $ClipCopyWith<$Res> {
String? description,
bool isPublic,
int favoritedCount,
bool? isFavorited});
bool? isFavorited,
int? notesCount});

$UserLiteCopyWith<$Res> get user;
}
Expand Down Expand Up @@ -81,6 +83,7 @@ class _$ClipCopyWithImpl<$Res, $Val extends Clip>
Object? isPublic = null,
Object? favoritedCount = null,
Object? isFavorited = freezed,
Object? notesCount = freezed,
}) {
return _then(_value.copyWith(
id: null == id
Expand Down Expand Up @@ -123,6 +126,10 @@ class _$ClipCopyWithImpl<$Res, $Val extends Clip>
? _value.isFavorited
: isFavorited // ignore: cast_nullable_to_non_nullable
as bool?,
notesCount: freezed == notesCount
? _value.notesCount
: notesCount // ignore: cast_nullable_to_non_nullable
as int?,
) as $Val);
}

Expand Down Expand Up @@ -152,7 +159,8 @@ abstract class _$$ClipImplCopyWith<$Res> implements $ClipCopyWith<$Res> {
String? description,
bool isPublic,
int favoritedCount,
bool? isFavorited});
bool? isFavorited,
int? notesCount});

@override
$UserLiteCopyWith<$Res> get user;
Expand All @@ -178,6 +186,7 @@ class __$$ClipImplCopyWithImpl<$Res>
Object? isPublic = null,
Object? favoritedCount = null,
Object? isFavorited = freezed,
Object? notesCount = freezed,
}) {
return _then(_$ClipImpl(
id: null == id
Expand Down Expand Up @@ -220,6 +229,10 @@ class __$$ClipImplCopyWithImpl<$Res>
? _value.isFavorited
: isFavorited // ignore: cast_nullable_to_non_nullable
as bool?,
notesCount: freezed == notesCount
? _value.notesCount
: notesCount // ignore: cast_nullable_to_non_nullable
as int?,
));
}
}
Expand All @@ -237,7 +250,8 @@ class _$ClipImpl implements _Clip {
this.description,
required this.isPublic,
required this.favoritedCount,
this.isFavorited});
this.isFavorited,
this.notesCount});

factory _$ClipImpl.fromJson(Map<String, dynamic> json) =>
_$$ClipImplFromJson(json);
Expand All @@ -264,10 +278,12 @@ class _$ClipImpl implements _Clip {
final int favoritedCount;
@override
final bool? isFavorited;
@override
final int? notesCount;

@override
String toString() {
return 'Clip(id: $id, createdAt: $createdAt, lastClippedAt: $lastClippedAt, userId: $userId, user: $user, name: $name, description: $description, isPublic: $isPublic, favoritedCount: $favoritedCount, isFavorited: $isFavorited)';
return 'Clip(id: $id, createdAt: $createdAt, lastClippedAt: $lastClippedAt, userId: $userId, user: $user, name: $name, description: $description, isPublic: $isPublic, favoritedCount: $favoritedCount, isFavorited: $isFavorited, notesCount: $notesCount)';
}

@override
Expand All @@ -290,13 +306,26 @@ class _$ClipImpl implements _Clip {
(identical(other.favoritedCount, favoritedCount) ||
other.favoritedCount == favoritedCount) &&
(identical(other.isFavorited, isFavorited) ||
other.isFavorited == isFavorited));
other.isFavorited == isFavorited) &&
(identical(other.notesCount, notesCount) ||
other.notesCount == notesCount));
}

@JsonKey(ignore: true)
@override
int get hashCode => Object.hash(runtimeType, id, createdAt, lastClippedAt,
userId, user, name, description, isPublic, favoritedCount, isFavorited);
int get hashCode => Object.hash(
runtimeType,
id,
createdAt,
lastClippedAt,
userId,
user,
name,
description,
isPublic,
favoritedCount,
isFavorited,
notesCount);

@JsonKey(ignore: true)
@override
Expand All @@ -323,7 +352,8 @@ abstract class _Clip implements Clip {
final String? description,
required final bool isPublic,
required final int favoritedCount,
final bool? isFavorited}) = _$ClipImpl;
final bool? isFavorited,
final int? notesCount}) = _$ClipImpl;

factory _Clip.fromJson(Map<String, dynamic> json) = _$ClipImpl.fromJson;

Expand All @@ -350,6 +380,8 @@ abstract class _Clip implements Clip {
@override
bool? get isFavorited;
@override
int? get notesCount;
@override
@JsonKey(ignore: true)
_$$ClipImplCopyWith<_$ClipImpl> get copyWith =>
throw _privateConstructorUsedError;
Expand Down
2 changes: 2 additions & 0 deletions lib/src/data/base/clip.g.dart

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

0 comments on commit 668d748

Please sign in to comment.