From 7474a8b677a26159eeddd7faafba51b60d900623 Mon Sep 17 00:00:00 2001 From: jahongireshonqulov Date: Fri, 24 Oct 2025 20:43:08 +0500 Subject: [PATCH] feat:Order item created --- .../blocs/basket_bloc.freezed.dart | 472 ++++++++++++++++++ 1 file changed, 472 insertions(+) create mode 100644 lib/feature/basket/presentation/blocs/basket_bloc.freezed.dart diff --git a/lib/feature/basket/presentation/blocs/basket_bloc.freezed.dart b/lib/feature/basket/presentation/blocs/basket_bloc.freezed.dart new file mode 100644 index 0000000..5191c57 --- /dev/null +++ b/lib/feature/basket/presentation/blocs/basket_bloc.freezed.dart @@ -0,0 +1,472 @@ +// 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 'basket_bloc.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; +/// @nodoc +mixin _$BasketEvent { + + + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is BasketEvent); +} + + +@override +int get hashCode => runtimeType.hashCode; + +@override +String toString() { + return 'BasketEvent()'; +} + + +} + +/// @nodoc +class $BasketEventCopyWith<$Res> { +$BasketEventCopyWith(BasketEvent _, $Res Function(BasketEvent) __); +} + + +/// Adds pattern-matching-related methods to [BasketEvent]. +extension BasketEventPatterns on BasketEvent { +/// 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,required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Started() when started != null: +return started(_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,}){ +final _that = this; +switch (_that) { +case _Started(): +return started(_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,}){ +final _that = this; +switch (_that) { +case _Started() when started != null: +return started(_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,required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Started() when started != null: +return started();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,}) {final _that = this; +switch (_that) { +case _Started(): +return started();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,}) {final _that = this; +switch (_that) { +case _Started() when started != null: +return started();case _: + return null; + +} +} + +} + +/// @nodoc + + +class _Started implements BasketEvent { + 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 'BasketEvent.started()'; +} + + +} + + + + +/// @nodoc +mixin _$BasketState { + + RequestStatus get status; List get orders; +/// Create a copy of BasketState +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$BasketStateCopyWith get copyWith => _$BasketStateCopyWithImpl(this as BasketState, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is BasketState&&(identical(other.status, status) || other.status == status)&&const DeepCollectionEquality().equals(other.orders, orders)); +} + + +@override +int get hashCode => Object.hash(runtimeType,status,const DeepCollectionEquality().hash(orders)); + +@override +String toString() { + return 'BasketState(status: $status, orders: $orders)'; +} + + +} + +/// @nodoc +abstract mixin class $BasketStateCopyWith<$Res> { + factory $BasketStateCopyWith(BasketState value, $Res Function(BasketState) _then) = _$BasketStateCopyWithImpl; +@useResult +$Res call({ + RequestStatus status, List orders +}); + + + + +} +/// @nodoc +class _$BasketStateCopyWithImpl<$Res> + implements $BasketStateCopyWith<$Res> { + _$BasketStateCopyWithImpl(this._self, this._then); + + final BasketState _self; + final $Res Function(BasketState) _then; + +/// Create a copy of BasketState +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? status = null,Object? orders = null,}) { + return _then(_self.copyWith( +status: null == status ? _self.status : status // ignore: cast_nullable_to_non_nullable +as RequestStatus,orders: null == orders ? _self.orders : orders // ignore: cast_nullable_to_non_nullable +as List, + )); +} + +} + + +/// Adds pattern-matching-related methods to [BasketState]. +extension BasketStatePatterns on BasketState { +/// 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( _BasketState value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _BasketState() 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( _BasketState value) $default,){ +final _that = this; +switch (_that) { +case _BasketState(): +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( _BasketState value)? $default,){ +final _that = this; +switch (_that) { +case _BasketState() 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 status, List orders)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _BasketState() when $default != null: +return $default(_that.status,_that.orders);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 status, List orders) $default,) {final _that = this; +switch (_that) { +case _BasketState(): +return $default(_that.status,_that.orders);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 status, List orders)? $default,) {final _that = this; +switch (_that) { +case _BasketState() when $default != null: +return $default(_that.status,_that.orders);case _: + return null; + +} +} + +} + +/// @nodoc + + +class _BasketState implements BasketState { + const _BasketState({this.status = RequestStatus.initial, final List orders = const []}): _orders = orders; + + +@override@JsonKey() final RequestStatus status; + final List _orders; +@override@JsonKey() List get orders { + if (_orders is EqualUnmodifiableListView) return _orders; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_orders); +} + + +/// Create a copy of BasketState +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$BasketStateCopyWith<_BasketState> get copyWith => __$BasketStateCopyWithImpl<_BasketState>(this, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _BasketState&&(identical(other.status, status) || other.status == status)&&const DeepCollectionEquality().equals(other._orders, _orders)); +} + + +@override +int get hashCode => Object.hash(runtimeType,status,const DeepCollectionEquality().hash(_orders)); + +@override +String toString() { + return 'BasketState(status: $status, orders: $orders)'; +} + + +} + +/// @nodoc +abstract mixin class _$BasketStateCopyWith<$Res> implements $BasketStateCopyWith<$Res> { + factory _$BasketStateCopyWith(_BasketState value, $Res Function(_BasketState) _then) = __$BasketStateCopyWithImpl; +@override @useResult +$Res call({ + RequestStatus status, List orders +}); + + + + +} +/// @nodoc +class __$BasketStateCopyWithImpl<$Res> + implements _$BasketStateCopyWith<$Res> { + __$BasketStateCopyWithImpl(this._self, this._then); + + final _BasketState _self; + final $Res Function(_BasketState) _then; + +/// Create a copy of BasketState +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? status = null,Object? orders = null,}) { + return _then(_BasketState( +status: null == status ? _self.status : status // ignore: cast_nullable_to_non_nullable +as RequestStatus,orders: null == orders ? _self._orders : orders // ignore: cast_nullable_to_non_nullable +as List, + )); +} + + +} + +// dart format on