Skip to content

Commit

Permalink
Merge pull request #25 from poppingmoon/user
Browse files Browse the repository at this point in the history
User関係の型をUserLiteとUserDetailedに整理
  • Loading branch information
shiosyakeyakini-info authored Jan 27, 2024
2 parents 1c344ae + b22836c commit d91ad3b
Show file tree
Hide file tree
Showing 70 changed files with 5,911 additions and 5,100 deletions.
6 changes: 6 additions & 0 deletions build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
targets:
$default:
builders:
json_serializable:
options:
explicit_to_json: true
2 changes: 0 additions & 2 deletions lib/misskey_dart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ export 'src/data/following/requests/following_requests_reject_request.dart';
export 'src/data/federation/federation_show_instance_request.dart';
export 'src/data/federation/federation_show_instance_response.dart';
export 'src/data/federation/federation_users_request.dart';
export 'src/data/i_response.dart';
export 'src/data/i/i_notifications_request.dart';
export 'src/data/i/i_notifications_response.dart';
export 'src/data/i/i_favorites_request.dart';
Expand Down Expand Up @@ -149,7 +148,6 @@ export 'src/data/pages/pages_like_request.dart';
export 'src/data/pages/pages_unlike_request.dart';
export 'src/data/pages/pages_show_request.dart';
export 'src/data/users/users_show_request.dart';
export 'src/data/users/users_show_response.dart';
export 'src/data/users/users_notes_request.dart';
export 'src/data/users/users_clips_request.dart';
export 'src/data/users/users_following_request.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/src/data/base/clip.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Clip with _$Clip {
@DateTimeConverter() required DateTime createdAt,
@NullableDateTimeConverter() DateTime? lastClippedAt,
required String userId,
required User user,
required UserLite user,
String? name,
String? description,
required bool isPublic,
Expand Down
24 changes: 12 additions & 12 deletions lib/src/data/base/clip.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ mixin _$Clip {
@NullableDateTimeConverter()
DateTime? get lastClippedAt => throw _privateConstructorUsedError;
String get userId => throw _privateConstructorUsedError;
User get user => throw _privateConstructorUsedError;
UserLite get user => throw _privateConstructorUsedError;
String? get name => throw _privateConstructorUsedError;
String? get description => throw _privateConstructorUsedError;
bool get isPublic => throw _privateConstructorUsedError;
Expand All @@ -48,14 +48,14 @@ abstract class $ClipCopyWith<$Res> {
@DateTimeConverter() DateTime createdAt,
@NullableDateTimeConverter() DateTime? lastClippedAt,
String userId,
User user,
UserLite user,
String? name,
String? description,
bool isPublic,
int favoritedCount,
bool? isFavorited});

$UserCopyWith<$Res> get user;
$UserLiteCopyWith<$Res> get user;
}

/// @nodoc
Expand Down Expand Up @@ -102,7 +102,7 @@ class _$ClipCopyWithImpl<$Res, $Val extends Clip>
user: null == user
? _value.user
: user // ignore: cast_nullable_to_non_nullable
as User,
as UserLite,
name: freezed == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
Expand All @@ -128,8 +128,8 @@ class _$ClipCopyWithImpl<$Res, $Val extends Clip>

