Skip to content

Commit

Permalink
Merge pull request #63 from poppingmoon/flash-visibility
Browse files Browse the repository at this point in the history
flash/createにvisibilityを追加
  • Loading branch information
shiosyakeyakini-info authored Oct 18, 2024
2 parents e57322c + 0d056a3 commit c0076ad
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 9 deletions.
1 change: 1 addition & 0 deletions lib/src/data/base/flash.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
25 changes: 23 additions & 2 deletions lib/src/data/base/flash.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -50,6 +51,7 @@ abstract class $FlashCopyWith<$Res> {
String title,
String summary,
String script,
FlashVisibility? visibility,
String userId,
UserLite user,
int? likedCount,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -258,6 +272,8 @@ class _$FlashImpl implements _Flash {
@override
final String script;
@override
final FlashVisibility? visibility;
@override
final String userId;
@override
final UserLite user;
Expand All @@ -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
Expand All @@ -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) ||
Expand All @@ -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
Expand All @@ -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,
Expand All @@ -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;
Expand Down
8 changes: 8 additions & 0 deletions lib/src/data/base/flash.g.dart

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

2 changes: 2 additions & 0 deletions lib/src/data/flash/flash_create_request.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:misskey_dart/misskey_dart.dart';

part 'flash_create_request.freezed.dart';
part 'flash_create_request.g.dart';
Expand All @@ -10,6 +11,7 @@ class FlashCreateRequest with _$FlashCreateRequest {
required String summary,
required String script,
required List<String> permissions,
FlashVisibility? visibility,
}) = _FlashCreateRequest;

factory FlashCreateRequest.fromJson(Map<String, Object?> json) =>
Expand Down
42 changes: 35 additions & 7 deletions lib/src/data/flash/flash_create_request.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ mixin _$FlashCreateRequest {
String get summary => throw _privateConstructorUsedError;
String get script => throw _privateConstructorUsedError;
List<String> get permissions => throw _privateConstructorUsedError;
FlashVisibility? get visibility => throw _privateConstructorUsedError;

Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
Expand All @@ -38,7 +39,11 @@ abstract class $FlashCreateRequestCopyWith<$Res> {
_$FlashCreateRequestCopyWithImpl<$Res, FlashCreateRequest>;
@useResult
$Res call(
{String title, String summary, String script, List<String> permissions});
{String title,
String summary,
String script,
List<String> permissions,
FlashVisibility? visibility});
}

/// @nodoc
Expand All @@ -58,6 +63,7 @@ class _$FlashCreateRequestCopyWithImpl<$Res, $Val extends FlashCreateRequest>
Object? summary = null,
Object? script = null,
Object? permissions = null,
Object? visibility = freezed,
}) {
return _then(_value.copyWith(
title: null == title
Expand All @@ -76,6 +82,10 @@ class _$FlashCreateRequestCopyWithImpl<$Res, $Val extends FlashCreateRequest>
? _value.permissions
: permissions // ignore: cast_nullable_to_non_nullable
as List<String>,
visibility: freezed == visibility
? _value.visibility
: visibility // ignore: cast_nullable_to_non_nullable
as FlashVisibility?,
) as $Val);
}
}
Expand All @@ -89,7 +99,11 @@ abstract class _$$FlashCreateRequestImplCopyWith<$Res>
@override
@useResult
$Res call(
{String title, String summary, String script, List<String> permissions});
{String title,
String summary,
String script,
List<String> permissions,
FlashVisibility? visibility});
}

/// @nodoc
Expand All @@ -107,6 +121,7 @@ class __$$FlashCreateRequestImplCopyWithImpl<$Res>
Object? summary = null,
Object? script = null,
Object? permissions = null,
Object? visibility = freezed,
}) {
return _then(_$FlashCreateRequestImpl(
title: null == title
Expand All @@ -125,6 +140,10 @@ class __$$FlashCreateRequestImplCopyWithImpl<$Res>
? _value._permissions
: permissions // ignore: cast_nullable_to_non_nullable
as List<String>,
visibility: freezed == visibility
? _value.visibility
: visibility // ignore: cast_nullable_to_non_nullable
as FlashVisibility?,
));
}
}
Expand All @@ -136,7 +155,8 @@ class _$FlashCreateRequestImpl implements _FlashCreateRequest {
{required this.title,
required this.summary,
required this.script,
required final List<String> permissions})
required final List<String> permissions,
this.visibility})
: _permissions = permissions;

factory _$FlashCreateRequestImpl.fromJson(Map<String, dynamic> json) =>
Expand All @@ -156,9 +176,12 @@ class _$FlashCreateRequestImpl implements _FlashCreateRequest {
return EqualUnmodifiableListView(_permissions);
}

@override
final FlashVisibility? visibility;

@override
String toString() {
return 'FlashCreateRequest(title: $title, summary: $summary, script: $script, permissions: $permissions)';
return 'FlashCreateRequest(title: $title, summary: $summary, script: $script, permissions: $permissions, visibility: $visibility)';
}

@override
Expand All @@ -170,13 +193,15 @@ class _$FlashCreateRequestImpl implements _FlashCreateRequest {
(identical(other.summary, summary) || other.summary == summary) &&
(identical(other.script, script) || other.script == script) &&
const DeepCollectionEquality()
.equals(other._permissions, _permissions));
.equals(other._permissions, _permissions) &&
(identical(other.visibility, visibility) ||
other.visibility == visibility));
}

@JsonKey(ignore: true)
@override
int get hashCode => Object.hash(runtimeType, title, summary, script,
const DeepCollectionEquality().hash(_permissions));
const DeepCollectionEquality().hash(_permissions), visibility);

@JsonKey(ignore: true)
@override
Expand All @@ -198,7 +223,8 @@ abstract class _FlashCreateRequest implements FlashCreateRequest {
{required final String title,
required final String summary,
required final String script,
required final List<String> permissions}) = _$FlashCreateRequestImpl;
required final List<String> permissions,
final FlashVisibility? visibility}) = _$FlashCreateRequestImpl;

factory _FlashCreateRequest.fromJson(Map<String, dynamic> json) =
_$FlashCreateRequestImpl.fromJson;
Expand All @@ -212,6 +238,8 @@ abstract class _FlashCreateRequest implements FlashCreateRequest {
@override
List<String> get permissions;
@override
FlashVisibility? get visibility;
@override
@JsonKey(ignore: true)
_$$FlashCreateRequestImplCopyWith<_$FlashCreateRequestImpl> get copyWith =>
throw _privateConstructorUsedError;
Expand Down
8 changes: 8 additions & 0 deletions lib/src/data/flash/flash_create_request.g.dart

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

0 comments on commit c0076ad

Please sign in to comment.