From 0b562d1dcc143e8714406dd6e643c6938c6b2d09 Mon Sep 17 00:00:00 2001 From: jahongireshonqulov Date: Sat, 1 Nov 2025 15:37:09 +0500 Subject: [PATCH] feat:theme changing done --- .../blocs/theme_bloc/theme_bloc.freezed.dart | 501 ++++++++++++++++++ 1 file changed, 501 insertions(+) create mode 100644 lib/feature/common/presentation/blocs/theme_bloc/theme_bloc.freezed.dart diff --git a/lib/feature/common/presentation/blocs/theme_bloc/theme_bloc.freezed.dart b/lib/feature/common/presentation/blocs/theme_bloc/theme_bloc.freezed.dart new file mode 100644 index 0000000..a934890 --- /dev/null +++ b/lib/feature/common/presentation/blocs/theme_bloc/theme_bloc.freezed.dart @@ -0,0 +1,501 @@ +// 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 'theme_bloc.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; +/// @nodoc +mixin _$ThemeEvent { + + + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ThemeEvent); +} + + +@override +int get hashCode => runtimeType.hashCode; + +@override +String toString() { + return 'ThemeEvent()'; +} + + +} + +/// @nodoc +class $ThemeEventCopyWith<$Res> { +$ThemeEventCopyWith(ThemeEvent _, $Res Function(ThemeEvent) __); +} + + +/// Adds pattern-matching-related methods to [ThemeEvent]. +extension ThemeEventPatterns on ThemeEvent { +/// 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( _Changed value)? changed,required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _Started() when started != null: +return started(_that);case _Changed() when changed != null: +return changed(_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( _Changed value) changed,}){ +final _that = this; +switch (_that) { +case _Started(): +return started(_that);case _Changed(): +return changed(_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( _Changed value)? changed,}){ +final _that = this; +switch (_that) { +case _Started() when started != null: +return started(_that);case _Changed() when changed != null: +return changed(_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()? changed,required TResult orElse(),}) {final _that = this; +switch (_that) { +case _Started() when started != null: +return started();case _Changed() when changed != null: +return changed();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() changed,}) {final _that = this; +switch (_that) { +case _Started(): +return started();case _Changed(): +return changed();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()? changed,}) {final _that = this; +switch (_that) { +case _Started() when started != null: +return started();case _Changed() when changed != null: +return changed();case _: + return null; + +} +} + +} + +/// @nodoc + + +class _Started implements ThemeEvent { + 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 'ThemeEvent.started()'; +} + + +} + + + + +/// @nodoc + + +class _Changed implements ThemeEvent { + const _Changed(); + + + + + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _Changed); +} + + +@override +int get hashCode => runtimeType.hashCode; + +@override +String toString() { + return 'ThemeEvent.changed()'; +} + + +} + + + + +/// @nodoc +mixin _$ThemeState { + + ThemeMode get themeMode; +/// Create a copy of ThemeState +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ThemeStateCopyWith get copyWith => _$ThemeStateCopyWithImpl(this as ThemeState, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ThemeState&&(identical(other.themeMode, themeMode) || other.themeMode == themeMode)); +} + + +@override +int get hashCode => Object.hash(runtimeType,themeMode); + +@override +String toString() { + return 'ThemeState(themeMode: $themeMode)'; +} + + +} + +/// @nodoc +abstract mixin class $ThemeStateCopyWith<$Res> { + factory $ThemeStateCopyWith(ThemeState value, $Res Function(ThemeState) _then) = _$ThemeStateCopyWithImpl; +@useResult +$Res call({ + ThemeMode themeMode +}); + + + + +} +/// @nodoc +class _$ThemeStateCopyWithImpl<$Res> + implements $ThemeStateCopyWith<$Res> { + _$ThemeStateCopyWithImpl(this._self, this._then); + + final ThemeState _self; + final $Res Function(ThemeState) _then; + +/// Create a copy of ThemeState +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? themeMode = null,}) { + return _then(_self.copyWith( +themeMode: null == themeMode ? _self.themeMode : themeMode // ignore: cast_nullable_to_non_nullable +as ThemeMode, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ThemeState]. +extension ThemeStatePatterns on ThemeState { +/// 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( _ThemeState value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ThemeState() 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( _ThemeState value) $default,){ +final _that = this; +switch (_that) { +case _ThemeState(): +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( _ThemeState value)? $default,){ +final _that = this; +switch (_that) { +case _ThemeState() 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( ThemeMode themeMode)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ThemeState() when $default != null: +return $default(_that.themeMode);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( ThemeMode themeMode) $default,) {final _that = this; +switch (_that) { +case _ThemeState(): +return $default(_that.themeMode);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( ThemeMode themeMode)? $default,) {final _that = this; +switch (_that) { +case _ThemeState() when $default != null: +return $default(_that.themeMode);case _: + return null; + +} +} + +} + +/// @nodoc + + +class _ThemeState implements ThemeState { + const _ThemeState({this.themeMode = ThemeMode.light}); + + +@override@JsonKey() final ThemeMode themeMode; + +/// Create a copy of ThemeState +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ThemeStateCopyWith<_ThemeState> get copyWith => __$ThemeStateCopyWithImpl<_ThemeState>(this, _$identity); + + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ThemeState&&(identical(other.themeMode, themeMode) || other.themeMode == themeMode)); +} + + +@override +int get hashCode => Object.hash(runtimeType,themeMode); + +@override +String toString() { + return 'ThemeState(themeMode: $themeMode)'; +} + + +} + +/// @nodoc +abstract mixin class _$ThemeStateCopyWith<$Res> implements $ThemeStateCopyWith<$Res> { + factory _$ThemeStateCopyWith(_ThemeState value, $Res Function(_ThemeState) _then) = __$ThemeStateCopyWithImpl; +@override @useResult +$Res call({ + ThemeMode themeMode +}); + + + + +} +/// @nodoc +class __$ThemeStateCopyWithImpl<$Res> + implements _$ThemeStateCopyWith<$Res> { + __$ThemeStateCopyWithImpl(this._self, this._then); + + final _ThemeState _self; + final $Res Function(_ThemeState) _then; + +/// Create a copy of ThemeState +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? themeMode = null,}) { + return _then(_ThemeState( +themeMode: null == themeMode ? _self.themeMode : themeMode // ignore: cast_nullable_to_non_nullable +as ThemeMode, + )); +} + + +} + +// dart format on