-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
631: feat: fixed for the issue (#590) r=myConsciousness a=myConsciousness # 1. Description <!-- Provide a description of what this PR is doing. If you're modifying existing behavior, describe the existing behavior, how this PR is changing it, and what motivated the change. If this is a breaking change, specify explicitly which APIs have been changed. --> ## 1.1. Checklist <!-- Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (`[x]`). This will ensure a smooth and quick review process. --> - [x] The title of my PR starts with a [Conventional Commit] prefix (`fix:`, `feat:`, `docs:` etc). - [x] I have read the [Contributor Guide] and followed the process outlined for submitting PRs. - [x] I have updated/added tests for ALL new/updated/fixed functionality. - [x] I have updated/added relevant documentation in `docs` and added dartdoc comments with `///`. - [x] I have updated/added relevant examples in `examples`. ## 1.2. Breaking Change <!-- Does your PR require users to manually update their apps to accommodate your change? If the PR is a breaking change this should be indicated with suffix "!" (for example, `feat!:`, `fix!:`). See [Conventional Commit] for details. --> - [ ] Yes, this is a breaking change. - [x] No, this is _not_ a breaking change. ## 1.3. Related Issues <!-- Provide a list of issues related to this PR from the [issue database]. Indicate which of these issues are resolved or fixed by this PR, i.e. Fixes #xxxx* !--> <!-- Links --> [issue database]: https://github.com/twitter-dart/twitter-api-v2/issues [contributor guide]: https://github.com/twitter-dart/twitter-api-v2/blob/main/CONTRIBUTING.md [style guide]: https://github.com/twitter-dart/twitter-api-v2/blob/main/STYLEGUIDE.md [conventional commit]: https://conventionalcommits.org Co-authored-by: myConsciousness <[email protected]>
- Loading branch information
Showing
17 changed files
with
1,188 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright 2023 Kato Shinya. All rights reserved. | ||
// Redistribution and use in source and binary forms, with or without | ||
// modification, are permitted provided the conditions. | ||
|
||
// 🌎 Project imports: | ||
import 'object_adaptor.dart'; | ||
|
||
class ProfileBannerObjectAdaptor implements ObjectAdaptor { | ||
/// Returns the new instance of [ProfileBannerObjectAdaptor]. | ||
const ProfileBannerObjectAdaptor(); | ||
|
||
@override | ||
Map<String, dynamic> execute(final Map<String, dynamic> source) => { | ||
'data': source['sizes'], | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright 2023 Kato Shinya. All rights reserved. | ||
// Redistribution and use in source and binary forms, with or without | ||
// modification, are permitted provided the conditions. | ||
|
||
// ignore_for_file: invalid_annotation_target | ||
|
||
// 📦 Package imports: | ||
import 'package:freezed_annotation/freezed_annotation.dart'; | ||
|
||
part 'profile_banner_variant.freezed.dart'; | ||
part 'profile_banner_variant.g.dart'; | ||
|
||
@freezed | ||
class ProfileBannerVariant with _$ProfileBannerVariant { | ||
const factory ProfileBannerVariant({ | ||
/// The height of this image. | ||
@JsonKey(name: 'h') required int height, | ||
|
||
/// The height of this image. | ||
@JsonKey(name: 'w') required int width, | ||
|
||
/// The url of this image. | ||
required String url, | ||
}) = _ProfileBannerVariant; | ||
|
||
factory ProfileBannerVariant.fromJson(Map<String, Object?> json) => | ||
_$ProfileBannerVariantFromJson(json); | ||
} |
219 changes: 219 additions & 0 deletions
219
lib/src/service/users/profile_banner_variant.freezed.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,219 @@ | ||
// coverage:ignore-file | ||
// GENERATED CODE - DO NOT MODIFY BY HAND | ||
// ignore_for_file: type=lint | ||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark | ||
|
||
part of 'profile_banner_variant.dart'; | ||
|
||
// ************************************************************************** | ||
// FreezedGenerator | ||
// ************************************************************************** | ||
|
||
T _$identity<T>(T value) => value; | ||
|
||
final _privateConstructorUsedError = UnsupportedError( | ||
'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); | ||
|
||
ProfileBannerVariant _$ProfileBannerVariantFromJson(Map<String, dynamic> json) { | ||
return _ProfileBannerVariant.fromJson(json); | ||
} | ||
|
||
/// @nodoc | ||
mixin _$ProfileBannerVariant { | ||
/// The height of this image. | ||
@JsonKey(name: 'h') | ||
int get height => throw _privateConstructorUsedError; | ||
|
||
/// The height of this image. | ||
@JsonKey(name: 'w') | ||
int get width => throw _privateConstructorUsedError; | ||
|
||
/// The url of this image. | ||
String get url => throw _privateConstructorUsedError; | ||
|
||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError; | ||
@JsonKey(ignore: true) | ||
$ProfileBannerVariantCopyWith<ProfileBannerVariant> get copyWith => | ||
throw _privateConstructorUsedError; | ||
} | ||
|
||
/// @nodoc | ||
abstract class $ProfileBannerVariantCopyWith<$Res> { | ||
factory $ProfileBannerVariantCopyWith(ProfileBannerVariant value, | ||
$Res Function(ProfileBannerVariant) then) = | ||
_$ProfileBannerVariantCopyWithImpl<$Res, ProfileBannerVariant>; | ||
@useResult | ||
$Res call( | ||
{@JsonKey(name: 'h') int height, | ||
@JsonKey(name: 'w') int width, | ||
String url}); | ||
} | ||
|
||
/// @nodoc | ||
class _$ProfileBannerVariantCopyWithImpl<$Res, | ||
$Val extends ProfileBannerVariant> | ||
implements $ProfileBannerVariantCopyWith<$Res> { | ||
_$ProfileBannerVariantCopyWithImpl(this._value, this._then); | ||
|
||
// ignore: unused_field | ||
final $Val _value; | ||
// ignore: unused_field | ||
final $Res Function($Val) _then; | ||
|
||
@pragma('vm:prefer-inline') | ||
@override | ||
$Res call({ | ||
Object? height = null, | ||
Object? width = null, | ||
Object? url = null, | ||
}) { | ||
return _then(_value.copyWith( | ||
height: null == height | ||
? _value.height | ||
: height // ignore: cast_nullable_to_non_nullable | ||
as int, | ||
width: null == width | ||
? _value.width | ||
: width // ignore: cast_nullable_to_non_nullable | ||
as int, | ||
url: null == url | ||
? _value.url | ||
: url // ignore: cast_nullable_to_non_nullable | ||
as String, | ||
) as $Val); | ||
} | ||
} | ||
|
||
/// @nodoc | ||
abstract class _$$_ProfileBannerVariantCopyWith<$Res> | ||
implements $ProfileBannerVariantCopyWith<$Res> { | ||
factory _$$_ProfileBannerVariantCopyWith(_$_ProfileBannerVariant value, | ||
$Res Function(_$_ProfileBannerVariant) then) = | ||
__$$_ProfileBannerVariantCopyWithImpl<$Res>; | ||
@override | ||
@useResult | ||
$Res call( | ||
{@JsonKey(name: 'h') int height, | ||
@JsonKey(name: 'w') int width, | ||
String url}); | ||
} | ||
|
||
/// @nodoc | ||
class __$$_ProfileBannerVariantCopyWithImpl<$Res> | ||
extends _$ProfileBannerVariantCopyWithImpl<$Res, _$_ProfileBannerVariant> | ||
implements _$$_ProfileBannerVariantCopyWith<$Res> { | ||
__$$_ProfileBannerVariantCopyWithImpl(_$_ProfileBannerVariant _value, | ||
$Res Function(_$_ProfileBannerVariant) _then) | ||
: super(_value, _then); | ||
|
||
@pragma('vm:prefer-inline') | ||
@override | ||
$Res call({ | ||
Object? height = null, | ||
Object? width = null, | ||
Object? url = null, | ||
}) { | ||
return _then(_$_ProfileBannerVariant( | ||
height: null == height | ||
? _value.height | ||
: height // ignore: cast_nullable_to_non_nullable | ||
as int, | ||
width: null == width | ||
? _value.width | ||
: width // ignore: cast_nullable_to_non_nullable | ||
as int, | ||
url: null == url | ||
? _value.url | ||
: url // ignore: cast_nullable_to_non_nullable | ||
as String, | ||
)); | ||
} | ||
} | ||
|
||
/// @nodoc | ||
@JsonSerializable() | ||
class _$_ProfileBannerVariant implements _ProfileBannerVariant { | ||
const _$_ProfileBannerVariant( | ||
{@JsonKey(name: 'h') required this.height, | ||
@JsonKey(name: 'w') required this.width, | ||
required this.url}); | ||
|
||
factory _$_ProfileBannerVariant.fromJson(Map<String, dynamic> json) => | ||
_$$_ProfileBannerVariantFromJson(json); | ||
|
||
/// The height of this image. | ||
@override | ||
@JsonKey(name: 'h') | ||
final int height; | ||
|
||
/// The height of this image. | ||
@override | ||
@JsonKey(name: 'w') | ||
final int width; | ||
|
||
/// The url of this image. | ||
@override | ||
final String url; | ||
|
||
@override | ||
String toString() { | ||
return 'ProfileBannerVariant(height: $height, width: $width, url: $url)'; | ||
} | ||
|
||
@override | ||
bool operator ==(dynamic other) { | ||
return identical(this, other) || | ||
(other.runtimeType == runtimeType && | ||
other is _$_ProfileBannerVariant && | ||
(identical(other.height, height) || other.height == height) && | ||
(identical(other.width, width) || other.width == width) && | ||
(identical(other.url, url) || other.url == url)); | ||
} | ||
|
||
@JsonKey(ignore: true) | ||
@override | ||
int get hashCode => Object.hash(runtimeType, height, width, url); | ||
|
||
@JsonKey(ignore: true) | ||
@override | ||
@pragma('vm:prefer-inline') | ||
_$$_ProfileBannerVariantCopyWith<_$_ProfileBannerVariant> get copyWith => | ||
__$$_ProfileBannerVariantCopyWithImpl<_$_ProfileBannerVariant>( | ||
this, _$identity); | ||
|
||
@override | ||
Map<String, dynamic> toJson() { | ||
return _$$_ProfileBannerVariantToJson( | ||
this, | ||
); | ||
} | ||
} | ||
|
||
abstract class _ProfileBannerVariant implements ProfileBannerVariant { | ||
const factory _ProfileBannerVariant( | ||
{@JsonKey(name: 'h') required final int height, | ||
@JsonKey(name: 'w') required final int width, | ||
required final String url}) = _$_ProfileBannerVariant; | ||
|
||
factory _ProfileBannerVariant.fromJson(Map<String, dynamic> json) = | ||
_$_ProfileBannerVariant.fromJson; | ||
|
||
@override | ||
|
||
/// The height of this image. | ||
@JsonKey(name: 'h') | ||
int get height; | ||
@override | ||
|
||
/// The height of this image. | ||
@JsonKey(name: 'w') | ||
int get width; | ||
@override | ||
|
||
/// The url of this image. | ||
String get url; | ||
@override | ||
@JsonKey(ignore: true) | ||
_$$_ProfileBannerVariantCopyWith<_$_ProfileBannerVariant> get copyWith => | ||
throw _privateConstructorUsedError; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Copyright 2023 Kato Shinya. All rights reserved. | ||
// Redistribution and use in source and binary forms, with or without | ||
// modification, are permitted provided the conditions. | ||
|
||
// 📦 Package imports: | ||
import 'package:freezed_annotation/freezed_annotation.dart'; | ||
|
||
// 🌎 Project imports: | ||
import '../common/data.dart'; | ||
import 'profile_banner_variant.dart'; | ||
|
||
part 'profile_banner_variants_data.freezed.dart'; | ||
part 'profile_banner_variants_data.g.dart'; | ||
|
||
@freezed | ||
class ProfileBannerVariantsData | ||
with _$ProfileBannerVariantsData | ||
implements Data { | ||
const factory ProfileBannerVariantsData({ | ||
/// The banner image for ipad. | ||
required ProfileBannerVariant ipad, | ||
|
||
/// The banner image for ipad retina. | ||
required ProfileBannerVariant ipadRetina, | ||
|
||
/// The banner image for web. | ||
required ProfileBannerVariant web, | ||
|
||
/// The banner image for web retina. | ||
required ProfileBannerVariant webRetina, | ||
|
||
/// The banner image for mobile. | ||
required ProfileBannerVariant mobile, | ||
|
||
/// The banner image for mobile retina. | ||
required ProfileBannerVariant mobileRetina, | ||
}) = _ProfileBannerVariantsData; | ||
|
||
factory ProfileBannerVariantsData.fromJson(Map<String, Object?> json) => | ||
_$ProfileBannerVariantsDataFromJson(json); | ||
} |
Oops, something went wrong.