@override
@pragma('vm:prefer-inline')
$UserCopyWith<$Res> get user {
return $UserCopyWith<$Res>(_value.user, (value) {
$UserLiteCopyWith<$Res> get user {
return $UserLiteCopyWith<$Res>(_value.user, (value) {
return _then(_value.copyWith(user: value) as $Val);
});
}
Expand All @@ -147,15 +147,15 @@ abstract class _$$ClipImplCopyWith<$Res> implements $ClipCopyWith<$Res> {
@DateTimeConverter() DateTime createdAt,
@NullableDateTimeConverter() DateTime? lastClippedAt,
String userId,
User user,
UserLite user,
String? name,
String? description,
bool isPublic,
int favoritedCount,
bool? isFavorited});

@override
$UserCopyWith<$Res> get user;
$UserLiteCopyWith<$Res> get user;
}

/// @nodoc
Expand Down Expand Up @@ -199,7 +199,7 @@ class __$$ClipImplCopyWithImpl<$Res>
user: null == user
? _value.user
: user // ignore: cast_nullable_to_non_nullable
as User,
as UserLite,
name: freezed == name
? _value.name
: name // ignore: cast_nullable_to_non_nullable
Expand Down Expand Up @@ -253,7 +253,7 @@ class _$ClipImpl implements _Clip {
@override
final String userId;
@override
final User user;
final UserLite user;
@override
final String? name;
@override
Expand Down Expand Up @@ -318,7 +318,7 @@ abstract class _Clip implements Clip {
@DateTimeConverter() required final DateTime createdAt,
@NullableDateTimeConverter() final DateTime? lastClippedAt,
required final String userId,
required final User user,
required final UserLite user,
final String? name,
final String? description,
required final bool isPublic,
Expand All @@ -338,7 +338,7 @@ abstract class _Clip implements Clip {
@override
String get userId;
@override
User get user;
UserLite get user;
@override
String? get name;
@override
Expand Down
4 changes: 2 additions & 2 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.

2 changes: 1 addition & 1 deletion lib/src/data/base/community_channel.g.dart

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

2 changes: 1 addition & 1 deletion lib/src/data/base/drive_file.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class DriveFile with _$DriveFile {
String? folderId,
DriveFolder? folder,
String? userId,
User? user,
UserLite? user,
}) = _DriveFile;

factory DriveFile.fromJson(Map<String, dynamic> json) =>
Expand Down
24 changes: 12 additions & 12 deletions lib/src/data/base/drive_file.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ mixin _$DriveFile {
String? get folderId => throw _privateConstructorUsedError;
DriveFolder? get folder => throw _privateConstructorUsedError;
String? get userId => throw _privateConstructorUsedError;
User? get user => throw _privateConstructorUsedError;
UserLite? get user => throw _privateConstructorUsedError;

Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
@JsonKey(ignore: true)
Expand Down Expand Up @@ -65,11 +65,11 @@ abstract class $DriveFileCopyWith<$Res> {
String? folderId,
DriveFolder? folder,
String? userId,
User? user});
UserLite? user});

$DriveFilePropertiesCopyWith<$Res> get properties;
$DriveFolderCopyWith<$Res>? get folder;
$UserCopyWith<$Res>? get user;
$UserLiteCopyWith<$Res>? get user;
}

/// @nodoc
Expand Down Expand Up @@ -166,7 +166,7 @@ class _$DriveFileCopyWithImpl<$Res, $Val extends DriveFile>
user: freezed == user
? _value.user
: user // ignore: cast_nullable_to_non_nullable
as User?,
as UserLite?,
) as $Val);
}

Expand All @@ -192,12 +192,12 @@ class _$DriveFileCopyWithImpl<$Res, $Val extends DriveFile>

@override
@pragma('vm:prefer-inline')
$UserCopyWith<$Res>? get user {
$UserLiteCopyWith<$Res>? get user {
if (_value.user == null) {
return null;
}

return $UserCopyWith<$Res>(_value.user!, (value) {
return $UserLiteCopyWith<$Res>(_value.user!, (value) {
return _then(_value.copyWith(user: value) as $Val);
});
}
Expand Down Expand Up @@ -227,14 +227,14 @@ abstract class _$$DriveFileImplCopyWith<$Res>
String? folderId,
DriveFolder? folder,
String? userId,
User? user});
UserLite? user});

@override
$DriveFilePropertiesCopyWith<$Res> get properties;
@override
$DriveFolderCopyWith<$Res>? get folder;
@override
$UserCopyWith<$Res>? get user;
$UserLiteCopyWith<$Res>? get user;
}

/// @nodoc
Expand Down Expand Up @@ -329,7 +329,7 @@ class __$$DriveFileImplCopyWithImpl<$Res>
user: freezed == user
? _value.user
: user // ignore: cast_nullable_to_non_nullable
as User?,
as UserLite?,
));
}
}
Expand Down Expand Up @@ -390,7 +390,7 @@ class _$DriveFileImpl implements _DriveFile {
@override
final String? userId;
@override
final User? user;
final UserLite? user;

@override
String toString() {
Expand Down Expand Up @@ -478,7 +478,7 @@ abstract class _DriveFile implements DriveFile {
final String? folderId,
final DriveFolder? folder,
final String? userId,
final User? user}) = _$DriveFileImpl;
final UserLite? user}) = _$DriveFileImpl;

factory _DriveFile.fromJson(Map<String, dynamic> json) =
_$DriveFileImpl.fromJson;
Expand Down Expand Up @@ -515,7 +515,7 @@ abstract class _DriveFile implements DriveFile {
@override
String? get userId;
@override
User? get user;
UserLite? get user;
@override
@JsonKey(ignore: true)
_$$DriveFileImplCopyWith<_$DriveFileImpl> get copyWith =>
Expand Down
8 changes: 4 additions & 4 deletions lib/src/data/base/drive_file.g.dart

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

2 changes: 1 addition & 1 deletion lib/src/data/base/drive_folder.g.dart

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

2 changes: 1 addition & 1 deletion lib/src/data/base/flash.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Flash with _$Flash {
required String summary,
required String script,
required String userId,
required User user,
required UserLite user,
int? likedCount,
@Default(false) bool isLiked,
}) = _Flash;
Expand Down
Loading

0 comments on commit d91ad3b

Please sign in to comment.