Skip to content

Commit

Permalink
User関係の型をUserLiteとUserDetailedに整理
Browse files Browse the repository at this point in the history
  • Loading branch information
poppingmoon committed Oct 20, 2023
1 parent ca2b23a commit cdfc15b
Show file tree
Hide file tree
Showing 57 changed files with 5,445 additions and 4,759 deletions.
2 changes: 0 additions & 2 deletions lib/misskey_dart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,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 @@ -128,7 +127,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 @@ -146,15 +146,15 @@ abstract class _$$_ClipCopyWith<$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 @@ -197,7 +197,7 @@ class __$$_ClipCopyWithImpl<$Res> extends _$ClipCopyWithImpl<$Res, _$_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 Down Expand Up @@ -250,7 +250,7 @@ class _$_Clip implements _Clip {
@override
final String userId;
@override
final User user;
final UserLite user;
@override
final String? name;
@override
Expand Down Expand Up @@ -315,7 +315,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 @@ -335,7 +335,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 @@ -21,7 +21,7 @@ class DriveFile with _$DriveFile {
String? comment,
String? folderId,
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 @@ -34,7 +34,7 @@ mixin _$DriveFile {
String? get comment => throw _privateConstructorUsedError;
String? get folderId => 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 All @@ -61,9 +61,9 @@ abstract class $DriveFileCopyWith<$Res> {
String? comment,
String? folderId,
String? userId,
User? user});
UserLite? user});

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

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

@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 All @@ -188,10 +188,10 @@ abstract class _$$_DriveFileCopyWith<$Res> implements $DriveFileCopyWith<$Res> {
String? comment,
String? folderId,
String? userId,
User? user});
UserLite? user});

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

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

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

factory _DriveFile.fromJson(Map<String, dynamic> json) =
_$_DriveFile.fromJson;
Expand Down Expand Up @@ -445,7 +445,7 @@ abstract class _DriveFile implements DriveFile {
@override
String? get userId;
@override
User? get user;
UserLite? get user;
@override
@JsonKey(ignore: true)
_$$_DriveFileCopyWith<_$_DriveFile> 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 @@ -149,12 +149,12 @@ abstract class _$$_FlashCopyWith<$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 @@ -209,7 +209,7 @@ class __$$_FlashCopyWithImpl<$Res> extends _$FlashCopyWithImpl<$Res, _$_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 Down Expand Up @@ -257,7 +257,7 @@ class _$_Flash implements _Flash {
@override
final String userId;
@override
final User user;
final UserLite user;
@override
final int? likedCount;
@override
Expand Down Expand Up @@ -317,7 +317,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}) = _$_Flash;

Expand All @@ -340,7 +340,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 cdfc15b

Please sign in to comment.