mirror of
				https://github.com/TeamPiped/piped_dart.git
				synced 2024-08-14 22:27:49 +00:00 
			
		
		
		
	Implement support for searching.
This commit is contained in:
		
							parent
							
								
									abb6f6e71c
								
							
						
					
					
						commit
						45dcedf2ef
					
				
					 27 changed files with 2237 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -12,10 +12,15 @@ export 'package:piped_api/src/model/date.dart';
 | 
			
		|||
export 'package:piped_api/src/api/unauthenticated_api.dart';
 | 
			
		||||
 | 
			
		||||
export 'package:piped_api/src/model/channel_info.dart';
 | 
			
		||||
export 'package:piped_api/src/model/channel_item.dart';
 | 
			
		||||
export 'package:piped_api/src/model/comment.dart';
 | 
			
		||||
export 'package:piped_api/src/model/comments_page.dart';
 | 
			
		||||
export 'package:piped_api/src/model/exception_error.dart';
 | 
			
		||||
export 'package:piped_api/src/model/playlist_item.dart';
 | 
			
		||||
export 'package:piped_api/src/model/regions.dart';
 | 
			
		||||
export 'package:piped_api/src/model/search_filter.dart';
 | 
			
		||||
export 'package:piped_api/src/model/search_item.dart';
 | 
			
		||||
export 'package:piped_api/src/model/search_page.dart';
 | 
			
		||||
export 'package:piped_api/src/model/stream.dart';
 | 
			
		||||
export 'package:piped_api/src/model/stream_item.dart';
 | 
			
		||||
export 'package:piped_api/src/model/streams_page.dart';
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -13,6 +13,8 @@ import 'package:piped_api/src/model/channel_info.dart';
 | 
			
		|||
import 'package:piped_api/src/model/comments_page.dart';
 | 
			
		||||
import 'package:piped_api/src/model/exception_error.dart';
 | 
			
		||||
import 'package:piped_api/src/model/regions.dart';
 | 
			
		||||
import 'package:piped_api/src/model/search_filter.dart';
 | 
			
		||||
import 'package:piped_api/src/model/search_page.dart';
 | 
			
		||||
import 'package:piped_api/src/model/stream_item.dart';
 | 
			
		||||
import 'package:piped_api/src/model/streams_page.dart';
 | 
			
		||||
import 'package:piped_api/src/model/video_info.dart';
 | 
			
		||||
