-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
227: refactor!: fixed for the issue (#226) 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 <kato.shinya.dev@gmail.com>
- Loading branch information
Showing
41 changed files
with
333 additions
and
41 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
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,25 @@ | ||
// Copyright 2022 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 'tweets/matching_rule.dart'; | ||
import 'tweets/tweet_data.dart'; | ||
import 'twitter_response.dart'; | ||
|
||
class FilteredStreamResponse extends TwitterResponse<TweetData, void> { | ||
/// Returns the new instance of [FilteredStreamResponse]. | ||
FilteredStreamResponse({ | ||
required super.data, | ||
super.includes, | ||
required this.matchingRules, | ||
}); | ||
|
||
/// The matching rules | ||
final List<MatchingRule> matchingRules; | ||
|
||
@override | ||
String toString() => | ||
'FilteredStreamResponse(data: $data, includes: $includes, meta: null, ' | ||
'matchingRules: $matchingRules)'; | ||
} |
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
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,20 @@ | ||
// Copyright 2022 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'; | ||
|
||
part 'matching_rule.freezed.dart'; | ||
part 'matching_rule.g.dart'; | ||
|
||
@freezed | ||
class MatchingRule with _$MatchingRule { | ||
const factory MatchingRule({ | ||
required String id, | ||
required String tag, | ||
}) = _MatchingRule; | ||
|
||
factory MatchingRule.fromJson(Map<String, Object?> json) => | ||
_$MatchingRuleFromJson(json); | ||
} |
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,165 @@ | ||
// 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 | ||
|
||
part of 'matching_rule.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'); | ||
|
||
MatchingRule _$MatchingRuleFromJson(Map<String, dynamic> json) { | ||
return _MatchingRule.fromJson(json); | ||
} | ||
|
||
/// @nodoc | ||
mixin _$MatchingRule { | ||
String get id => throw _privateConstructorUsedError; | ||
String get tag => throw _privateConstructorUsedError; | ||
|
||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError; | ||
@JsonKey(ignore: true) | ||
$MatchingRuleCopyWith<MatchingRule> get copyWith => | ||
throw _privateConstructorUsedError; | ||
} | ||
|
||
/// @nodoc | ||
abstract class $MatchingRuleCopyWith<$Res> { | ||
factory $MatchingRuleCopyWith( | ||
MatchingRule value, $Res Function(MatchingRule) then) = | ||
_$MatchingRuleCopyWithImpl<$Res>; | ||
$Res call({String id, String tag}); | ||
} | ||
|
||
/// @nodoc | ||
class _$MatchingRuleCopyWithImpl<$Res> implements $MatchingRuleCopyWith<$Res> { | ||
_$MatchingRuleCopyWithImpl(this._value, this._then); | ||
|
||
final MatchingRule _value; | ||
// ignore: unused_field | ||
final $Res Function(MatchingRule) _then; | ||
|
||
@override | ||
$Res call({ | ||
Object? id = freezed, | ||
Object? tag = freezed, | ||
}) { | ||
return _then(_value.copyWith( | ||
id: id == freezed | ||
? _value.id | ||
: id // ignore: cast_nullable_to_non_nullable | ||
as String, | ||
tag: tag == freezed | ||
? _value.tag | ||
: tag // ignore: cast_nullable_to_non_nullable | ||
as String, | ||
)); | ||
} | ||
} | ||
|
||
/// @nodoc | ||
abstract class _$$_MatchingRuleCopyWith<$Res> | ||
implements $MatchingRuleCopyWith<$Res> { | ||
factory _$$_MatchingRuleCopyWith( | ||
_$_MatchingRule value, $Res Function(_$_MatchingRule) then) = | ||
__$$_MatchingRuleCopyWithImpl<$Res>; | ||
@override | ||
$Res call({String id, String tag}); | ||
} | ||
|
||
/// @nodoc | ||
class __$$_MatchingRuleCopyWithImpl<$Res> | ||
extends _$MatchingRuleCopyWithImpl<$Res> | ||
implements _$$_MatchingRuleCopyWith<$Res> { | ||
__$$_MatchingRuleCopyWithImpl( | ||
_$_MatchingRule _value, $Res Function(_$_MatchingRule) _then) | ||
: super(_value, (v) => _then(v as _$_MatchingRule)); | ||
|
||
@override | ||
_$_MatchingRule get _value => super._value as _$_MatchingRule; | ||
|
||
@override | ||
$Res call({ | ||
Object? id = freezed, | ||
Object? tag = freezed, | ||
}) { | ||
return _then(_$_MatchingRule( | ||
id: id == freezed | ||
? _value.id | ||
: id // ignore: cast_nullable_to_non_nullable | ||
as String, | ||
tag: tag == freezed | ||
? _value.tag | ||
: tag // ignore: cast_nullable_to_non_nullable | ||
as String, | ||
)); | ||
} | ||
} | ||
|
||
/// @nodoc | ||
@JsonSerializable() | ||
class _$_MatchingRule implements _MatchingRule { | ||
const _$_MatchingRule({required this.id, required this.tag}); | ||
|
||
factory _$_MatchingRule.fromJson(Map<String, dynamic> json) => | ||
_$$_MatchingRuleFromJson(json); | ||
|
||
@override | ||
final String id; | ||
@override | ||
final String tag; | ||
|
||
@override | ||
String toString() { | ||
return 'MatchingRule(id: $id, tag: $tag)'; | ||
} | ||
|
||
@override | ||
bool operator ==(dynamic other) { | ||
return identical(this, other) || | ||
(other.runtimeType == runtimeType && | ||
other is _$_MatchingRule && | ||
const DeepCollectionEquality().equals(other.id, id) && | ||
const DeepCollectionEquality().equals(other.tag, tag)); | ||
} | ||
|
||
@JsonKey(ignore: true) | ||
@override | ||
int get hashCode => Object.hash( | ||
runtimeType, | ||
const DeepCollectionEquality().hash(id), | ||
const DeepCollectionEquality().hash(tag)); | ||
|
||
@JsonKey(ignore: true) | ||
@override | ||
_$$_MatchingRuleCopyWith<_$_MatchingRule> get copyWith => | ||
__$$_MatchingRuleCopyWithImpl<_$_MatchingRule>(this, _$identity); | ||
|
||
@override | ||
Map<String, dynamic> toJson() { | ||
return _$$_MatchingRuleToJson(this); | ||
} | ||
} | ||
|
||
abstract class _MatchingRule implements MatchingRule { | ||
const factory _MatchingRule( | ||
{required final String id, required final String tag}) = _$_MatchingRule; | ||
|
||
factory _MatchingRule.fromJson(Map<String, dynamic> json) = | ||
_$_MatchingRule.fromJson; | ||
|
||
@override | ||
String get id => throw _privateConstructorUsedError; | ||
@override | ||
String get tag => throw _privateConstructorUsedError; | ||
@override | ||
@JsonKey(ignore: true) | ||
_$$_MatchingRuleCopyWith<_$_MatchingRule> 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
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
Oops, something went wrong.