From 0d056a35c4a6d204b72ffc0c0552a60d6cf96049 Mon Sep 17 00:00:00 2001 From: poppingmoon <63451158+poppingmoon@users.noreply.github.com> Date: Sat, 17 Aug 2024 17:59:24 +0900 Subject: [PATCH] =?UTF-8?q?flash=E3=81=ABvisibility=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/flash.dart | 1 + lib/src/data/base/flash.freezed.dart | 25 +++++++++++++++++++++++-- lib/src/data/base/flash.g.dart | 8 ++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/lib/src/data/base/flash.dart b/lib/src/data/base/flash.dart index 9a5dcf1c..2846de4f 100644 --- a/lib/src/data/base/flash.dart +++ b/lib/src/data/base/flash.dart @@ -16,6 +16,7 @@ class Flash with _$Flash { required String title, required String summary, required String script, + FlashVisibility? visibility, required String userId, required UserLite user, int? likedCount, diff --git a/lib/src/data/base/flash.freezed.dart b/lib/src/data/base/flash.freezed.dart index c2c61a98..4f5d1ccd 100644 --- a/lib/src/data/base/flash.freezed.dart +++ b/lib/src/data/base/flash.freezed.dart @@ -28,6 +28,7 @@ mixin _$Flash { String get title => throw _privateConstructorUsedError; String get summary => throw _privateConstructorUsedError; String get script => throw _privateConstructorUsedError; + FlashVisibility? get visibility => throw _privateConstructorUsedError; String get userId => throw _privateConstructorUsedError; UserLite get user => throw _privateConstructorUsedError; int? get likedCount => throw _privateConstructorUsedError; @@ -50,6 +51,7 @@ abstract class $FlashCopyWith<$Res> { String title, String summary, String script, + FlashVisibility? visibility, String userId, UserLite user, int? likedCount, @@ -77,6 +79,7 @@ class _$FlashCopyWithImpl<$Res, $Val extends Flash> Object? title = null, Object? summary = null, Object? script = null, + Object? visibility = freezed, Object? userId = null, Object? user = null, Object? likedCount = freezed, @@ -107,6 +110,10 @@ class _$FlashCopyWithImpl<$Res, $Val extends Flash> ? _value.script : script // ignore: cast_nullable_to_non_nullable as String, + visibility: freezed == visibility + ? _value.visibility + : visibility // ignore: cast_nullable_to_non_nullable + as FlashVisibility?, userId: null == userId ? _value.userId : userId // ignore: cast_nullable_to_non_nullable @@ -149,6 +156,7 @@ abstract class _$$FlashImplCopyWith<$Res> implements $FlashCopyWith<$Res> { String title, String summary, String script, + FlashVisibility? visibility, String userId, UserLite user, int? likedCount, @@ -175,6 +183,7 @@ class __$$FlashImplCopyWithImpl<$Res> Object? title = null, Object? summary = null, Object? script = null, + Object? visibility = freezed, Object? userId = null, Object? user = null, Object? likedCount = freezed, @@ -205,6 +214,10 @@ class __$$FlashImplCopyWithImpl<$Res> ? _value.script : script // ignore: cast_nullable_to_non_nullable as String, + visibility: freezed == visibility + ? _value.visibility + : visibility // ignore: cast_nullable_to_non_nullable + as FlashVisibility?, userId: null == userId ? _value.userId : userId // ignore: cast_nullable_to_non_nullable @@ -235,6 +248,7 @@ class _$FlashImpl implements _Flash { required this.title, required this.summary, required this.script, + this.visibility, required this.userId, required this.user, this.likedCount, @@ -258,6 +272,8 @@ class _$FlashImpl implements _Flash { @override final String script; @override + final FlashVisibility? visibility; + @override final String userId; @override final UserLite user; @@ -269,7 +285,7 @@ class _$FlashImpl implements _Flash { @override String toString() { - return 'Flash(id: $id, createdAt: $createdAt, updatedAt: $updatedAt, title: $title, summary: $summary, script: $script, userId: $userId, user: $user, likedCount: $likedCount, isLiked: $isLiked)'; + return 'Flash(id: $id, createdAt: $createdAt, updatedAt: $updatedAt, title: $title, summary: $summary, script: $script, visibility: $visibility, userId: $userId, user: $user, likedCount: $likedCount, isLiked: $isLiked)'; } @override @@ -285,6 +301,8 @@ class _$FlashImpl implements _Flash { (identical(other.title, title) || other.title == title) && (identical(other.summary, summary) || other.summary == summary) && (identical(other.script, script) || other.script == script) && + (identical(other.visibility, visibility) || + other.visibility == visibility) && (identical(other.userId, userId) || other.userId == userId) && (identical(other.user, user) || other.user == user) && (identical(other.likedCount, likedCount) || @@ -295,7 +313,7 @@ class _$FlashImpl implements _Flash { @JsonKey(ignore: true) @override int get hashCode => Object.hash(runtimeType, id, createdAt, updatedAt, title, - summary, script, userId, user, likedCount, isLiked); + summary, script, visibility, userId, user, likedCount, isLiked); @JsonKey(ignore: true) @override @@ -319,6 +337,7 @@ abstract class _Flash implements Flash { required final String title, required final String summary, required final String script, + final FlashVisibility? visibility, required final String userId, required final UserLite user, final int? likedCount, @@ -341,6 +360,8 @@ abstract class _Flash implements Flash { @override String get script; @override + FlashVisibility? get visibility; + @override String get userId; @override UserLite get user; diff --git a/lib/src/data/base/flash.g.dart b/lib/src/data/base/flash.g.dart index 811a09cf..cf1e7b95 100644 --- a/lib/src/data/base/flash.g.dart +++ b/lib/src/data/base/flash.g.dart @@ -15,6 +15,8 @@ _$FlashImpl _$$FlashImplFromJson(Map json) => _$FlashImpl( title: json['title'] as String, summary: json['summary'] as String, script: json['script'] as String, + visibility: + $enumDecodeNullable(_$FlashVisibilityEnumMap, json['visibility']), userId: json['userId'] as String, user: UserLite.fromJson(json['user'] as Map), likedCount: json['likedCount'] as int?, @@ -29,8 +31,14 @@ Map _$$FlashImplToJson(_$FlashImpl instance) => 'title': instance.title, 'summary': instance.summary, 'script': instance.script, + 'visibility': _$FlashVisibilityEnumMap[instance.visibility], 'userId': instance.userId, 'user': instance.user.toJson(), 'likedCount': instance.likedCount, 'isLiked': instance.isLiked, }; + +const _$FlashVisibilityEnumMap = { + FlashVisibility.public: 'public', + FlashVisibility.private: 'private', +};