Skip to content

Commit

Permalink
User関係の型をUserLiteとUserDetailedに整理
Browse files Browse the repository at this point in the history
  • Loading branch information
poppingmoon committed Dec 19, 2023
1 parent 7e4e279 commit d465cb8
Show file tree
Hide file tree
Showing 56 changed files with 5,848 additions and 5,048 deletions.
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 @@ -142,7 +141,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
2 changes: 1 addition & 1 deletion 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/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
2 changes: 1 addition & 1 deletion 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/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
24 changes: 12 additions & 12 deletions lib/src/data/base/flash.freezed.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ mixin _$Flash {
String get summary => throw _privateConstructorUsedError;
String get script => throw _privateConstructorUsedError;
String get userId => throw _privateConstructorUsedError;
User get user => throw _privateConstructorUsedError;
UserLite get user => throw _privateConstructorUsedError;
int? get likedCount => throw _privateConstructorUsedError;
bool get isLiked => throw _privateConstructorUsedError;

Expand All @@ -51,11 +51,11 @@ abstract class $FlashCopyWith<$Res> {
String summary,
String script,
String userId,
User user,
UserLite user,
int? likedCount,
bool isLiked});

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

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

@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 @@ -150,12 +150,12 @@ abstract class _$$FlashImplCopyWith<$Res> implements $FlashCopyWith<$Res> {
String summary,
String script,
String userId,
User user,
UserLite user,
int? likedCount,
bool isLiked});

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

/// @nodoc
Expand Down Expand Up @@ -212,7 +212,7 @@ class __$$FlashImplCopyWithImpl<$Res>
user: null == user
? _value.user
: user // ignore: cast_nullable_to_non_nullable
as User,
as UserLite,
likedCount: freezed == likedCount
? _value.likedCount
: likedCount // ignore: cast_nullable_to_non_nullable
Expand Down Expand Up @@ -260,7 +260,7 @@ class _$FlashImpl implements _Flash {
@override
final String userId;
@override
final User user;
final UserLite user;
@override
final int? likedCount;
@override
Expand Down Expand Up @@ -320,7 +320,7 @@ abstract class _Flash implements Flash {
required final String summary,
required final String script,
required final String userId,
required final User user,
required final UserLite user,
final int? likedCount,
final bool isLiked}) = _$FlashImpl;

Expand All @@ -343,7 +343,7 @@ abstract class _Flash implements Flash {
@override
String get userId;
@override
User get user;
UserLite get user;
@override
int? get likedCount;
@override
Expand Down
2 changes: 1 addition & 1 deletion lib/src/data/base/flash.g.dart

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

4 changes: 2 additions & 2 deletions lib/src/data/base/follow_request.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ part 'follow_request.g.dart';
class FollowRequest with _$FollowRequest {
const factory FollowRequest({
required String id,
required User followee,
required User follower,
required UserLite followee,
required UserLite follower,
}) = _FollowRequest;

factory FollowRequest.fromJson(Map<String, dynamic> json) =>
Expand Down
Loading

0 comments on commit d465cb8

Please sign in to comment.