| 
						 | 
				
			
			@ -483,6 +485,173 @@ class UnauthenticatedApi {
 | 
			
		|||
    );
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /// Searches for videos, channels, and playlists.
 | 
			
		||||
  /// Searches for videos, channels, and playlists. 
 | 
			
		||||
  ///
 | 
			
		||||
  /// Parameters:
 | 
			
		||||
  /// * [q] - The search query string.
 | 
			
		||||
  /// * [filter] - The filter parameter specifies a filter query that restricts the results to items that match the filter.
 | 
			
		||||
  /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
 | 
			
		||||
  /// * [headers] - Can be used to add additional headers to the request
 | 
			
		||||
  /// * [extras] - Can be used to add flags to the request
 | 
			
		||||
  /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
 | 
			
		||||
  /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
 | 
			
		||||
  /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
 | 
			
		||||
  ///
 | 
			
		||||
  /// Returns a [Future] containing a [Response] with a [SearchPage] as data
 | 
			
		||||
  /// Throws [DioError] if API call or serialization fails
 | 
			
		||||
  Future<Response<SearchPage>> search({ 
 | 
			
		||||
    required String q,
 | 
			
		||||
    required SearchFilter filter,
 | 
			
		||||
    CancelToken? cancelToken,
 | 
			
		||||
    Map<String, dynamic>? headers,
 | 
			
		||||
    Map<String, dynamic>? extra,
 | 
			
		||||
    ValidateStatus? validateStatus,
 | 
			
		||||
    ProgressCallback? onSendProgress,
 | 
			
		||||
    ProgressCallback? onReceiveProgress,
 | 
			
		||||
  }) async {
 | 
			
		||||
    final _path = r'/search';
 | 
			
		||||
    final _options = Options(
 | 
			
		||||
      method: r'GET',
 | 
			
		||||
      headers: <String, dynamic>{
 | 
			
		||||
        ...?headers,
 | 
			
		||||
      },
 | 
			
		||||
      extra: <String, dynamic>{
 | 
			
		||||
        'secure': <Map<String, String>>[],
 | 
			
		||||
        ...?extra,
 | 
			
		||||
      },
 | 
			
		||||
      validateStatus: validateStatus,
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    final _queryParameters = <String, dynamic>{
 | 
			
		||||
      r'q': encodeQueryParameter(_serializers, q, const FullType(String)),
 | 
			
		||||
      r'filter': encodeQueryParameter(_serializers, filter, const FullType(SearchFilter)),
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    final _response = await _dio.request<Object>(
 | 
			
		||||
      _path,
 | 
			
		||||
      options: _options,
 | 
			
		||||
      queryParameters: _queryParameters,
 | 
			
		||||
      cancelToken: cancelToken,
 | 
			
		||||
      onSendProgress: onSendProgress,
 | 
			
		||||
      onReceiveProgress: onReceiveProgress,
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    SearchPage _responseData;
 | 
			
		||||
 | 
			
		||||
    try {
 | 
			
		||||
      const _responseType = FullType(SearchPage);
 | 
			
		||||
      _responseData = _serializers.deserialize(
 | 
			
		||||
        _response.data!,
 | 
			
		||||
        specifiedType: _responseType,
 | 
			
		||||
      ) as SearchPage;
 | 
			
		||||
 | 
			
		||||
    } catch (error, stackTrace) {
 | 
			
		||||
      throw DioError(
 | 
			
		||||
        requestOptions: _response.requestOptions,
 | 
			
		||||
        response: _response,
 | 
			
		||||
        type: DioErrorType.other,
 | 
			
		||||
        error: error,
 | 
			
		||||
      )..stackTrace = stackTrace;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return Response<SearchPage>(
 | 
			
		||||
      data: _responseData,
 | 
			
		||||
      headers: _response.headers,
 | 
			
		||||
      isRedirect: _response.isRedirect,
 | 
			
		||||
      requestOptions: _response.requestOptions,
 | 
			
		||||
      redirects: _response.redirects,
 | 
			
		||||
      statusCode: _response.statusCode,
 | 
			
		||||
      statusMessage: _response.statusMessage,
 | 
			
		||||
      extra: _response.extra,
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /// Gets more search results
 | 
			
		||||
  /// Gets more search results. 
 | 
			
		||||
  ///
 | 
			
		||||
  /// Parameters:
 | 
			
		||||
  /// * [nextpage] - The next page token to get more search results from.
 | 
			
		||||
  /// * [q] - The search query string.
 | 
			
		||||
  /// * [filter] - The filter parameter specifies a filter query that restricts the results to items that match the filter.
 | 
			
		||||
  /// * [cancelToken] - A [CancelToken] that can be used to cancel the operation
 | 
			
		||||
  /// * [headers] - Can be used to add additional headers to the request
 | 
			
		||||
  /// * [extras] - Can be used to add flags to the request
 | 
			
		||||
  /// * [validateStatus] - A [ValidateStatus] callback that can be used to determine request success based on the HTTP status of the response
 | 
			
		||||
  /// * [onSendProgress] - A [ProgressCallback] that can be used to get the send progress
 | 
			
		||||
  /// * [onReceiveProgress] - A [ProgressCallback] that can be used to get the receive progress
 | 
			
		||||
  ///
 | 
			
		||||
  /// Returns a [Future] containing a [Response] with a [SearchPage] as data
 | 
			
		||||
  /// Throws [DioError] if API call or serialization fails
 | 
			
		||||
  Future<Response<SearchPage>> searchNextPage({ 
 | 
			
		||||
    required String nextpage,
 | 
			
		||||
    required String q,
 | 
			
		||||
    required SearchFilter filter,
 | 
			
		||||
    CancelToken? cancelToken,
 | 
			
		||||
    Map<String, dynamic>? headers,
 | 
			
		||||
    Map<String, dynamic>? extra,
 | 
			
		||||
    ValidateStatus? validateStatus,
 | 
			
		||||
    ProgressCallback? onSendProgress,
 | 
			
		||||
    ProgressCallback? onReceiveProgress,
 | 
			
		||||
  }) async {
 | 
			
		||||
    final _path = r'/nextpage/search';
 | 
			
		||||
    final _options = Options(
 | 
			
		||||
      method: r'GET',
 | 
			
		||||
      headers: <String, dynamic>{
 | 
			
		||||
        ...?headers,
 | 
			
		||||
      },
 | 
			
		||||
      extra: <String, dynamic>{
 | 
			
		||||
        'secure': <Map<String, String>>[],
 | 
			
		||||
        ...?extra,
 | 
			
		||||
      },
 | 
			
		||||
      validateStatus: validateStatus,
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    final _queryParameters = <String, dynamic>{
 | 
			
		||||
      r'nextpage': encodeQueryParameter(_serializers, nextpage, const FullType(String)),
 | 
			
		||||
      r'q': encodeQueryParameter(_serializers, q, const FullType(String)),
 | 
			
		||||
      r'filter': encodeQueryParameter(_serializers, filter, const FullType(SearchFilter)),
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    final _response = await _dio.request<Object>(
 | 
			
		||||
      _path,
 | 
			
		||||
      options: _options,
 | 
			
		||||
      queryParameters: _queryParameters,
 | 
			
		||||
      cancelToken: cancelToken,
 | 
			
		||||
      onSendProgress: onSendProgress,
 | 
			
		||||
      onReceiveProgress: onReceiveProgress,
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    SearchPage _responseData;
 | 
			
		||||
 | 
			
		||||
    try {
 | 
			
		||||
      const _responseType = FullType(SearchPage);
 | 
			
		||||
      _responseData = _serializers.deserialize(
 | 
			
		||||
        _response.data!,
 | 
			
		||||
        specifiedType: _responseType,
 | 
			
		||||
      ) as SearchPage;
 | 
			
		||||
 | 
			
		||||
    } catch (error, stackTrace) {
 | 
			
		||||
      throw DioError(
 | 
			
		||||
        requestOptions: _response.requestOptions,
 | 
			
		||||
        response: _response,
 | 
			
		||||
        type: DioErrorType.other,
 | 
			
		||||
        error: error,
 | 
			
		||||
      )..stackTrace = stackTrace;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return Response<SearchPage>(
 | 
			
		||||
      data: _responseData,
 | 
			
		||||
      headers: _response.headers,
 | 
			
		||||
      isRedirect: _response.isRedirect,
 | 
			
		||||
      requestOptions: _response.requestOptions,
 | 
			
		||||
      redirects: _response.redirects,
 | 
			
		||||
      statusCode: _response.statusCode,
 | 
			
		||||
      statusMessage: _response.statusMessage,
 | 
			
		||||
      extra: _response.extra,
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /// Gets Video Information
 | 
			
		||||
  /// Gets all available Stream information about a video. 
 | 
			
		||||
  ///
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										168
									
								
								lib/src/model/channel_item.dart
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										168
									
								
								lib/src/model/channel_item.dart
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,168 @@
 | 
			
		|||
//
 | 
			
		||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
 | 
			
		||||
//
 | 
			
		||||
 | 
			
		||||
import 'package:built_value/built_value.dart';
 | 
			
		||||
import 'package:built_value/serializer.dart';
 | 
			
		||||
 | 
			
		||||
part 'channel_item.g.dart';
 | 
			
		||||
 | 
			
		||||
/// ChannelItem
 | 
			
		||||
///
 | 
			
		||||
/// Properties:
 | 
			
		||||
/// * [description] - The description of the channel.
 | 
			
		||||
/// * [name] - The name of the channel.
 | 
			
		||||
/// * [subscribers] - The number of subscribers the channel has.
 | 
			
		||||
/// * [thumbnail] - The thumbnail of the channel.
 | 
			
		||||
/// * [url] - The relative URL of the channel.
 | 
			
		||||
/// * [verified] - Whether the channel is verified.
 | 
			
		||||
/// * [videos] - The number of videos the channel has.
 | 
			
		||||
abstract class ChannelItem implements Built<ChannelItem, ChannelItemBuilder> {
 | 
			
		||||
    /// The description of the channel.
 | 
			
		||||
    @BuiltValueField(wireName: r'description')
 | 
			
		||||
    String? get description;
 | 
			
		||||
 | 
			
		||||
    /// The name of the channel.
 | 
			
		||||
    @BuiltValueField(wireName: r'name')
 | 
			
		||||
    String? get name;
 | 
			
		||||
 | 
			
		||||
    /// The number of subscribers the channel has.
 | 
			
		||||
    @BuiltValueField(wireName: r'subscribers')
 | 
			
		||||
    int? get subscribers;
 | 
			
		||||
 | 
			
		||||
    /// The thumbnail of the channel.
 | 
			
		||||
    @BuiltValueField(wireName: r'thumbnail')
 | 
			
		||||
    String? get thumbnail;
 | 
			
		||||
 | 
			
		||||
    /// The relative URL of the channel.
 | 
			
		||||
    @BuiltValueField(wireName: r'url')
 | 
			
		||||
    String? get url;
 | 
			
		||||
 | 
			
		||||
    /// Whether the channel is verified.
 | 
			
		||||
    @BuiltValueField(wireName: r'verified')
 | 
			
		||||
    bool? get verified;
 | 
			
		||||
 | 
			
		||||
    /// The number of videos the channel has.
 | 
			
		||||
    @BuiltValueField(wireName: r'videos')
 | 
			
		||||
    int? get videos;
 | 
			
		||||
 | 
			
		||||
    ChannelItem._();
 | 
			
		||||
 | 
			
		||||
    @BuiltValueHook(initializeBuilder: true)
 | 
			
		||||
    static void _defaults(ChannelItemBuilder b) => b;
 | 
			
		||||
 | 
			
		||||
    factory ChannelItem([void updates(ChannelItemBuilder b)]) = _$ChannelItem;
 | 
			
		||||
 | 
			
		||||
    @BuiltValueSerializer(custom: true)
 | 
			
		||||
    static Serializer<ChannelItem> get serializer => _$ChannelItemSerializer();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
class _$ChannelItemSerializer implements StructuredSerializer<ChannelItem> {
 | 
			
		||||
    @override
 | 
			
		||||
    final Iterable<Type> types = const [ChannelItem, _$ChannelItem];
 | 
			
		||||
 | 
			
		||||
    @override
 | 
			
		||||
    final String wireName = r'ChannelItem';
 | 
			
		||||
 | 
			
		||||
    @override
 | 
			
		||||
    Iterable<Object?> serialize(Serializers serializers, ChannelItem object,
 | 
			
		||||
        {FullType specifiedType = FullType.unspecified}) {
 | 
			
		||||
        final result = <Object?>[];
 | 
			
		||||
        if (object.description != null) {
 | 
			
		||||
            result
 | 
			
		||||
                ..add(r'description')
 | 
			
		||||
                ..add(serializers.serialize(object.description,
 | 
			
		||||
                    specifiedType: const FullType(String)));
 | 
			
		||||
        }
 | 
			
		||||
        if (object.name != null) {
 | 
			
		||||
            result
 | 
			
		||||
                ..add(r'name')
 | 
			
		||||
                ..add(serializers.serialize(object.name,
 | 
			
		||||
                    specifiedType: const FullType(String)));
 | 
			
		||||
        }
 | 
			
		||||
        if (object.subscribers != null) {
 | 
			
		||||
            result
 | 
			
		||||
                ..add(r'subscribers')
 | 
			
		||||
                ..add(serializers.serialize(object.subscribers,
 | 
			
		||||
                    specifiedType: const FullType(int)));
 | 
			
		||||
        }
 | 
			
		||||
        if (object.thumbnail != null) {
 | 
			
		||||
            result
 | 
			
		||||
                ..add(r'thumbnail')
 | 
			
		||||
                ..add(serializers.serialize(object.thumbnail,
 | 
			
		||||
                    specifiedType: const FullType(String)));
 | 
			
		||||
        }
 | 
			
		||||
        if (object.url != null) {
 | 
			
		||||
            result
 | 
			
		||||
                ..add(r'url')
 | 
			
		||||
                ..add(serializers.serialize(object.url,
 | 
			
		||||
                    specifiedType: const FullType(String)));
 | 
			
		||||
        }
 | 
			
		||||
        if (object.verified != null) {
 | 
			
		||||
            result
 | 
			
		||||
                ..add(r'verified')
 | 
			
		||||
                ..add(serializers.serialize(object.verified,
 | 
			
		||||
                    specifiedType: const FullType(bool)));
 | 
			
		||||
        }
 | 
			
		||||
        if (object.videos != null) {
 | 
			
		||||
            result
 | 
			
		||||
                ..add(r'videos')
 | 
			
		||||
                ..add(serializers.serialize(object.videos,
 | 
			
		||||
                    specifiedType: const FullType(int)));
 | 
			
		||||
        }
 | 
			
		||||
        return result;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @override
 | 
			
		||||
    ChannelItem deserialize(Serializers serializers, Iterable<Object?> serialized,
 | 
			
		||||
        {FullType specifiedType = FullType.unspecified}) {
 | 
			
		||||
        final result = ChannelItemBuilder();
 | 
			
		||||
 | 
			
		||||
        final iterator = serialized.iterator;
 | 
			
		||||
        while (iterator.moveNext()) {
 | 
			
		||||
            final key = iterator.current as String;
 | 
			
		||||
            iterator.moveNext();
 | 
			
		||||
            final Object? value = iterator.current;
 | 
			
		||||
            
 | 
			
		||||
            switch (key) {
 | 
			
		||||
                case r'description':
 | 
			
		||||
                    final valueDes = serializers.deserialize(value,
 | 
			
		||||
                        specifiedType: const FullType(String)) as String;
 | 
			
		||||
                    result.description = valueDes;
 | 
			
		||||
                    break;
 | 
			
		||||
                case r'name':
 | 
			
		||||
                    final valueDes = serializers.deserialize(value,
 | 
			
		||||
                        specifiedType: const FullType(String)) as String;
 | 
			
		||||
                    result.name = valueDes;
 | 
			
		||||
                    break;
 | 
			
		||||
                case r'subscribers':
 | 
			
		||||
                    final valueDes = serializers.deserialize(value,
 | 
			
		||||
                        specifiedType: const FullType(int)) as int;
 | 
			
		||||
                    result.subscribers = valueDes;
 | 
			
		||||
                    break;
 | 
			
		||||
                case r'thumbnail':
 | 
			
		||||
                    final valueDes = serializers.deserialize(value,
 | 
			
		||||
                        specifiedType: const FullType(String)) as String;
 | 
			
		||||
                    result.thumbnail = valueDes;
 | 
			
		||||
                    break;
 | 
			
		||||
                case r'url':
 | 
			
		||||
                    final valueDes = serializers.deserialize(value,
 | 
			
		||||
                        specifiedType: const FullType(String)) as String;
 | 
			
		||||
                    result.url = valueDes;
 | 
			
		||||
                    break;
 | 
			
		||||
                case r'verified':
 | 
			
		||||
                    final valueDes = serializers.deserialize(value,
 | 
			
		||||
                        specifiedType: const FullType(bool)) as bool;
 | 
			
		||||
                    result.verified = valueDes;
 | 
			
		||||
                    break;
 | 
			
		||||
                case r'videos':
 | 
			
		||||
                    final valueDes = serializers.deserialize(value,
 | 
			
		||||
                        specifiedType: const FullType(int)) as int;
 | 
			
		||||
                    result.videos = valueDes;
 | 
			
		||||
                    break;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return result.build();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										163
									
								
								lib/src/model/channel_item.g.dart
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										163
									
								
								lib/src/model/channel_item.g.dart
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,163 @@
 | 
			
		|||
// GENERATED CODE - DO NOT MODIFY BY HAND
 | 
			
		||||
 | 
			
		||||
part of 'channel_item.dart';
 | 
			
		||||
 | 
			
		||||
// **************************************************************************
 | 
			
		||||
// BuiltValueGenerator
 | 
			
		||||
// **************************************************************************
 | 
			
		||||
 | 
			
		||||
class _$ChannelItem extends ChannelItem {
 | 
			
		||||
  @override
 | 
			
		||||
  final String? description;
 | 
			
		||||
  @override
 | 
			
		||||
  final String? name;
 | 
			
		||||
  @override
 | 
			
		||||
  final int? subscribers;
 | 
			
		||||
  @override
 | 
			
		||||
  final String? thumbnail;
 | 
			
		||||
  @override
 | 
			
		||||
  final String? url;
 | 
			
		||||
  @override
 | 
			
		||||
  final bool? verified;
 | 
			
		||||
  @override
 | 
			
		||||
  final int? videos;
 | 
			
		||||
 | 
			
		||||
  factory _$ChannelItem([void Function(ChannelItemBuilder)? updates]) =>
 | 
			
		||||
      (new ChannelItemBuilder()..update(updates)).build();
 | 
			
		||||
 | 
			
		||||
  _$ChannelItem._(
 | 
			
		||||
      {this.description,
 | 
			
		||||
      this.name,
 | 
			
		||||
      this.subscribers,
 | 
			
		||||
      this.thumbnail,
 | 
			
		||||
      this.url,
 | 
			
		||||
      this.verified,
 | 
			
		||||
      this.videos})
 | 
			
		||||
      : super._();
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  ChannelItem rebuild(void Function(ChannelItemBuilder) updates) =>
 | 
			
		||||
      (toBuilder()..update(updates)).build();
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  ChannelItemBuilder toBuilder() => new ChannelItemBuilder()..replace(this);
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  bool operator ==(Object other) {
 | 
			
		||||
    if (identical(other, this)) return true;
 | 
			
		||||
    return other is ChannelItem &&
 | 
			
		||||
        description == other.description &&
 | 
			
		||||
        name == other.name &&
 | 
			
		||||
        subscribers == other.subscribers &&
 | 
			
		||||
        thumbnail == other.thumbnail &&
 | 
			
		||||
        url == other.url &&
 | 
			
		||||
        verified == other.verified &&
 | 
			
		||||
        videos == other.videos;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  int get hashCode {
 | 
			
		||||
    return $jf($jc(
 | 
			
		||||
        $jc(
 | 
			
		||||
            $jc(
 | 
			
		||||
                $jc(
 | 
			
		||||
                    $jc($jc($jc(0, description.hashCode), name.hashCode),
 | 
			
		||||
                        subscribers.hashCode),
 | 
			
		||||
                    thumbnail.hashCode),
 | 
			
		||||
                url.hashCode),
 | 
			
		||||
            verified.hashCode),
 | 
			
		||||
        videos.hashCode));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  String toString() {
 | 
			
		||||
    return (newBuiltValueToStringHelper('ChannelItem')
 | 
			
		||||
          ..add('description', description)
 | 
			
		||||
          ..add('name', name)
 | 
			
		||||
          ..add('subscribers', subscribers)
 | 
			
		||||
          ..add('thumbnail', thumbnail)
 | 
			
		||||
          ..add('url', url)
 | 
			
		||||
          ..add('verified', verified)
 | 
			
		||||
          ..add('videos', videos))
 | 
			
		||||
        .toString();
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
class ChannelItemBuilder implements Builder<ChannelItem, ChannelItemBuilder> {
 | 
			
		||||
  _$ChannelItem? _$v;
 | 
			
		||||
 | 
			
		||||
  String? _description;
 | 
			
		||||
  String? get description => _$this._description;
 | 
			
		||||
  set description(String? description) => _$this._description = description;
 | 
			
		||||
 | 
			
		||||
  String? _name;
 | 
			
		||||
  String? get name => _$this._name;
 | 
			
		||||
  set name(String? name) => _$this._name = name;
 | 
			
		||||
 | 
			
		||||
  int? _subscribers;
 | 
			
		||||
  int? get subscribers => _$this._subscribers;
 | 
			
		||||
  set subscribers(int? subscribers) => _$this._subscribers = subscribers;
 | 
			
		||||
 | 
			
		||||
  String? _thumbnail;
 | 
			
		||||
  String? get thumbnail => _$this._thumbnail;
 | 
			
		||||
  set thumbnail(String? thumbnail) => _$this._thumbnail = thumbnail;
 | 
			
		||||
 | 
			
		||||
  String? _url;
 | 
			
		||||
  String? get url => _$this._url;
 | 
			
		||||
  set url(String? url) => _$this._url = url;
 | 
			
		||||
 | 
			
		||||
  bool? _verified;
 | 
			
		||||
  bool? get verified => _$this._verified;
 | 
			
		||||
  set verified(bool? verified) => _$this._verified = verified;
 | 
			
		||||
 | 
			
		||||
  int? _videos;
 | 
			
		||||
  int? get videos => _$this._videos;
 | 
			
		||||
  set videos(int? videos) => _$this._videos = videos;
 | 
			
		||||
 | 
			
		||||
  ChannelItemBuilder() {
 | 
			
		||||
    ChannelItem._defaults(this);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  ChannelItemBuilder get _$this {
 | 
			
		||||
    final $v = _$v;
 | 
			
		||||
    if ($v != null) {
 | 
			
		||||
      _description = $v.description;
 | 
			
		||||
      _name = $v.name;
 | 
			
		||||
      _subscribers = $v.subscribers;
 | 
			
		||||
      _thumbnail = $v.thumbnail;
 | 
			
		||||
      _url = $v.url;
 | 
			
		||||
      _verified = $v.verified;
 | 
			
		||||
      _videos = $v.videos;
 | 
			
		||||
      _$v = null;
 | 
			
		||||
    }
 | 
			
		||||
    return this;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  void replace(ChannelItem other) {
 | 
			
		||||
    ArgumentError.checkNotNull(other, 'other');
 | 
			
		||||
    _$v = other as _$ChannelItem;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  void update(void Function(ChannelItemBuilder)? updates) {
 | 
			
		||||
    if (updates != null) updates(this);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  _$ChannelItem build() {
 | 
			
		||||
    final _$result = _$v ??
 | 
			
		||||
        new _$ChannelItem._(
 | 
			
		||||
            description: description,
 | 
			
		||||
            name: name,
 | 
			
		||||
            subscribers: subscribers,
 | 
			
		||||
            thumbnail: thumbnail,
 | 
			
		||||
            url: url,
 | 
			
		||||
            verified: verified,
 | 
			
		||||
            videos: videos);
 | 
			
		||||
    replace(_$result);
 | 
			
		||||
    return _$result;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new
 | 
			
		||||
							
								
								
									
										120
									
								
								lib/src/model/playlist_item.dart
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										120
									
								
								lib/src/model/playlist_item.dart
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,120 @@
 | 
			
		|||
//
 | 
			
		||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
 | 
			
		||||
//
 | 
			
		||||
 | 
			
		||||
import 'package:built_value/built_value.dart';
 | 
			
		||||
import 'package:built_value/serializer.dart';
 | 
			
		||||
 | 
			
		||||
part 'playlist_item.g.dart';
 | 
			
		||||
 | 
			
		||||
/// PlaylistItem
 | 
			
		||||
///
 | 
			
		||||
/// Properties:
 | 
			
		||||
/// * [name] - The name of the playlist.
 | 
			
		||||
/// * [thumbnail] - The thumbnail of the playlist.
 | 
			
		||||
/// * [url] - The relative URL of the playlist.
 | 
			
		||||
/// * [videos] - The number of videos in the playlist.
 | 
			
		||||
abstract class PlaylistItem implements Built<PlaylistItem, PlaylistItemBuilder> {
 | 
			
		||||
    /// The name of the playlist.
 | 
			
		||||
    @BuiltValueField(wireName: r'name')
 | 
			
		||||
    String? get name;
 | 
			
		||||
 | 
			
		||||
    /// The thumbnail of the playlist.
 | 
			
		||||
    @BuiltValueField(wireName: r'thumbnail')
 | 
			
		||||
    String? get thumbnail;
 | 
			
		||||
 | 
			
		||||
    /// The relative URL of the playlist.
 | 
			
		||||
    @BuiltValueField(wireName: r'url')
 | 
			
		||||
    String? get url;
 | 
			
		||||
 | 
			
		||||
    /// The number of videos in the playlist.
 | 
			
		||||
    @BuiltValueField(wireName: r'videos')
 | 
			
		||||
    int? get videos;
 | 
			
		||||
 | 
			
		||||
    PlaylistItem._();
 | 
			
		||||
 | 
			
		||||
    @BuiltValueHook(initializeBuilder: true)
 | 
			
		||||
    static void _defaults(PlaylistItemBuilder b) => b;
 | 
			
		||||
 | 
			
		||||
    factory PlaylistItem([void updates(PlaylistItemBuilder b)]) = _$PlaylistItem;
 | 
			
		||||
 | 
			
		||||
    @BuiltValueSerializer(custom: true)
 | 
			
		||||
    static Serializer<PlaylistItem> get serializer => _$PlaylistItemSerializer();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
class _$PlaylistItemSerializer implements StructuredSerializer<PlaylistItem> {
 | 
			
		||||
    @override
 | 
			
		||||
    final Iterable<Type> types = const [PlaylistItem, _$PlaylistItem];
 | 
			
		||||
 | 
			
		||||
    @override
 | 
			
		||||
    final String wireName = r'PlaylistItem';
 | 
			
		||||
 | 
			
		||||
    @override
 | 
			
		||||
    Iterable<Object?> serialize(Serializers serializers, PlaylistItem object,
 | 
			
		||||
        {FullType specifiedType = FullType.unspecified}) {
 | 
			
		||||
        final result = <Object?>[];
 | 
			
		||||
        if (object.name != null) {
 | 
			
		||||
            result
 | 
			
		||||
                ..add(r'name')
 | 
			
		||||
                ..add(serializers.serialize(object.name,
 | 
			
		||||
                    specifiedType: const FullType(String)));
 | 
			
		||||
        }
 | 
			
		||||
        if (object.thumbnail != null) {
 | 
			
		||||
            result
 | 
			
		||||
                ..add(r'thumbnail')
 | 
			
		||||
                ..add(serializers.serialize(object.thumbnail,
 | 
			
		||||
                    specifiedType: const FullType(String)));
 | 
			
		||||
        }
 | 
			
		||||
        if (object.url != null) {
 | 
			
		||||
            result
 | 
			
		||||
                ..add(r'url')
 | 
			
		||||
                ..add(serializers.serialize(object.url,
 | 
			
		||||
                    specifiedType: const FullType(String)));
 | 
			
		||||
        }
 | 
			
		||||
        if (object.videos != null) {
 | 
			
		||||
            result
 | 
			
		||||
                ..add(r'videos')
 | 
			
		||||
                ..add(serializers.serialize(object.videos,
 | 
			
		||||
                    specifiedType: const FullType(int)));
 | 
			
		||||
        }
 | 
			
		||||
        return result;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @override
 | 
			
		||||
    PlaylistItem deserialize(Serializers serializers, Iterable<Object?> serialized,
 | 
			
		||||
        {FullType specifiedType = FullType.unspecified}) {
 | 
			
		||||
        final result = PlaylistItemBuilder();
 | 
			
		||||
 | 
			
		||||
        final iterator = serialized.iterator;
 | 
			
		||||
        while (iterator.moveNext()) {
 | 
			
		||||
            final key = iterator.current as String;
 | 
			
		||||
            iterator.moveNext();
 | 
			
		||||
            final Object? value = iterator.current;
 | 
			
		||||
            
 | 
			
		||||
            switch (key) {
 | 
			
		||||
                case r'name':
 | 
			
		||||
                    final valueDes = serializers.deserialize(value,
 | 
			
		||||
                        specifiedType: const FullType(String)) as String;
 | 
			
		||||
                    result.name = valueDes;
 | 
			
		||||
                    break;
 | 
			
		||||
                case r'thumbnail':
 | 
			
		||||
                    final valueDes = serializers.deserialize(value,
 | 
			
		||||
                        specifiedType: const FullType(String)) as String;
 | 
			
		||||
                    result.thumbnail = valueDes;
 | 
			
		||||
                    break;
 | 
			
		||||
                case r'url':
 | 
			
		||||
                    final valueDes = serializers.deserialize(value,
 | 
			
		||||
                        specifiedType: const FullType(String)) as String;
 | 
			
		||||
                    result.url = valueDes;
 | 
			
		||||
                    break;
 | 
			
		||||
                case r'videos':
 | 
			
		||||
                    final valueDes = serializers.deserialize(value,
 | 
			
		||||
                        specifiedType: const FullType(int)) as int;
 | 
			
		||||
                    result.videos = valueDes;
 | 
			
		||||
                    break;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return result.build();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										117
									
								
								lib/src/model/playlist_item.g.dart
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										117
									
								
								lib/src/model/playlist_item.g.dart
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,117 @@
 | 
			
		|||
// GENERATED CODE - DO NOT MODIFY BY HAND
 | 
			
		||||
 | 
			
		||||
part of 'playlist_item.dart';
 | 
			
		||||
 | 
			
		||||
// **************************************************************************
 | 
			
		||||
// BuiltValueGenerator
 | 
			
		||||
// **************************************************************************
 | 
			
		||||
 | 
			
		||||
class _$PlaylistItem extends PlaylistItem {
 | 
			
		||||
  @override
 | 
			
		||||
  final String? name;
 | 
			
		||||
  @override
 | 
			
		||||
  final String? thumbnail;
 | 
			
		||||
  @override
 | 
			
		||||
  final String? url;
 | 
			
		||||
  @override
 | 
			
		||||
  final int? videos;
 | 
			
		||||
 | 
			
		||||
  factory _$PlaylistItem([void Function(PlaylistItemBuilder)? updates]) =>
 | 
			
		||||
      (new PlaylistItemBuilder()..update(updates)).build();
 | 
			
		||||
 | 
			
		||||
  _$PlaylistItem._({this.name, this.thumbnail, this.url, this.videos})
 | 
			
		||||
      : super._();
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  PlaylistItem rebuild(void Function(PlaylistItemBuilder) updates) =>
 | 
			
		||||
      (toBuilder()..update(updates)).build();
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  PlaylistItemBuilder toBuilder() => new PlaylistItemBuilder()..replace(this);
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  bool operator ==(Object other) {
 | 
			
		||||
    if (identical(other, this)) return true;
 | 
			
		||||
    return other is PlaylistItem &&
 | 
			
		||||
        name == other.name &&
 | 
			
		||||
        thumbnail == other.thumbnail &&
 | 
			
		||||
        url == other.url &&
 | 
			
		||||
        videos == other.videos;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  int get hashCode {
 | 
			
		||||
    return $jf($jc(
 | 
			
		||||
        $jc($jc($jc(0, name.hashCode), thumbnail.hashCode), url.hashCode),
 | 
			
		||||
        videos.hashCode));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  String toString() {
 | 
			
		||||
    return (newBuiltValueToStringHelper('PlaylistItem')
 | 
			
		||||
          ..add('name', name)
 | 
			
		||||
          ..add('thumbnail', thumbnail)
 | 
			
		||||
          ..add('url', url)
 | 
			
		||||
          ..add('videos', videos))
 | 
			
		||||
        .toString();
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
class PlaylistItemBuilder
 | 
			
		||||
    implements Builder<PlaylistItem, PlaylistItemBuilder> {
 | 
			
		||||
  _$PlaylistItem? _$v;
 | 
			
		||||
 | 
			
		||||
  String? _name;
 | 
			
		||||
  String? get name => _$this._name;
 | 
			
		||||
  set name(String? name) => _$this._name = name;
 | 
			
		||||
 | 
			
		||||
  String? _thumbnail;
 | 
			
		||||
  String? get thumbnail => _$this._thumbnail;
 | 
			
		||||
  set thumbnail(String? thumbnail) => _$this._thumbnail = thumbnail;
 | 
			
		||||
 | 
			
		||||
  String? _url;
 | 
			
		||||
  String? get url => _$this._url;
 | 
			
		||||
  set url(String? url) => _$this._url = url;
 | 
			
		||||
 | 
			
		||||
  int? _videos;
 | 
			
		||||
  int? get videos => _$this._videos;
 | 
			
		||||
  set videos(int? videos) => _$this._videos = videos;
 | 
			
		||||
 | 
			
		||||
  PlaylistItemBuilder() {
 | 
			
		||||
    PlaylistItem._defaults(this);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  PlaylistItemBuilder get _$this {
 | 
			
		||||
    final $v = _$v;
 | 
			
		||||
    if ($v != null) {
 | 
			
		||||
      _name = $v.name;
 | 
			
		||||
      _thumbnail = $v.thumbnail;
 | 
			
		||||
      _url = $v.url;
 | 
			
		||||
      _videos = $v.videos;
 | 
			
		||||
      _$v = null;
 | 
			
		||||
    }
 | 
			
		||||
    return this;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  void replace(PlaylistItem other) {
 | 
			
		||||
    ArgumentError.checkNotNull(other, 'other');
 | 
			
		||||
    _$v = other as _$PlaylistItem;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  void update(void Function(PlaylistItemBuilder)? updates) {
 | 
			
		||||
    if (updates != null) updates(this);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  _$PlaylistItem build() {
 | 
			
		||||
    final _$result = _$v ??
 | 
			
		||||
        new _$PlaylistItem._(
 | 
			
		||||
            name: name, thumbnail: thumbnail, url: url, videos: videos);
 | 
			
		||||
    replace(_$result);
 | 
			
		||||
    return _$result;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new
 | 
			
		||||
							
								
								
									
										45
									
								
								lib/src/model/search_filter.dart
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								lib/src/model/search_filter.dart
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,45 @@
 | 
			
		|||
//
 | 
			
		||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
 | 
			
		||||
//
 | 
			
		||||
 | 
			
		||||
import 'package:built_collection/built_collection.dart';
 | 
			
		||||
import 'package:built_value/built_value.dart';
 | 
			
		||||
import 'package:built_value/serializer.dart';
 | 
			
		||||
 | 
			
		||||
part 'search_filter.g.dart';
 | 
			
		||||
 | 
			
		||||
class SearchFilter extends EnumClass {
 | 
			
		||||
 | 
			
		||||
  @BuiltValueEnumConst(wireName: r'all')
 | 
			
		||||
  static const SearchFilter all = _$all;
 | 
			
		||||
  @BuiltValueEnumConst(wireName: r'videos')
 | 
			
		||||
  static const SearchFilter videos = _$videos;
 | 
			
		||||
  @BuiltValueEnumConst(wireName: r'channels')
 | 
			
		||||
  static const SearchFilter channels = _$channels;
 | 
			
		||||
  @BuiltValueEnumConst(wireName: r'playlists')
 | 
			
		||||
  static const SearchFilter playlists = _$playlists;
 | 
			
		||||
  @BuiltValueEnumConst(wireName: r'music_songs')
 | 
			
		||||
  static const SearchFilter musicSongs = _$musicSongs;
 | 
			
		||||
  @BuiltValueEnumConst(wireName: r'music_videos')
 | 
			
		||||
  static const SearchFilter musicVideos = _$musicVideos;
 | 
			
		||||
  @BuiltValueEnumConst(wireName: r'music_albums')
 | 
			
		||||
  static const SearchFilter musicAlbums = _$musicAlbums;
 | 
			
		||||
  @BuiltValueEnumConst(wireName: r'music_playlists')
 | 
			
		||||
  static const SearchFilter musicPlaylists = _$musicPlaylists;
 | 
			
		||||
 | 
			
		||||
  static Serializer<SearchFilter> get serializer => _$searchFilterSerializer;
 | 
			
		||||
 | 
			
		||||
  const SearchFilter._(String name): super(name);
 | 
			
		||||
 | 
			
		||||
  static BuiltSet<SearchFilter> get values => _$values;
 | 
			
		||||
  static SearchFilter valueOf(String name) => _$valueOf(name);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/// Optionally, enum_class can generate a mixin to go with your enum for use
 | 
			
		||||
/// with Angular. It exposes your enum constants as getters. So, if you mix it
 | 
			
		||||
/// in to your Dart component class, the values become available to the
 | 
			
		||||
/// corresponding Angular template.
 | 
			
		||||
///
 | 
			
		||||
/// Trigger mixin generation by writing a line like this one next to your enum.
 | 
			
		||||
abstract class SearchFilterMixin = Object with _$SearchFilterMixin;
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										114
									
								
								lib/src/model/search_filter.g.dart
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										114
									
								
								lib/src/model/search_filter.g.dart
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,114 @@
 | 
			
		|||
// GENERATED CODE - DO NOT MODIFY BY HAND
 | 
			
		||||
 | 
			
		||||
part of 'search_filter.dart';
 | 
			
		||||
 | 
			
		||||
// **************************************************************************
 | 
			
		||||
// BuiltValueGenerator
 | 
			
		||||
// **************************************************************************
 | 
			
		||||
 | 
			
		||||
const SearchFilter _$all = const SearchFilter._('all');
 | 
			
		||||
const SearchFilter _$videos = const SearchFilter._('videos');
 | 
			
		||||
const SearchFilter _$channels = const SearchFilter._('channels');
 | 
			
		||||
const SearchFilter _$playlists = const SearchFilter._('playlists');
 | 
			
		||||
const SearchFilter _$musicSongs = const SearchFilter._('musicSongs');
 | 
			
		||||
const SearchFilter _$musicVideos = const SearchFilter._('musicVideos');
 | 
			
		||||
const SearchFilter _$musicAlbums = const SearchFilter._('musicAlbums');
 | 
			
		||||
const SearchFilter _$musicPlaylists = const SearchFilter._('musicPlaylists');
 | 
			
		||||
 | 
			
		||||
SearchFilter _$valueOf(String name) {
 | 
			
		||||
  switch (name) {
 | 
			
		||||
    case 'all':
 | 
			
		||||
      return _$all;
 | 
			
		||||
    case 'videos':
 | 
			
		||||
      return _$videos;
 | 
			
		||||
    case 'channels':
 | 
			
		||||
      return _$channels;
 | 
			
		||||
    case 'playlists':
 | 
			
		||||
      return _$playlists;
 | 
			
		||||
    case 'musicSongs':
 | 
			
		||||
      return _$musicSongs;
 | 
			
		||||
    case 'musicVideos':
 | 
			
		||||
      return _$musicVideos;
 | 
			
		||||
    case 'musicAlbums':
 | 
			
		||||
      return _$musicAlbums;
 | 
			
		||||
    case 'musicPlaylists':
 | 
			
		||||
      return _$musicPlaylists;
 | 
			
		||||
    default:
 | 
			
		||||
      throw new ArgumentError(name);
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
final BuiltSet<SearchFilter> _$values =
 | 
			
		||||
    new BuiltSet<SearchFilter>(const <SearchFilter>[
 | 
			
		||||
  _$all,
 | 
			
		||||
  _$videos,
 | 
			
		||||
  _$channels,
 | 
			
		||||
  _$playlists,
 | 
			
		||||
  _$musicSongs,
 | 
			
		||||
  _$musicVideos,
 | 
			
		||||
  _$musicAlbums,
 | 
			
		||||
  _$musicPlaylists,
 | 
			
		||||
]);
 | 
			
		||||
 | 
			
		||||
class _$SearchFilterMeta {
 | 
			
		||||
  const _$SearchFilterMeta();
 | 
			
		||||
  SearchFilter get all => _$all;
 | 
			
		||||
  SearchFilter get videos => _$videos;
 | 
			
		||||
  SearchFilter get channels => _$channels;
 | 
			
		||||
  SearchFilter get playlists => _$playlists;
 | 
			
		||||
  SearchFilter get musicSongs => _$musicSongs;
 | 
			
		||||
  SearchFilter get musicVideos => _$musicVideos;
 | 
			
		||||
  SearchFilter get musicAlbums => _$musicAlbums;
 | 
			
		||||
  SearchFilter get musicPlaylists => _$musicPlaylists;
 | 
			
		||||
  SearchFilter valueOf(String name) => _$valueOf(name);
 | 
			
		||||
  BuiltSet<SearchFilter> get values => _$values;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
abstract class _$SearchFilterMixin {
 | 
			
		||||
  // ignore: non_constant_identifier_names
 | 
			
		||||
  _$SearchFilterMeta get SearchFilter => const _$SearchFilterMeta();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Serializer<SearchFilter> _$searchFilterSerializer =
 | 
			
		||||
    new _$SearchFilterSerializer();
 | 
			
		||||
 | 
			
		||||
class _$SearchFilterSerializer implements PrimitiveSerializer<SearchFilter> {
 | 
			
		||||
  static const Map<String, Object> _toWire = const <String, Object>{
 | 
			
		||||
    'all': 'all',
 | 
			
		||||
    'videos': 'videos',
 | 
			
		||||
    'channels': 'channels',
 | 
			
		||||
    'playlists': 'playlists',
 | 
			
		||||
    'musicSongs': 'music_songs',
 | 
			
		||||
    'musicVideos': 'music_videos',
 | 
			
		||||
    'musicAlbums': 'music_albums',
 | 
			
		||||
    'musicPlaylists': 'music_playlists',
 | 
			
		||||
  };
 | 
			
		||||
  static const Map<Object, String> _fromWire = const <Object, String>{
 | 
			
		||||
    'all': 'all',
 | 
			
		||||
    'videos': 'videos',
 | 
			
		||||
    'channels': 'channels',
 | 
			
		||||
    'playlists': 'playlists',
 | 
			
		||||
    'music_songs': 'musicSongs',
 | 
			
		||||
    'music_videos': 'musicVideos',
 | 
			
		||||
    'music_albums': 'musicAlbums',
 | 
			
		||||
    'music_playlists': 'musicPlaylists',
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  final Iterable<Type> types = const <Type>[SearchFilter];
 | 
			
		||||
  @override
 | 
			
		||||
  final String wireName = 'SearchFilter';
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  Object serialize(Serializers serializers, SearchFilter object,
 | 
			
		||||
          {FullType specifiedType = FullType.unspecified}) =>
 | 
			
		||||
      _toWire[object.name] ?? object.name;
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  SearchFilter deserialize(Serializers serializers, Object serialized,
 | 
			
		||||
          {FullType specifiedType = FullType.unspecified}) =>
 | 
			
		||||
      SearchFilter.valueOf(
 | 
			
		||||
          _fromWire[serialized] ?? (serialized is String ? serialized : ''));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new
 | 
			
		||||
							
								
								
									
										309
									
								
								lib/src/model/search_item.dart
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										309
									
								
								lib/src/model/search_item.dart
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,309 @@
 | 
			
		|||
//
 | 
			
		||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
 | 
			
		||||
//
 | 
			
		||||
 | 
			
		||||
import 'package:piped_api/src/model/stream_item.dart';
 | 
			
		||||
import 'package:piped_api/src/model/channel_item.dart';
 | 
			
		||||
import 'package:piped_api/src/model/playlist_item.dart';
 | 
			
		||||
import 'package:built_value/built_value.dart';
 | 
			
		||||
import 'package:built_value/serializer.dart';
 | 
			
		||||
 | 
			
		||||
part 'search_item.g.dart';
 | 
			
		||||
 | 
			
		||||
/// SearchItem
 | 
			
		||||
///
 | 
			
		||||
/// Properties:
 | 
			
		||||
/// * [duration] - The duration of the video in seconds.
 | 
			
		||||
/// * [thumbnail] - The thumbnail of the playlist.
 | 
			
		||||
/// * [title] - The title of the video.
 | 
			
		||||
/// * [uploaded] - The date in unix epoch the video was uploaded.
 | 
			
		||||
/// * [uploadedDate] - The relative date the video was uploaded on.
 | 
			
		||||
/// * [uploaderAvatar] - The avatar of the channel of the video.
 | 
			
		||||
/// * [uploaderName] - The name of the channel of the video.
 | 
			
		||||
/// * [uploaderUrl] - The relative URL of the channel of the video.
 | 
			
		||||
/// * [uploaderVerified] - Whether or not the channel has a verified badge.
 | 
			
		||||
/// * [url] - The relative URL of the playlist.
 | 
			
		||||
/// * [views] - The number of views the video has.
 | 
			
		||||
/// * [description] - The description of the channel.
 | 
			
		||||
/// * [name] - The name of the playlist.
 | 
			
		||||
/// * [subscribers] - The number of subscribers the channel has.
 | 
			
		||||
/// * [verified] - Whether the channel is verified.
 | 
			
		||||
/// * [videos] - The number of videos in the playlist.
 | 
			
		||||
abstract class SearchItem implements Built<SearchItem, SearchItemBuilder> {
 | 
			
		||||
    /// The duration of the video in seconds.
 | 
			
		||||
    @BuiltValueField(wireName: r'duration')
 | 
			
		||||
    int get duration;
 | 
			
		||||
 | 
			
		||||
    /// The thumbnail of the playlist.
 | 
			
		||||
    @BuiltValueField(wireName: r'thumbnail')
 | 
			
		||||
    String get thumbnail;
 | 
			
		||||
 | 
			
		||||
    /// The title of the video.
 | 
			
		||||
    @BuiltValueField(wireName: r'title')
 | 
			
		||||
    String get title;
 | 
			
		||||
 | 
			
		||||
    /// The date in unix epoch the video was uploaded.
 | 
			
		||||
    @BuiltValueField(wireName: r'uploaded')
 | 
			
		||||
    int? get uploaded;
 | 
			
		||||
 | 
			
		||||
    /// The relative date the video was uploaded on.
 | 
			
		||||
    @BuiltValueField(wireName: r'uploadedDate')
 | 
			
		||||
    String? get uploadedDate;
 | 
			
		||||
 | 
			
		||||
    /// The avatar of the channel of the video.
 | 
			
		||||
    @BuiltValueField(wireName: r'uploaderAvatar')
 | 
			
		||||
    String? get uploaderAvatar;
 | 
			
		||||
 | 
			
		||||
    /// The name of the channel of the video.
 | 
			
		||||
    @BuiltValueField(wireName: r'uploaderName')
 | 
			
		||||
    String? get uploaderName;
 | 
			
		||||
 | 
			
		||||
    /// The relative URL of the channel of the video.
 | 
			
		||||
    @BuiltValueField(wireName: r'uploaderUrl')
 | 
			
		||||
    String? get uploaderUrl;
 | 
			
		||||
 | 
			
		||||
    /// Whether or not the channel has a verified badge.
 | 
			
		||||
    @BuiltValueField(wireName: r'uploaderVerified')
 | 
			
		||||
    bool? get uploaderVerified;
 | 
			
		||||
 | 
			
		||||
    /// The relative URL of the playlist.
 | 
			
		||||
    @BuiltValueField(wireName: r'url')
 | 
			
		||||
    String get url;
 | 
			
		||||
 | 
			
		||||
    /// The number of views the video has.
 | 
			
		||||
    @BuiltValueField(wireName: r'views')
 | 
			
		||||
    int? get views;
 | 
			
		||||
 | 
			
		||||
    /// The description of the channel.
 | 
			
		||||
    @BuiltValueField(wireName: r'description')
 | 
			
		||||
    String? get description;
 | 
			
		||||
 | 
			
		||||
    /// The name of the playlist.
 | 
			
		||||
    @BuiltValueField(wireName: r'name')
 | 
			
		||||
    String? get name;
 | 
			
		||||
 | 
			
		||||
    /// The number of subscribers the channel has.
 | 
			
		||||
    @BuiltValueField(wireName: r'subscribers')
 | 
			
		||||
    int? get subscribers;
 | 
			
		||||
 | 
			
		||||
    /// Whether the channel is verified.
 | 
			
		||||
    @BuiltValueField(wireName: r'verified')
 | 
			
		||||
    bool? get verified;
 | 
			
		||||
 | 
			
		||||
    /// The number of videos in the playlist.
 | 
			
		||||
    @BuiltValueField(wireName: r'videos')
 | 
			
		||||
    int? get videos;
 | 
			
		||||
 | 
			
		||||
    SearchItem._();
 | 
			
		||||
 | 
			
		||||
    @BuiltValueHook(initializeBuilder: true)
 | 
			
		||||
    static void _defaults(SearchItemBuilder b) => b;
 | 
			
		||||
 | 
			
		||||
    factory SearchItem([void updates(SearchItemBuilder b)]) = _$SearchItem;
 | 
			
		||||
 | 
			
		||||
    @BuiltValueSerializer(custom: true)
 | 
			
		||||
    static Serializer<SearchItem> get serializer => _$SearchItemSerializer();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
class _$SearchItemSerializer implements StructuredSerializer<SearchItem> {
 | 
			
		||||
    @override
 | 
			
		||||
    final Iterable<Type> types = const [SearchItem, _$SearchItem];
 | 
			
		||||
 | 
			
		||||
    @override
 | 
			
		||||
    final String wireName = r'SearchItem';
 | 
			
		||||
 | 
			
		||||
    @override
 | 
			
		||||
    Iterable<Object?> serialize(Serializers serializers, SearchItem object,
 | 
			
		||||
        {FullType specifiedType = FullType.unspecified}) {
 | 
			
		||||
        final result = <Object?>[];
 | 
			
		||||
        result
 | 
			
		||||
            ..add(r'duration')
 | 
			
		||||
            ..add(serializers.serialize(object.duration,
 | 
			
		||||
                specifiedType: const FullType(int)));
 | 
			
		||||
        result
 | 
			
		||||
            ..add(r'thumbnail')
 | 
			
		||||
            ..add(serializers.serialize(object.thumbnail,
 | 
			
		||||
                specifiedType: const FullType(String)));
 | 
			
		||||
        result
 | 
			
		||||
            ..add(r'title')
 | 
			
		||||
            ..add(serializers.serialize(object.title,
 | 
			
		||||
                specifiedType: const FullType(String)));
 | 
			
		||||
        if (object.uploaded != null) {
 | 
			
		||||
            result
 | 
			
		||||
                ..add(r'uploaded')
 | 
			
		||||
                ..add(serializers.serialize(object.uploaded,
 | 
			
		||||
                    specifiedType: const FullType(int)));
 | 
			
		||||
        }
 | 
			
		||||
        if (object.uploadedDate != null) {
 | 
			
		||||
            result
 | 
			
		||||
                ..add(r'uploadedDate')
 | 
			
		||||
                ..add(serializers.serialize(object.uploadedDate,
 | 
			
		||||
                    specifiedType: const FullType.nullable(String)));
 | 
			
		||||
        }
 | 
			
		||||
        if (object.uploaderAvatar != null) {
 | 
			
		||||
            result
 | 
			
		||||
                ..add(r'uploaderAvatar')
 | 
			
		||||
                ..add(serializers.serialize(object.uploaderAvatar,
 | 
			
		||||
                    specifiedType: const FullType.nullable(String)));
 | 
			
		||||
        }
 | 
			
		||||
        if (object.uploaderName != null) {
 | 
			
		||||
            result
 | 
			
		||||
                ..add(r'uploaderName')
 | 
			
		||||
                ..add(serializers.serialize(object.uploaderName,
 | 
			
		||||
                    specifiedType: const FullType(String)));
 | 
			
		||||
        }
 | 
			
		||||
        if (object.uploaderUrl != null) {
 | 
			
		||||
            result
 | 
			
		||||
                ..add(r'uploaderUrl')
 | 
			
		||||
                ..add(serializers.serialize(object.uploaderUrl,
 | 
			
		||||
                    specifiedType: const FullType(String)));
 | 
			
		||||
        }
 | 
			
		||||
        if (object.uploaderVerified != null) {
 | 
			
		||||
            result
 | 
			
		||||
                ..add(r'uploaderVerified')
 | 
			
		||||
                ..add(serializers.serialize(object.uploaderVerified,
 | 
			
		||||
                    specifiedType: const FullType(bool)));
 | 
			
		||||
        }
 | 
			
		||||
        result
 | 
			
		||||
            ..add(r'url')
 | 
			
		||||
            ..add(serializers.serialize(object.url,
 | 
			
		||||
                specifiedType: const FullType(String)));
 | 
			
		||||
        if (object.views != null) {
 | 
			
		||||
            result
 | 
			
		||||
                ..add(r'views')
 | 
			
		||||
                ..add(serializers.serialize(object.views,
 | 
			
		||||
                    specifiedType: const FullType(int)));
 | 
			
		||||
        }
 | 
			
		||||
        if (object.description != null) {
 | 
			
		||||
            result
 | 
			
		||||
                ..add(r'description')
 | 
			
		||||
                ..add(serializers.serialize(object.description,
 | 
			
		||||
                    specifiedType: const FullType(String)));
 | 
			
		||||
        }
 | 
			
		||||
        if (object.name != null) {
 | 
			
		||||
            result
 | 
			
		||||
                ..add(r'name')
 | 
			
		||||
                ..add(serializers.serialize(object.name,
 | 
			
		||||
                    specifiedType: const FullType(String)));
 | 
			
		||||
        }
 | 
			
		||||
        if (object.subscribers != null) {
 | 
			
		||||
            result
 | 
			
		||||
                ..add(r'subscribers')
 | 
			
		||||
                ..add(serializers.serialize(object.subscribers,
 | 
			
		||||
                    specifiedType: const FullType(int)));
 | 
			
		||||
        }
 | 
			
		||||
        if (object.verified != null) {
 | 
			
		||||
            result
 | 
			
		||||
                ..add(r'verified')
 | 
			
		||||
                ..add(serializers.serialize(object.verified,
 | 
			
		||||
                    specifiedType: const FullType(bool)));
 | 
			
		||||
        }
 | 
			
		||||
        if (object.videos != null) {
 | 
			
		||||
            result
 | 
			
		||||
                ..add(r'videos')
 | 
			
		||||
                ..add(serializers.serialize(object.videos,
 | 
			
		||||
                    specifiedType: const FullType(int)));
 | 
			
		||||
        }
 | 
			
		||||
        return result;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @override
 | 
			
		||||
    SearchItem deserialize(Serializers serializers, Iterable<Object?> serialized,
 | 
			
		||||
        {FullType specifiedType = FullType.unspecified}) {
 | 
			
		||||
        final result = SearchItemBuilder();
 | 
			
		||||
 | 
			
		||||
        final iterator = serialized.iterator;
 | 
			
		||||
        while (iterator.moveNext()) {
 | 
			
		||||
            final key = iterator.current as String;
 | 
			
		||||
            iterator.moveNext();
 | 
			
		||||
            final Object? value = iterator.current;
 | 
			
		||||
            
 | 
			
		||||
            switch (key) {
 | 
			
		||||
                case r'duration':
 | 
			
		||||
                    final valueDes = serializers.deserialize(value,
 | 
			
		||||
                        specifiedType: const FullType(int)) as int;
 | 
			
		||||
                    result.duration = valueDes;
 | 
			
		||||
                    break;
 | 
			
		||||
                case r'thumbnail':
 | 
			
		||||
                    final valueDes = serializers.deserialize(value,
 | 
			
		||||
                        specifiedType: const FullType(String)) as String;
 | 
			
		||||
                    result.thumbnail = valueDes;
 | 
			
		||||
                    break;
 | 
			
		||||
                case r'title':
 | 
			
		||||
                    final valueDes = serializers.deserialize(value,
 | 
			
		||||
                        specifiedType: const FullType(String)) as String;
 | 
			
		||||
                    result.title = valueDes;
 | 
			
		||||
                    break;
 | 
			
		||||
                case r'uploaded':
 | 
			
		||||
                    final valueDes = serializers.deserialize(value,
 | 
			
		||||
                        specifiedType: const FullType(int)) as int;
 | 
			
		||||
                    result.uploaded = valueDes;
 | 
			
		||||
                    break;
 | 
			
		||||
                case r'uploadedDate':
 | 
			
		||||
                    final valueDes = serializers.deserialize(value,
 | 
			
		||||
                        specifiedType: const FullType.nullable(String)) as String?;
 | 
			
		||||
                    if (valueDes == null) continue;
 | 
			
		||||
                    result.uploadedDate = valueDes;
 | 
			
		||||
                    break;
 | 
			
		||||
                case r'uploaderAvatar':
 | 
			
		||||
                    final valueDes = serializers.deserialize(value,
 | 
			
		||||
                        specifiedType: const FullType.nullable(String)) as String?;
 | 
			
		||||
                    if (valueDes == null) continue;
 | 
			
		||||
                    result.uploaderAvatar = valueDes;
 | 
			
		||||
                    break;
 | 
			
		||||
                case r'uploaderName':
 | 
			
		||||
                    final valueDes = serializers.deserialize(value,
 | 
			
		||||
                        specifiedType: const FullType(String)) as String;
 | 
			
		||||
                    result.uploaderName = valueDes;
 | 
			
		||||
                    break;
 | 
			
		||||
                case r'uploaderUrl':
 | 
			
		||||
                    final valueDes = serializers.deserialize(value,
 | 
			
		||||
                        specifiedType: const FullType(String)) as String;
 | 
			
		||||
                    result.uploaderUrl = valueDes;
 | 
			
		||||
                    break;
 | 
			
		||||
                case r'uploaderVerified':
 | 
			
		||||
                    final valueDes = serializers.deserialize(value,
 | 
			
		||||
                        specifiedType: const FullType(bool)) as bool;
 | 
			
		||||
                    result.uploaderVerified = valueDes;
 | 
			
		||||
                    break;
 | 
			
		||||
                case r'url':
 | 
			
		||||
                    final valueDes = serializers.deserialize(value,
 | 
			
		||||
                        specifiedType: const FullType(String)) as String;
 | 
			
		||||
                    result.url = valueDes;
 | 
			
		||||
                    break;
 | 
			
		||||
                case r'views':
 | 
			
		||||
                    final valueDes = serializers.deserialize(value,
 | 
			
		||||
                        specifiedType: const FullType(int)) as int;
 | 
			
		||||
                    result.views = valueDes;
 | 
			
		||||
                    break;
 | 
			
		||||
                case r'description':
 | 
			
		||||
                    final valueDes = serializers.deserialize(value,
 | 
			
		||||
                        specifiedType: const FullType(String)) as String;
 | 
			
		||||
                    result.description = valueDes;
 | 
			
		||||
                    break;
 | 
			
		||||
                case r'name':
 | 
			
		||||
                    final valueDes = serializers.deserialize(value,
 | 
			
		||||
                        specifiedType: const FullType(String)) as String;
 | 
			
		||||
                    result.name = valueDes;
 | 
			
		||||
                    break;
 | 
			
		||||
                case r'subscribers':
 | 
			
		||||
                    final valueDes = serializers.deserialize(value,
 | 
			
		||||
                        specifiedType: const FullType(int)) as int;
 | 
			
		||||
                    result.subscribers = valueDes;
 | 
			
		||||
                    break;
 | 
			
		||||
                case r'verified':
 | 
			
		||||
                    final valueDes = serializers.deserialize(value,
 | 
			
		||||
                        specifiedType: const FullType(bool)) as bool;
 | 
			
		||||
                    result.verified = valueDes;
 | 
			
		||||
                    break;
 | 
			
		||||
                case r'videos':
 | 
			
		||||
                    final valueDes = serializers.deserialize(value,
 | 
			
		||||
                        specifiedType: const FullType(int)) as int;
 | 
			
		||||
                    result.videos = valueDes;
 | 
			
		||||
                    break;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return result.build();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										298
									
								
								lib/src/model/search_item.g.dart
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										298
									
								
								lib/src/model/search_item.g.dart
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,298 @@
 | 
			
		|||
// GENERATED CODE - DO NOT MODIFY BY HAND
 | 
			
		||||
 | 
			
		||||
part of 'search_item.dart';
 | 
			
		||||
 | 
			
		||||
// **************************************************************************
 | 
			
		||||
// BuiltValueGenerator
 | 
			
		||||
// **************************************************************************
 | 
			
		||||
 | 
			
		||||
class _$SearchItem extends SearchItem {
 | 
			
		||||
  @override
 | 
			
		||||
  final int duration;
 | 
			
		||||
  @override
 | 
			
		||||
  final String thumbnail;
 | 
			
		||||
  @override
 | 
			
		||||
  final String title;
 | 
			
		||||
  @override
 | 
			
		||||
  final int? uploaded;
 | 
			
		||||
  @override
 | 
			
		||||
  final String? uploadedDate;
 | 
			
		||||
  @override
 | 
			
		||||
  final String? uploaderAvatar;
 | 
			
		||||
  @override
 | 
			
		||||
  final String? uploaderName;
 | 
			
		||||
  @override
 | 
			
		||||
  final String? uploaderUrl;
 | 
			
		||||
  @override
 | 
			
		||||
  final bool? uploaderVerified;
 | 
			
		||||
  @override
 | 
			
		||||
  final String url;
 | 
			
		||||
  @override
 | 
			
		||||
  final int? views;
 | 
			
		||||
  @override
 | 
			
		||||
  final String? description;
 | 
			
		||||
  @override
 | 
			
		||||
  final String? name;
 | 
			
		||||
  @override
 | 
			
		||||
  final int? subscribers;
 | 
			
		||||
  @override
 | 
			
		||||
  final bool? verified;
 | 
			
		||||
  @override
 | 
			
		||||
  final int? videos;
 | 
			
		||||
 | 
			
		||||
  factory _$SearchItem([void Function(SearchItemBuilder)? updates]) =>
 | 
			
		||||
      (new SearchItemBuilder()..update(updates)).build();
 | 
			
		||||
 | 
			
		||||
  _$SearchItem._(
 | 
			
		||||
      {required this.duration,
 | 
			
		||||
      required this.thumbnail,
 | 
			
		||||
      required this.title,
 | 
			
		||||
      this.uploaded,
 | 
			
		||||
      this.uploadedDate,
 | 
			
		||||
      this.uploaderAvatar,
 | 
			
		||||
      this.uploaderName,
 | 
			
		||||
      this.uploaderUrl,
 | 
			
		||||
      this.uploaderVerified,
 | 
			
		||||
      required this.url,
 | 
			
		||||
      this.views,
 | 
			
		||||
      this.description,
 | 
			
		||||
      this.name,
 | 
			
		||||
      this.subscribers,
 | 
			
		||||
      this.verified,
 | 
			
		||||
      this.videos})
 | 
			
		||||
      : super._() {
 | 
			
		||||
    BuiltValueNullFieldError.checkNotNull(duration, 'SearchItem', 'duration');
 | 
			
		||||
    BuiltValueNullFieldError.checkNotNull(thumbnail, 'SearchItem', 'thumbnail');
 | 
			
		||||
    BuiltValueNullFieldError.checkNotNull(title, 'SearchItem', 'title');
 | 
			
		||||
    BuiltValueNullFieldError.checkNotNull(url, 'SearchItem', 'url');
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  SearchItem rebuild(void Function(SearchItemBuilder) updates) =>
 | 
			
		||||
      (toBuilder()..update(updates)).build();
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  SearchItemBuilder toBuilder() => new SearchItemBuilder()..replace(this);
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  bool operator ==(Object other) {
 | 
			
		||||
    if (identical(other, this)) return true;
 | 
			
		||||
    return other is SearchItem &&
 | 
			
		||||
        duration == other.duration &&
 | 
			
		||||
        thumbnail == other.thumbnail &&
 | 
			
		||||
        title == other.title &&
 | 
			
		||||
        uploaded == other.uploaded &&
 | 
			
		||||
        uploadedDate == other.uploadedDate &&
 | 
			
		||||
        uploaderAvatar == other.uploaderAvatar &&
 | 
			
		||||
        uploaderName == other.uploaderName &&
 | 
			
		||||
        uploaderUrl == other.uploaderUrl &&
 | 
			
		||||
        uploaderVerified == other.uploaderVerified &&
 | 
			
		||||
        url == other.url &&
 | 
			
		||||
        views == other.views &&
 | 
			
		||||
        description == other.description &&
 | 
			
		||||
        name == other.name &&
 | 
			
		||||
        subscribers == other.subscribers &&
 | 
			
		||||
        verified == other.verified &&
 | 
			
		||||
        videos == other.videos;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  int get hashCode {
 | 
			
		||||
    return $jf($jc(
 | 
			
		||||
        $jc(
 | 
			
		||||
            $jc(
 | 
			
		||||
                $jc(
 | 
			
		||||
                    $jc(
 | 
			
		||||
                        $jc(
 | 
			
		||||
                            $jc(
 | 
			
		||||
                                $jc(
 | 
			
		||||
                                    $jc(
 | 
			
		||||
                                        $jc(
 | 
			
		||||
                                            $jc(
 | 
			
		||||
                                                $jc(
 | 
			
		||||
                                                    $jc(
 | 
			
		||||
                                                        $jc(
 | 
			
		||||
                                                            $jc(
 | 
			
		||||
                                                                $jc(
 | 
			
		||||
                                                                    0,
 | 
			
		||||
                                                                    duration
 | 
			
		||||
                                                                        .hashCode),
 | 
			
		||||
                                                                thumbnail
 | 
			
		||||
                                                                    .hashCode),
 | 
			
		||||
                                                            title.hashCode),
 | 
			
		||||
                                                        uploaded.hashCode),
 | 
			
		||||
                                                    uploadedDate.hashCode),
 | 
			
		||||
                                                uploaderAvatar.hashCode),
 | 
			
		||||
                                            uploaderName.hashCode),
 | 
			
		||||
                                        uploaderUrl.hashCode),
 | 
			
		||||
                                    uploaderVerified.hashCode),
 | 
			
		||||
                                url.hashCode),
 | 
			
		||||
                            views.hashCode),
 | 
			
		||||
                        description.hashCode),
 | 
			
		||||
                    name.hashCode),
 | 
			
		||||
                subscribers.hashCode),
 | 
			
		||||
            verified.hashCode),
 | 
			
		||||
        videos.hashCode));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  String toString() {
 | 
			
		||||
    return (newBuiltValueToStringHelper('SearchItem')
 | 
			
		||||
          ..add('duration', duration)
 | 
			
		||||
          ..add('thumbnail', thumbnail)
 | 
			
		||||
          ..add('title', title)
 | 
			
		||||
          ..add('uploaded', uploaded)
 | 
			
		||||
          ..add('uploadedDate', uploadedDate)
 | 
			
		||||
          ..add('uploaderAvatar', uploaderAvatar)
 | 
			
		||||
          ..add('uploaderName', uploaderName)
 | 
			
		||||
          ..add('uploaderUrl', uploaderUrl)
 | 
			
		||||
          ..add('uploaderVerified', uploaderVerified)
 | 
			
		||||
          ..add('url', url)
 | 
			
		||||
          ..add('views', views)
 | 
			
		||||
          ..add('description', description)
 | 
			
		||||
          ..add('name', name)
 | 
			
		||||
          ..add('subscribers', subscribers)
 | 
			
		||||
          ..add('verified', verified)
 | 
			
		||||
          ..add('videos', videos))
 | 
			
		||||
        .toString();
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
class SearchItemBuilder implements Builder<SearchItem, SearchItemBuilder> {
 | 
			
		||||
  _$SearchItem? _$v;
 | 
			
		||||
 | 
			
		||||
  int? _duration;
 | 
			
		||||
  int? get duration => _$this._duration;
 | 
			
		||||
  set duration(int? duration) => _$this._duration = duration;
 | 
			
		||||
 | 
			
		||||
  String? _thumbnail;
 | 
			
		||||
  String? get thumbnail => _$this._thumbnail;
 | 
			
		||||
  set thumbnail(String? thumbnail) => _$this._thumbnail = thumbnail;
 | 
			
		||||
 | 
			
		||||
  String? _title;
 | 
			
		||||
  String? get title => _$this._title;
 | 
			
		||||
  set title(String? title) => _$this._title = title;
 | 
			
		||||
 | 
			
		||||
  int? _uploaded;
 | 
			
		||||
  int? get uploaded => _$this._uploaded;
 | 
			
		||||
  set uploaded(int? uploaded) => _$this._uploaded = uploaded;
 | 
			
		||||
 | 
			
		||||
  String? _uploadedDate;
 | 
			
		||||
  String? get uploadedDate => _$this._uploadedDate;
 | 
			
		||||
  set uploadedDate(String? uploadedDate) => _$this._uploadedDate = uploadedDate;
 | 
			
		||||
 | 
			
		||||
  String? _uploaderAvatar;
 | 
			
		||||
  String? get uploaderAvatar => _$this._uploaderAvatar;
 | 
			
		||||
  set uploaderAvatar(String? uploaderAvatar) =>
 | 
			
		||||
      _$this._uploaderAvatar = uploaderAvatar;
 | 
			
		||||
 | 
			
		||||
  String? _uploaderName;
 | 
			
		||||
  String? get uploaderName => _$this._uploaderName;
 | 
			
		||||
  set uploaderName(String? uploaderName) => _$this._uploaderName = uploaderName;
 | 
			
		||||
 | 
			
		||||
  String? _uploaderUrl;
 | 
			
		||||
  String? get uploaderUrl => _$this._uploaderUrl;
 | 
			
		||||
  set uploaderUrl(String? uploaderUrl) => _$this._uploaderUrl = uploaderUrl;
 | 
			
		||||
 | 
			
		||||
  bool? _uploaderVerified;
 | 
			
		||||
  bool? get uploaderVerified => _$this._uploaderVerified;
 | 
			
		||||
  set uploaderVerified(bool? uploaderVerified) =>
 | 
			
		||||
      _$this._uploaderVerified = uploaderVerified;
 | 
			
		||||
 | 
			
		||||
  String? _url;
 | 
			
		||||
  String? get url => _$this._url;
 | 
			
		||||
  set url(String? url) => _$this._url = url;
 | 
			
		||||
 | 
			
		||||
  int? _views;
 | 
			
		||||
  int? get views => _$this._views;
 | 
			
		||||
  set views(int? views) => _$this._views = views;
 | 
			
		||||
 | 
			
		||||
  String? _description;
 | 
			
		||||
  String? get description => _$this._description;
 | 
			
		||||
  set description(String? description) => _$this._description = description;
 | 
			
		||||
 | 
			
		||||
  String? _name;
 | 
			
		||||
  String? get name => _$this._name;
 | 
			
		||||
  set name(String? name) => _$this._name = name;
 | 
			
		||||
 | 
			
		||||
  int? _subscribers;
 | 
			
		||||
  int? get subscribers => _$this._subscribers;
 | 
			
		||||
  set subscribers(int? subscribers) => _$this._subscribers = subscribers;
 | 
			
		||||
 | 
			
		||||
  bool? _verified;
 | 
			
		||||
  bool? get verified => _$this._verified;
 | 
			
		||||
  set verified(bool? verified) => _$this._verified = verified;
 | 
			
		||||
 | 
			
		||||
  int? _videos;
 | 
			
		||||
  int? get videos => _$this._videos;
 | 
			
		||||
  set videos(int? videos) => _$this._videos = videos;
 | 
			
		||||
 | 
			
		||||
  SearchItemBuilder() {
 | 
			
		||||
    SearchItem._defaults(this);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  SearchItemBuilder get _$this {
 | 
			
		||||
    final $v = _$v;
 | 
			
		||||
    if ($v != null) {
 | 
			
		||||
      _duration = $v.duration;
 | 
			
		||||
      _thumbnail = $v.thumbnail;
 | 
			
		||||
      _title = $v.title;
 | 
			
		||||
      _uploaded = $v.uploaded;
 | 
			
		||||
      _uploadedDate = $v.uploadedDate;
 | 
			
		||||
      _uploaderAvatar = $v.uploaderAvatar;
 | 
			
		||||
      _uploaderName = $v.uploaderName;
 | 
			
		||||
      _uploaderUrl = $v.uploaderUrl;
 | 
			
		||||
      _uploaderVerified = $v.uploaderVerified;
 | 
			
		||||
      _url = $v.url;
 | 
			
		||||
      _views = $v.views;
 | 
			
		||||
      _description = $v.description;
 | 
			
		||||
      _name = $v.name;
 | 
			
		||||
      _subscribers = $v.subscribers;
 | 
			
		||||
      _verified = $v.verified;
 | 
			
		||||
      _videos = $v.videos;
 | 
			
		||||
      _$v = null;
 | 
			
		||||
    }
 | 
			
		||||
    return this;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  void replace(SearchItem other) {
 | 
			
		||||
    ArgumentError.checkNotNull(other, 'other');
 | 
			
		||||
    _$v = other as _$SearchItem;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  void update(void Function(SearchItemBuilder)? updates) {
 | 
			
		||||
    if (updates != null) updates(this);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  _$SearchItem build() {
 | 
			
		||||
    final _$result = _$v ??
 | 
			
		||||
        new _$SearchItem._(
 | 
			
		||||
            duration: BuiltValueNullFieldError.checkNotNull(
 | 
			
		||||
                duration, 'SearchItem', 'duration'),
 | 
			
		||||
            thumbnail: BuiltValueNullFieldError.checkNotNull(
 | 
			
		||||
                thumbnail, 'SearchItem', 'thumbnail'),
 | 
			
		||||
            title: BuiltValueNullFieldError.checkNotNull(
 | 
			
		||||
                title, 'SearchItem', 'title'),
 | 
			
		||||
            uploaded: uploaded,
 | 
			
		||||
            uploadedDate: uploadedDate,
 | 
			
		||||
            uploaderAvatar: uploaderAvatar,
 | 
			
		||||
            uploaderName: uploaderName,
 | 
			
		||||
            uploaderUrl: uploaderUrl,
 | 
			
		||||
            uploaderVerified: uploaderVerified,
 | 
			
		||||
            url:
 | 
			
		||||
                BuiltValueNullFieldError.checkNotNull(url, 'SearchItem', 'url'),
 | 
			
		||||
            views: views,
 | 
			
		||||
            description: description,
 | 
			
		||||
            name: name,
 | 
			
		||||
            subscribers: subscribers,
 | 
			
		||||
            verified: verified,
 | 
			
		||||
            videos: videos);
 | 
			
		||||
    replace(_$result);
 | 
			
		||||
    return _$result;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new
 | 
			
		||||
							
								
								
									
										123
									
								
								lib/src/model/search_page.dart
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										123
									
								
								lib/src/model/search_page.dart
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,123 @@
 | 
			
		|||
//
 | 
			
		||||
// AUTO-GENERATED FILE, DO NOT MODIFY!
 | 
			
		||||
//
 | 
			
		||||
 | 
			
		||||
import 'package:built_collection/built_collection.dart';
 | 
			
		||||
import 'package:piped_api/src/model/search_item.dart';
 | 
			
		||||
import 'package:built_value/built_value.dart';
 | 
			
		||||
import 'package:built_value/serializer.dart';
 | 
			
		||||
 | 
			
		||||
part 'search_page.g.dart';
 | 
			
		||||
 | 
			
		||||
/// SearchPage
 | 
			
		||||
///
 | 
			
		||||
/// Properties:
 | 
			
		||||
/// * [corrected] - Whether the search query was corrected.
 | 
			
		||||
/// * [items] 
 | 
			
		||||
/// * [nextpage] - The parameter used to get the next page of this page.
 | 
			
		||||
/// * [suggestion] - The suggested search query.
 | 
			
		||||
abstract class SearchPage implements Built<SearchPage, SearchPageBuilder> {
 | 
			
		||||
    /// Whether the search query was corrected.
 | 
			
		||||
    @BuiltValueField(wireName: r'corrected')
 | 
			
		||||
    bool? get corrected;
 | 
			
		||||
 | 
			
		||||
    @BuiltValueField(wireName: r'items')
 | 
			
		||||
    BuiltList<SearchItem>? get items;
 | 
			
		||||
 | 
			
		||||
    /// The parameter used to get the next page of this page.
 | 
			
		||||
    @BuiltValueField(wireName: r'nextpage')
 | 
			
		||||
    String? get nextpage;
 | 
			
		||||
 | 
			
		||||
    /// The suggested search query.
 | 
			
		||||
    @BuiltValueField(wireName: r'suggestion')
 | 
			
		||||
    String? get suggestion;
 | 
			
		||||
 | 
			
		||||
    SearchPage._();
 | 
			
		||||
 | 
			
		||||
    @BuiltValueHook(initializeBuilder: true)
 | 
			
		||||
    static void _defaults(SearchPageBuilder b) => b;
 | 
			
		||||
 | 
			
		||||
    factory SearchPage([void updates(SearchPageBuilder b)]) = _$SearchPage;
 | 
			
		||||
 | 
			
		||||
    @BuiltValueSerializer(custom: true)
 | 
			
		||||
    static Serializer<SearchPage> get serializer => _$SearchPageSerializer();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
class _$SearchPageSerializer implements StructuredSerializer<SearchPage> {
 | 
			
		||||
    @override
 | 
			
		||||
    final Iterable<Type> types = const [SearchPage, _$SearchPage];
 | 
			
		||||
 | 
			
		||||
    @override
 | 
			
		||||
    final String wireName = r'SearchPage';
 | 
			
		||||
 | 
			
		||||
    @override
 | 
			
		||||
    Iterable<Object?> serialize(Serializers serializers, SearchPage object,
 | 
			
		||||
        {FullType specifiedType = FullType.unspecified}) {
 | 
			
		||||
        final result = <Object?>[];
 | 
			
		||||
        if (object.corrected != null) {
 | 
			
		||||
            result
 | 
			
		||||
                ..add(r'corrected')
 | 
			
		||||
                ..add(serializers.serialize(object.corrected,
 | 
			
		||||
                    specifiedType: const FullType(bool)));
 | 
			
		||||
        }
 | 
			
		||||
        if (object.items != null) {
 | 
			
		||||
            result
 | 
			
		||||
                ..add(r'items')
 | 
			
		||||
                ..add(serializers.serialize(object.items,
 | 
			
		||||
                    specifiedType: const FullType(BuiltList, [FullType(SearchItem)])));
 | 
			
		||||
        }
 | 
			
		||||
        if (object.nextpage != null) {
 | 
			
		||||
            result
 | 
			
		||||
                ..add(r'nextpage')
 | 
			
		||||
                ..add(serializers.serialize(object.nextpage,
 | 
			
		||||
                    specifiedType: const FullType.nullable(String)));
 | 
			
		||||
        }
 | 
			
		||||
        if (object.suggestion != null) {
 | 
			
		||||
            result
 | 
			
		||||
                ..add(r'suggestion')
 | 
			
		||||
                ..add(serializers.serialize(object.suggestion,
 | 
			
		||||
                    specifiedType: const FullType.nullable(String)));
 | 
			
		||||
        }
 | 
			
		||||
        return result;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @override
 | 
			
		||||
    SearchPage deserialize(Serializers serializers, Iterable<Object?> serialized,
 | 
			
		||||
        {FullType specifiedType = FullType.unspecified}) {
 | 
			
		||||
        final result = SearchPageBuilder();
 | 
			
		||||
 | 
			
		||||
        final iterator = serialized.iterator;
 | 
			
		||||
        while (iterator.moveNext()) {
 | 
			
		||||
            final key = iterator.current as String;
 | 
			
		||||
            iterator.moveNext();
 | 
			
		||||
            final Object? value = iterator.current;
 | 
			
		||||
            
 | 
			
		||||
            switch (key) {
 | 
			
		||||
                case r'corrected':
 | 
			
		||||
                    final valueDes = serializers.deserialize(value,
 | 
			
		||||
                        specifiedType: const FullType(bool)) as bool;
 | 
			
		||||
                    result.corrected = valueDes;
 | 
			
		||||
                    break;
 | 
			
		||||
                case r'items':
 | 
			
		||||
                    final valueDes = serializers.deserialize(value,
 | 
			
		||||
                        specifiedType: const FullType(BuiltList, [FullType(SearchItem)])) as BuiltList<SearchItem>;
 | 
			
		||||
                    result.items.replace(valueDes);
 | 
			
		||||
                    break;
 | 
			
		||||
                case r'nextpage':
 | 
			
		||||
                    final valueDes = serializers.deserialize(value,
 | 
			
		||||
                        specifiedType: const FullType.nullable(String)) as String?;
 | 
			
		||||
                    if (valueDes == null) continue;
 | 
			
		||||
                    result.nextpage = valueDes;
 | 
			
		||||
                    break;
 | 
			
		||||
                case r'suggestion':
 | 
			
		||||
                    final valueDes = serializers.deserialize(value,
 | 
			
		||||
                        specifiedType: const FullType.nullable(String)) as String?;
 | 
			
		||||
                    if (valueDes == null) continue;
 | 
			
		||||
                    result.suggestion = valueDes;
 | 
			
		||||
                    break;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return result.build();
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										133
									
								
								lib/src/model/search_page.g.dart
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										133
									
								
								lib/src/model/search_page.g.dart
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,133 @@
 | 
			
		|||
// GENERATED CODE - DO NOT MODIFY BY HAND
 | 
			
		||||
 | 
			
		||||
part of 'search_page.dart';
 | 
			
		||||
 | 
			
		||||
// **************************************************************************
 | 
			
		||||
// BuiltValueGenerator
 | 
			
		||||
// **************************************************************************
 | 
			
		||||
 | 
			
		||||
class _$SearchPage extends SearchPage {
 | 
			
		||||
  @override
 | 
			
		||||
  final bool? corrected;
 | 
			
		||||
  @override
 | 
			
		||||
  final BuiltList<SearchItem>? items;
 | 
			
		||||
  @override
 | 
			
		||||
  final String? nextpage;
 | 
			
		||||
  @override
 | 
			
		||||
  final String? suggestion;
 | 
			
		||||
 | 
			
		||||
  factory _$SearchPage([void Function(SearchPageBuilder)? updates]) =>
 | 
			
		||||
      (new SearchPageBuilder()..update(updates)).build();
 | 
			
		||||
 | 
			
		||||
  _$SearchPage._({this.corrected, this.items, this.nextpage, this.suggestion})
 | 
			
		||||
      : super._();
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  SearchPage rebuild(void Function(SearchPageBuilder) updates) =>
 | 
			
		||||
      (toBuilder()..update(updates)).build();
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  SearchPageBuilder toBuilder() => new SearchPageBuilder()..replace(this);
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  bool operator ==(Object other) {
 | 
			
		||||
    if (identical(other, this)) return true;
 | 
			
		||||
    return other is SearchPage &&
 | 
			
		||||
        corrected == other.corrected &&
 | 
			
		||||
        items == other.items &&
 | 
			
		||||
        nextpage == other.nextpage &&
 | 
			
		||||
        suggestion == other.suggestion;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  int get hashCode {
 | 
			
		||||
    return $jf($jc(
 | 
			
		||||
        $jc($jc($jc(0, corrected.hashCode), items.hashCode), nextpage.hashCode),
 | 
			
		||||
        suggestion.hashCode));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  String toString() {
 | 
			
		||||
    return (newBuiltValueToStringHelper('SearchPage')
 | 
			
		||||
          ..add('corrected', corrected)
 | 
			
		||||
          ..add('items', items)
 | 
			
		||||
          ..add('nextpage', nextpage)
 | 
			
		||||
          ..add('suggestion', suggestion))
 | 
			
		||||
        .toString();
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
class SearchPageBuilder implements Builder<SearchPage, SearchPageBuilder> {
 | 
			
		||||
  _$SearchPage? _$v;
 | 
			
		||||
 | 
			
		||||
  bool? _corrected;
 | 
			
		||||
  bool? get corrected => _$this._corrected;
 | 
			
		||||
  set corrected(bool? corrected) => _$this._corrected = corrected;
 | 
			
		||||
 | 
			
		||||
  ListBuilder<SearchItem>? _items;
 | 
			
		||||
  ListBuilder<SearchItem> get items =>
 | 
			
		||||
      _$this._items ??= new ListBuilder<SearchItem>();
 | 
			
		||||
  set items(ListBuilder<SearchItem>? items) => _$this._items = items;
 | 
			
		||||
 | 
			
		||||
  String? _nextpage;
 | 
			
		||||
  String? get nextpage => _$this._nextpage;
 | 
			
		||||
  set nextpage(String? nextpage) => _$this._nextpage = nextpage;
 | 
			
		||||
 | 
			
		||||
  String? _suggestion;
 | 
			
		||||
  String? get suggestion => _$this._suggestion;
 | 
			
		||||
  set suggestion(String? suggestion) => _$this._suggestion = suggestion;
 | 
			
		||||
 | 
			
		||||
  SearchPageBuilder() {
 | 
			
		||||
    SearchPage._defaults(this);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  SearchPageBuilder get _$this {
 | 
			
		||||
    final $v = _$v;
 | 
			
		||||
    if ($v != null) {
 | 
			
		||||
      _corrected = $v.corrected;
 | 
			
		||||
      _items = $v.items?.toBuilder();
 | 
			
		||||
      _nextpage = $v.nextpage;
 | 
			
		||||
      _suggestion = $v.suggestion;
 | 
			
		||||
      _$v = null;
 | 
			
		||||
    }
 | 
			
		||||
    return this;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  void replace(SearchPage other) {
 | 
			
		||||
    ArgumentError.checkNotNull(other, 'other');
 | 
			
		||||
    _$v = other as _$SearchPage;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  void update(void Function(SearchPageBuilder)? updates) {
 | 
			
		||||
    if (updates != null) updates(this);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  @override
 | 
			
		||||
  _$SearchPage build() {
 | 
			
		||||
    _$SearchPage _$result;
 | 
			
		||||
    try {
 | 
			
		||||
      _$result = _$v ??
 | 
			
		||||
          new _$SearchPage._(
 | 
			
		||||
              corrected: corrected,
 | 
			
		||||
              items: _items?.build(),
 | 
			
		||||
              nextpage: nextpage,
 | 
			
		||||
              suggestion: suggestion);
 | 
			
		||||
    } catch (_) {
 | 
			
		||||
      late String _$failedField;
 | 
			
		||||
      try {
 | 
			
		||||
        _$failedField = 'items';
 | 
			
		||||
        _items?.build();
 | 
			
		||||
      } catch (e) {
 | 
			
		||||
        throw new BuiltValueNestedFieldError(
 | 
			
		||||
            'SearchPage', _$failedField, e.toString());
 | 
			
		||||
      }
 | 
			
		||||
      rethrow;
 | 
			
		||||
    }
 | 
			
		||||
    replace(_$result);
 | 
			
		||||
    return _$result;
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// ignore_for_file: always_put_control_body_on_new_line,always_specify_types,annotate_overrides,avoid_annotating_with_dynamic,avoid_as,avoid_catches_without_on_clauses,avoid_returning_this,deprecated_member_use_from_same_package,lines_longer_than_80_chars,omit_local_variable_types,prefer_expression_function_bodies,sort_constructors_first,test_types_in_equals,unnecessary_const,unnecessary_new
 | 
			
		||||
| 
						 | 
				
			
			@ -13,10 +13,15 @@ import 'package:piped_api/src/date_serializer.dart';
 | 
			
		|||
import 'package:piped_api/src/model/date.dart';
 | 
			
		||||
 | 
			
		||||
import 'package:piped_api/src/model/channel_info.dart';
 | 
			
		||||
import 'package:piped_api/src/model/channel_item.dart';
 | 
			
		||||
import 'package:piped_api/src/model/comment.dart';
 | 
			
		||||
import 'package:piped_api/src/model/comments_page.dart';
 | 
			
		||||
import 'package:piped_api/src/model/exception_error.dart';
 | 
			
		||||
import 'package:piped_api/src/model/playlist_item.dart';
 | 
			
		||||
import 'package:piped_api/src/model/regions.dart';
 | 
			
		||||
import 'package:piped_api/src/model/search_filter.dart';
 | 
			
		||||
import 'package:piped_api/src/model/search_item.dart';
 | 
			
		||||
import 'package:piped_api/src/model/search_page.dart';
 | 
			
		||||
import 'package:piped_api/src/model/stream.dart';
 | 
			
		||||
import 'package:piped_api/src/model/stream_item.dart';
 | 
			
		||||
import 'package:piped_api/src/model/streams_page.dart';
 | 
			
		||||
| 
						 | 
				
			
			@ -27,10 +32,15 @@ part 'serializers.g.dart';
 | 
			
		|||
 | 
			
		||||
@SerializersFor([
 | 
			
		||||
  ChannelInfo,
 | 
			
		||||
  ChannelItem,
 | 
			
		||||
  Comment,
 | 
			
		||||
  CommentsPage,
 | 
			
		||||
  ExceptionError,
 | 
			
		||||
  PlaylistItem,
 | 
			
		||||
  Regions,
 | 
			
		||||
  SearchFilter,
 | 
			
		||||
  SearchItem,
 | 
			
		||||
  SearchPage,
 | 
			
		||||
  Stream,
 | 
			
		||||
  StreamItem,
 | 
			
		||||
  StreamsPage,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -8,10 +8,15 @@ part of 'serializers.dart';
 | 
			
		|||
 | 
			
		||||
Serializers _$serializers = (new Serializers().toBuilder()
 | 
			
		||||
      ..add(ChannelInfo.serializer)
 | 
			
		||||
      ..add(ChannelItem.serializer)
 | 
			
		||||
      ..add(Comment.serializer)
 | 
			
		||||
      ..add(CommentsPage.serializer)
 | 
			
		||||
      ..add(ExceptionError.serializer)
 | 
			
		||||
      ..add(PlaylistItem.serializer)
 | 
			
		||||
      ..add(Regions.serializer)
 | 
			
		||||
      ..add(SearchFilter.serializer)
 | 
			
		||||
      ..add(SearchItem.serializer)
 | 
			
		||||
      ..add(SearchPage.serializer)
 | 
			
		||||
      ..add(Stream.serializer)
 | 
			
		||||
      ..add(StreamFormatEnum.serializer)
 | 
			
		||||
      ..add(StreamItem.serializer)
 | 
			
		||||
| 
						 | 
				
			
			@ -21,6 +26,9 @@ Serializers _$serializers = (new Serializers().toBuilder()
 | 
			
		|||
      ..addBuilderFactory(
 | 
			
		||||
          const FullType(BuiltList, const [const FullType(Comment)]),
 | 
			
		||||
          () => new ListBuilder<Comment>())
 | 
			
		||||
      ..addBuilderFactory(
 | 
			
		||||
          const FullType(BuiltList, const [const FullType(SearchItem)]),
 | 
			
		||||
          () => new ListBuilder<SearchItem>())
 | 
			
		||||
      ..addBuilderFactory(
 | 
			
		||||
          const FullType(BuiltList, const [const FullType(Stream)]),
 | 
			
		||||
          () => new ListBuilder<Stream>())
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue