From 2750564b085cd3b3a25f781ddcd9ca06158f5294 Mon Sep 17 00:00:00 2001 From: jahongireshonqulov Date: Sat, 25 Oct 2025 17:54:59 +0500 Subject: [PATCH] feat:browse bloc done --- .../browse_bloc/browse_bloc.freezed.dart | 667 ++++++++++++++++++ 1 file changed, 667 insertions(+) create mode 100644 lib/feature/browse/presentation/blocs/browse_bloc/browse_bloc.freezed.dart diff --git a/lib/feature/browse/presentation/blocs/browse_bloc/browse_bloc.freezed.dart b/lib/feature/browse/presentation/blocs/browse_bloc/browse_bloc.freezed.dart new file mode 100644 index 0000000..c28ca7e --- /dev/null +++ b/lib/feature/browse/presentation/blocs/browse_bloc/browse_bloc.freezed.dart @@ -0,0 +1,667 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND +// coverage:ignore-file +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'browse_bloc.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; +/// @nodoc +mixin _$BrowseEvent { + + + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is BrowseEvent); +} + + +@override +int get hashCode => runtimeType.hashCode; + +@override +String toString() { + return 'BrowseEvent()'; +} + + +} + +/// @nodoc +class $BrowseEventCopyWith<$Res> { +$BrowseEventCopyWith(BrowseEvent _, $Res Function(BrowseEvent) __); +} + + +/// Adds pattern-matching-related methods to [BrowseEvent]. +extension BrowseEventPatterns on BrowseEvent { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap({TResult Function( _Started value)? started,TResult Function( _GetTopCategories value)? getTopCategories,TResult Function( _GetAllCategories value)? getAllCategories,TResult Function( _GetSearchHistory value)? getSearchHistory,TResult Function( _FocusChanged value)? focusChanged,required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Started() when started != null: +return started(_that);case _GetTopCategories() when getTopCategories != null: +return getTopCategories(_that);case _GetAllCategories() when getAllCategories != null: +return getAllCategories(_that);case _GetSearchHistory() when getSearchHistory != null: +return getSearchHistory(_that);case _FocusChanged() when focusChanged != null: +return focusChanged(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map({required TResult Function( _Started value) started,required TResult Function( _GetTopCategories value) getTopCategories,required TResult Function( _GetAllCategories value) getAllCategories,required TResult Function( _GetSearchHistory value) getSearchHistory,required TResult Function( _FocusChanged value) focusChanged,}){ +final _that = this; +switch (_that) { +case _Started(): +return started(_that);case _GetTopCategories(): +return getTopCategories(_that);case _GetAllCategories(): +return getAllCategories(_that);case _GetSearchHistory(): +return getSearchHistory(_that);case _FocusChanged(): +return focusChanged(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull({TResult? Function( _Started value)? started,TResult? Function( _GetTopCategories value)? getTopCategories,TResult? Function( _GetAllCategories value)? getAllCategories,TResult? Function( _GetSearchHistory value)? getSearchHistory,TResult? Function( _FocusChanged value)? focusChanged,}){ +final _that = this; +switch (_that) { +case _Started() when started != null: +return started(_that);case _GetTopCategories() when getTopCategories != null: +return getTopCategories(_that);case _GetAllCategories() when getAllCategories != null: +return getAllCategories(_that);case _GetSearchHistory() when getSearchHistory != null: +return getSearchHistory(_that);case _FocusChanged() when focusChanged != null: +return focusChanged(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen({TResult Function()? started,TResult Function()? getTopCategories,TResult Function()? getAllCategories,TResult Function()? getSearchHistory,TResult Function( bool? isActive)? focusChanged,required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Started() when started != null: +return started();case _GetTopCategories() when getTopCategories != null: +return getTopCategories();case _GetAllCategories() when getAllCategories != null: +return getAllCategories();case _GetSearchHistory() when getSearchHistory != null: +return getSearchHistory();case _FocusChanged() when focusChanged != null: +return focusChanged(_that.isActive);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when({required TResult Function() started,required TResult Function() getTopCategories,required TResult Function() getAllCategories,required TResult Function() getSearchHistory,required TResult Function( bool? isActive) focusChanged,}) {final _that = this; +switch (_that) { +case _Started(): +return started();case _GetTopCategories(): +return getTopCategories();case _GetAllCategories(): +return getAllCategories();case _GetSearchHistory(): +return getSearchHistory();case _FocusChanged(): +return focusChanged(_that.isActive);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull({TResult? Function()? started,TResult? Function()? getTopCategories,TResult? Function()? getAllCategories,TResult? Function()? getSearchHistory,TResult? Function( bool? isActive)? focusChanged,}) {final _that = this; +switch (_that) { +case _Started() when started != null: +return started();case _GetTopCategories() when getTopCategories != null: +return getTopCategories();case _GetAllCategories() when getAllCategories != null: +return getAllCategories();case _GetSearchHistory() when getSearchHistory != null: +return getSearchHistory();case _FocusChanged() when focusChanged != null: +return focusChanged(_that.isActive);case _: + return null; + +} +} + +} + +/// @nodoc + + +class _Started implements BrowseEvent { + const _Started(); + + + + + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Started); +} + + +@override +int get hashCode => runtimeType.hashCode; + +@override +String toString() { + return 'BrowseEvent.started()'; +} + + +} + + + + +/// @nodoc + + +class _GetTopCategories implements BrowseEvent { + const _GetTopCategories(); + + + + + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _GetTopCategories); +} + + +@override +int get hashCode => runtimeType.hashCode; + +@override +String toString() { + return 'BrowseEvent.getTopCategories()'; +} + + +} + + + + +/// @nodoc + + +class _GetAllCategories implements BrowseEvent { + const _GetAllCategories(); + + + + + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _GetAllCategories); +} + + +@override +int get hashCode => runtimeType.hashCode; + +@override +String toString() { + return 'BrowseEvent.getAllCategories()'; +} + + +} + + + + +/// @nodoc + + +class _GetSearchHistory implements BrowseEvent { + const _GetSearchHistory(); + + + + + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _GetSearchHistory); +} + + +@override +int get hashCode => runtimeType.hashCode; + +@override +String toString() { + return 'BrowseEvent.getSearchHistory()'; +} + + +} + + + + +/// @nodoc + + +class _FocusChanged implements BrowseEvent { + const _FocusChanged(this.isActive); + + + final bool? isActive; + +/// Create a copy of BrowseEvent +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$FocusChangedCopyWith<_FocusChanged> get copyWith => __$FocusChangedCopyWithImpl<_FocusChanged>(this, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _FocusChanged&&(identical(other.isActive, isActive) || other.isActive == isActive)); +} + + +@override +int get hashCode => Object.hash(runtimeType,isActive); + +@override +String toString() { + return 'BrowseEvent.focusChanged(isActive: $isActive)'; +} + + +} + +/// @nodoc +abstract mixin class _$FocusChangedCopyWith<$Res> implements $BrowseEventCopyWith<$Res> { + factory _$FocusChangedCopyWith(_FocusChanged value, $Res Function(_FocusChanged) _then) = __$FocusChangedCopyWithImpl; +@useResult +$Res call({ + bool? isActive +}); + + + + +} +/// @nodoc +class __$FocusChangedCopyWithImpl<$Res> + implements _$FocusChangedCopyWith<$Res> { + __$FocusChangedCopyWithImpl(this._self, this._then); + + final _FocusChanged _self; + final $Res Function(_FocusChanged) _then; + +/// Create a copy of BrowseEvent +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') $Res call({Object? isActive = freezed,}) { + return _then(_FocusChanged( +freezed == isActive ? _self.isActive : isActive // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + + +} + +/// @nodoc +mixin _$BrowseState { + + RequestStatus get topCategorySt; RequestStatus get allCategorySt; RequestStatus get searchHistorySt; List get searchHistory; bool get isActive; +/// Create a copy of BrowseState +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$BrowseStateCopyWith get copyWith => _$BrowseStateCopyWithImpl(this as BrowseState, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is BrowseState&&(identical(other.topCategorySt, topCategorySt) || other.topCategorySt == topCategorySt)&&(identical(other.allCategorySt, allCategorySt) || other.allCategorySt == allCategorySt)&&(identical(other.searchHistorySt, searchHistorySt) || other.searchHistorySt == searchHistorySt)&&const DeepCollectionEquality().equals(other.searchHistory, searchHistory)&&(identical(other.isActive, isActive) || other.isActive == isActive)); +} + + +@override +int get hashCode => Object.hash(runtimeType,topCategorySt,allCategorySt,searchHistorySt,const DeepCollectionEquality().hash(searchHistory),isActive); + +@override +String toString() { + return 'BrowseState(topCategorySt: $topCategorySt, allCategorySt: $allCategorySt, searchHistorySt: $searchHistorySt, searchHistory: $searchHistory, isActive: $isActive)'; +} + + +} + +/// @nodoc +abstract mixin class $BrowseStateCopyWith<$Res> { + factory $BrowseStateCopyWith(BrowseState value, $Res Function(BrowseState) _then) = _$BrowseStateCopyWithImpl; +@useResult +$Res call({ + RequestStatus topCategorySt, RequestStatus allCategorySt, RequestStatus searchHistorySt, List searchHistory, bool isActive +}); + + + + +} +/// @nodoc +class _$BrowseStateCopyWithImpl<$Res> + implements $BrowseStateCopyWith<$Res> { + _$BrowseStateCopyWithImpl(this._self, this._then); + + final BrowseState _self; + final $Res Function(BrowseState) _then; + +/// Create a copy of BrowseState +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? topCategorySt = null,Object? allCategorySt = null,Object? searchHistorySt = null,Object? searchHistory = null,Object? isActive = null,}) { + return _then(_self.copyWith( +topCategorySt: null == topCategorySt ? _self.topCategorySt : topCategorySt // ignore: cast_nullable_to_non_nullable +as RequestStatus,allCategorySt: null == allCategorySt ? _self.allCategorySt : allCategorySt // ignore: cast_nullable_to_non_nullable +as RequestStatus,searchHistorySt: null == searchHistorySt ? _self.searchHistorySt : searchHistorySt // ignore: cast_nullable_to_non_nullable +as RequestStatus,searchHistory: null == searchHistory ? _self.searchHistory : searchHistory // ignore: cast_nullable_to_non_nullable +as List,isActive: null == isActive ? _self.isActive : isActive // ignore: cast_nullable_to_non_nullable +as bool, + )); +} + +} + + +/// Adds pattern-matching-related methods to [BrowseState]. +extension BrowseStatePatterns on BrowseState { +/// A variant of `map` that fallback to returning `orElse`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeMap(TResult Function( _BrowseState value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _BrowseState() when $default != null: +return $default(_that);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// Callbacks receives the raw object, upcasted. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case final Subclass2 value: +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult map(TResult Function( _BrowseState value) $default,){ +final _that = this; +switch (_that) { +case _BrowseState(): +return $default(_that);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `map` that fallback to returning `null`. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case final Subclass value: +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? mapOrNull(TResult? Function( _BrowseState value)? $default,){ +final _that = this; +switch (_that) { +case _BrowseState() when $default != null: +return $default(_that);case _: + return null; + +} +} +/// A variant of `when` that fallback to an `orElse` callback. +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return orElse(); +/// } +/// ``` + +@optionalTypeArgs TResult maybeWhen(TResult Function( RequestStatus topCategorySt, RequestStatus allCategorySt, RequestStatus searchHistorySt, List searchHistory, bool isActive)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _BrowseState() when $default != null: +return $default(_that.topCategorySt,_that.allCategorySt,_that.searchHistorySt,_that.searchHistory,_that.isActive);case _: + return orElse(); + +} +} +/// A `switch`-like method, using callbacks. +/// +/// As opposed to `map`, this offers destructuring. +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case Subclass2(:final field2): +/// return ...; +/// } +/// ``` + +@optionalTypeArgs TResult when(TResult Function( RequestStatus topCategorySt, RequestStatus allCategorySt, RequestStatus searchHistorySt, List searchHistory, bool isActive) $default,) {final _that = this; +switch (_that) { +case _BrowseState(): +return $default(_that.topCategorySt,_that.allCategorySt,_that.searchHistorySt,_that.searchHistory,_that.isActive);case _: + throw StateError('Unexpected subclass'); + +} +} +/// A variant of `when` that fallback to returning `null` +/// +/// It is equivalent to doing: +/// ```dart +/// switch (sealedClass) { +/// case Subclass(:final field): +/// return ...; +/// case _: +/// return null; +/// } +/// ``` + +@optionalTypeArgs TResult? whenOrNull(TResult? Function( RequestStatus topCategorySt, RequestStatus allCategorySt, RequestStatus searchHistorySt, List searchHistory, bool isActive)? $default,) {final _that = this; +switch (_that) { +case _BrowseState() when $default != null: +return $default(_that.topCategorySt,_that.allCategorySt,_that.searchHistorySt,_that.searchHistory,_that.isActive);case _: + return null; + +} +} + +} + +/// @nodoc + + +class _BrowseState implements BrowseState { + const _BrowseState({this.topCategorySt = RequestStatus.initial, this.allCategorySt = RequestStatus.initial, this.searchHistorySt = RequestStatus.initial, final List searchHistory = const [], this.isActive = false}): _searchHistory = searchHistory; + + +@override@JsonKey() final RequestStatus topCategorySt; +@override@JsonKey() final RequestStatus allCategorySt; +@override@JsonKey() final RequestStatus searchHistorySt; + final List _searchHistory; +@override@JsonKey() List get searchHistory { + if (_searchHistory is EqualUnmodifiableListView) return _searchHistory; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_searchHistory); +} + +@override@JsonKey() final bool isActive; + +/// Create a copy of BrowseState +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$BrowseStateCopyWith<_BrowseState> get copyWith => __$BrowseStateCopyWithImpl<_BrowseState>(this, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _BrowseState&&(identical(other.topCategorySt, topCategorySt) || other.topCategorySt == topCategorySt)&&(identical(other.allCategorySt, allCategorySt) || other.allCategorySt == allCategorySt)&&(identical(other.searchHistorySt, searchHistorySt) || other.searchHistorySt == searchHistorySt)&&const DeepCollectionEquality().equals(other._searchHistory, _searchHistory)&&(identical(other.isActive, isActive) || other.isActive == isActive)); +} + + +@override +int get hashCode => Object.hash(runtimeType,topCategorySt,allCategorySt,searchHistorySt,const DeepCollectionEquality().hash(_searchHistory),isActive); + +@override +String toString() { + return 'BrowseState(topCategorySt: $topCategorySt, allCategorySt: $allCategorySt, searchHistorySt: $searchHistorySt, searchHistory: $searchHistory, isActive: $isActive)'; +} + + +} + +/// @nodoc +abstract mixin class _$BrowseStateCopyWith<$Res> implements $BrowseStateCopyWith<$Res> { + factory _$BrowseStateCopyWith(_BrowseState value, $Res Function(_BrowseState) _then) = __$BrowseStateCopyWithImpl; +@override @useResult +$Res call({ + RequestStatus topCategorySt, RequestStatus allCategorySt, RequestStatus searchHistorySt, List searchHistory, bool isActive +}); + + + + +} +/// @nodoc +class __$BrowseStateCopyWithImpl<$Res> + implements _$BrowseStateCopyWith<$Res> { + __$BrowseStateCopyWithImpl(this._self, this._then); + + final _BrowseState _self; + final $Res Function(_BrowseState) _then; + +/// Create a copy of BrowseState +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? topCategorySt = null,Object? allCategorySt = null,Object? searchHistorySt = null,Object? searchHistory = null,Object? isActive = null,}) { + return _then(_BrowseState( +topCategorySt: null == topCategorySt ? _self.topCategorySt : topCategorySt // ignore: cast_nullable_to_non_nullable +as RequestStatus,allCategorySt: null == allCategorySt ? _self.allCategorySt : allCategorySt // ignore: cast_nullable_to_non_nullable +as RequestStatus,searchHistorySt: null == searchHistorySt ? _self.searchHistorySt : searchHistorySt // ignore: cast_nullable_to_non_nullable +as RequestStatus,searchHistory: null == searchHistory ? _self._searchHistory : searchHistory // ignore: cast_nullable_to_non_nullable +as List,isActive: null == isActive ? _self.isActive : isActive // ignore: cast_nullable_to_non_nullable +as bool, + )); +} + + +} + +// dart format on