diff --git a/lib/src/feature/app/logic/app_runner.dart b/lib/src/feature/app/logic/app_runner.dart index 3b882c42..f3229cf8 100644 --- a/lib/src/feature/app/logic/app_runner.dart +++ b/lib/src/feature/app/logic/app_runner.dart @@ -26,7 +26,7 @@ final class AppRunner with InitializationSteps, InitializationProcessor, Initial PlatformDispatcher.instance.onError = logger.logPlatformDispatcherError; // Setup bloc observer and transformer - Bloc.observer = AppBlocObserver(); + Bloc.observer = const AppBlocObserver(); Bloc.transformer = bloc_concurrency.sequential(); final result = await processInitialization( diff --git a/lib/src/feature/app/logic/dictionary_bloc.freezed.dart b/lib/src/feature/app/logic/dictionary_bloc.freezed.dart index 70807d52..77ab18b8 100644 --- a/lib/src/feature/app/logic/dictionary_bloc.freezed.dart +++ b/lib/src/feature/app/logic/dictionary_bloc.freezed.dart @@ -23,6 +23,7 @@ mixin _$DictionaryEvent { required TResult Function(_DictionaryEventUpdate value) update, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? mapOrNull({ TResult? Function(_DictionaryEventUpdate value)? update, @@ -36,26 +37,25 @@ mixin _$DictionaryEvent { throw _privateConstructorUsedError; @JsonKey(ignore: true) - $DictionaryEventCopyWith get copyWith => - throw _privateConstructorUsedError; + $DictionaryEventCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $DictionaryEventCopyWith<$Res> { - factory $DictionaryEventCopyWith( - DictionaryEvent value, $Res Function(DictionaryEvent) then) = + factory $DictionaryEventCopyWith(DictionaryEvent value, $Res Function(DictionaryEvent) then) = _$DictionaryEventCopyWithImpl<$Res, DictionaryEvent>; + @useResult $Res call({Locale dictionary}); } /// @nodoc -class _$DictionaryEventCopyWithImpl<$Res, $Val extends DictionaryEvent> - implements $DictionaryEventCopyWith<$Res> { +class _$DictionaryEventCopyWithImpl<$Res, $Val extends DictionaryEvent> implements $DictionaryEventCopyWith<$Res> { _$DictionaryEventCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -74,12 +74,11 @@ class _$DictionaryEventCopyWithImpl<$Res, $Val extends DictionaryEvent> } /// @nodoc -abstract class _$$DictionaryEventUpdateImplCopyWith<$Res> - implements $DictionaryEventCopyWith<$Res> { +abstract class _$$DictionaryEventUpdateImplCopyWith<$Res> implements $DictionaryEventCopyWith<$Res> { factory _$$DictionaryEventUpdateImplCopyWith( - _$DictionaryEventUpdateImpl value, - $Res Function(_$DictionaryEventUpdateImpl) then) = + _$DictionaryEventUpdateImpl value, $Res Function(_$DictionaryEventUpdateImpl) then) = __$$DictionaryEventUpdateImplCopyWithImpl<$Res>; + @override @useResult $Res call({Locale dictionary}); @@ -89,8 +88,8 @@ abstract class _$$DictionaryEventUpdateImplCopyWith<$Res> class __$$DictionaryEventUpdateImplCopyWithImpl<$Res> extends _$DictionaryEventCopyWithImpl<$Res, _$DictionaryEventUpdateImpl> implements _$$DictionaryEventUpdateImplCopyWith<$Res> { - __$$DictionaryEventUpdateImplCopyWithImpl(_$DictionaryEventUpdateImpl _value, - $Res Function(_$DictionaryEventUpdateImpl) _then) + __$$DictionaryEventUpdateImplCopyWithImpl( + _$DictionaryEventUpdateImpl _value, $Res Function(_$DictionaryEventUpdateImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -125,8 +124,7 @@ class _$DictionaryEventUpdateImpl implements _DictionaryEventUpdate { return identical(this, other) || (other.runtimeType == runtimeType && other is _$DictionaryEventUpdateImpl && - (identical(other.dictionary, dictionary) || - other.dictionary == dictionary)); + (identical(other.dictionary, dictionary) || other.dictionary == dictionary)); } @override @@ -135,9 +133,8 @@ class _$DictionaryEventUpdateImpl implements _DictionaryEventUpdate { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$DictionaryEventUpdateImplCopyWith<_$DictionaryEventUpdateImpl> - get copyWith => __$$DictionaryEventUpdateImplCopyWithImpl< - _$DictionaryEventUpdateImpl>(this, _$identity); + _$$DictionaryEventUpdateImplCopyWith<_$DictionaryEventUpdateImpl> get copyWith => + __$$DictionaryEventUpdateImplCopyWithImpl<_$DictionaryEventUpdateImpl>(this, _$identity); @override @optionalTypeArgs @@ -169,15 +166,14 @@ class _$DictionaryEventUpdateImpl implements _DictionaryEventUpdate { } abstract class _DictionaryEventUpdate implements DictionaryEvent { - const factory _DictionaryEventUpdate({required final Locale dictionary}) = - _$DictionaryEventUpdateImpl; + const factory _DictionaryEventUpdate({required final Locale dictionary}) = _$DictionaryEventUpdateImpl; @override Locale get dictionary; + @override @JsonKey(ignore: true) - _$$DictionaryEventUpdateImplCopyWith<_$DictionaryEventUpdateImpl> - get copyWith => throw _privateConstructorUsedError; + _$$DictionaryEventUpdateImplCopyWith<_$DictionaryEventUpdateImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc @@ -190,6 +186,7 @@ mixin _$DictionaryState { required TResult Function(_DictionaryStateInProgress value) inProgress, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? mapOrNull({ TResult? Function(_DictionaryStateIdle value)? idle, @@ -205,26 +202,25 @@ mixin _$DictionaryState { throw _privateConstructorUsedError; @JsonKey(ignore: true) - $DictionaryStateCopyWith get copyWith => - throw _privateConstructorUsedError; + $DictionaryStateCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $DictionaryStateCopyWith<$Res> { - factory $DictionaryStateCopyWith( - DictionaryState value, $Res Function(DictionaryState) then) = + factory $DictionaryStateCopyWith(DictionaryState value, $Res Function(DictionaryState) then) = _$DictionaryStateCopyWithImpl<$Res, DictionaryState>; + @useResult $Res call({Locale dictionary}); } /// @nodoc -class _$DictionaryStateCopyWithImpl<$Res, $Val extends DictionaryState> - implements $DictionaryStateCopyWith<$Res> { +class _$DictionaryStateCopyWithImpl<$Res, $Val extends DictionaryState> implements $DictionaryStateCopyWith<$Res> { _$DictionaryStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -243,11 +239,11 @@ class _$DictionaryStateCopyWithImpl<$Res, $Val extends DictionaryState> } /// @nodoc -abstract class _$$DictionaryStateIdleImplCopyWith<$Res> - implements $DictionaryStateCopyWith<$Res> { - factory _$$DictionaryStateIdleImplCopyWith(_$DictionaryStateIdleImpl value, - $Res Function(_$DictionaryStateIdleImpl) then) = +abstract class _$$DictionaryStateIdleImplCopyWith<$Res> implements $DictionaryStateCopyWith<$Res> { + factory _$$DictionaryStateIdleImplCopyWith( + _$DictionaryStateIdleImpl value, $Res Function(_$DictionaryStateIdleImpl) then) = __$$DictionaryStateIdleImplCopyWithImpl<$Res>; + @override @useResult $Res call({Locale dictionary}); @@ -257,8 +253,8 @@ abstract class _$$DictionaryStateIdleImplCopyWith<$Res> class __$$DictionaryStateIdleImplCopyWithImpl<$Res> extends _$DictionaryStateCopyWithImpl<$Res, _$DictionaryStateIdleImpl> implements _$$DictionaryStateIdleImplCopyWith<$Res> { - __$$DictionaryStateIdleImplCopyWithImpl(_$DictionaryStateIdleImpl _value, - $Res Function(_$DictionaryStateIdleImpl) _then) + __$$DictionaryStateIdleImplCopyWithImpl( + _$DictionaryStateIdleImpl _value, $Res Function(_$DictionaryStateIdleImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -293,8 +289,7 @@ class _$DictionaryStateIdleImpl implements _DictionaryStateIdle { return identical(this, other) || (other.runtimeType == runtimeType && other is _$DictionaryStateIdleImpl && - (identical(other.dictionary, dictionary) || - other.dictionary == dictionary)); + (identical(other.dictionary, dictionary) || other.dictionary == dictionary)); } @override @@ -304,8 +299,7 @@ class _$DictionaryStateIdleImpl implements _DictionaryStateIdle { @override @pragma('vm:prefer-inline') _$$DictionaryStateIdleImplCopyWith<_$DictionaryStateIdleImpl> get copyWith => - __$$DictionaryStateIdleImplCopyWithImpl<_$DictionaryStateIdleImpl>( - this, _$identity); + __$$DictionaryStateIdleImplCopyWithImpl<_$DictionaryStateIdleImpl>(this, _$identity); @override @optionalTypeArgs @@ -340,24 +334,22 @@ class _$DictionaryStateIdleImpl implements _DictionaryStateIdle { } abstract class _DictionaryStateIdle implements DictionaryState { - const factory _DictionaryStateIdle({required final Locale dictionary}) = - _$DictionaryStateIdleImpl; + const factory _DictionaryStateIdle({required final Locale dictionary}) = _$DictionaryStateIdleImpl; @override Locale get dictionary; + @override @JsonKey(ignore: true) - _$$DictionaryStateIdleImplCopyWith<_$DictionaryStateIdleImpl> get copyWith => - throw _privateConstructorUsedError; + _$$DictionaryStateIdleImplCopyWith<_$DictionaryStateIdleImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$DictionaryStateInProgressImplCopyWith<$Res> - implements $DictionaryStateCopyWith<$Res> { +abstract class _$$DictionaryStateInProgressImplCopyWith<$Res> implements $DictionaryStateCopyWith<$Res> { factory _$$DictionaryStateInProgressImplCopyWith( - _$DictionaryStateInProgressImpl value, - $Res Function(_$DictionaryStateInProgressImpl) then) = + _$DictionaryStateInProgressImpl value, $Res Function(_$DictionaryStateInProgressImpl) then) = __$$DictionaryStateInProgressImplCopyWithImpl<$Res>; + @override @useResult $Res call({Locale dictionary}); @@ -368,8 +360,7 @@ class __$$DictionaryStateInProgressImplCopyWithImpl<$Res> extends _$DictionaryStateCopyWithImpl<$Res, _$DictionaryStateInProgressImpl> implements _$$DictionaryStateInProgressImplCopyWith<$Res> { __$$DictionaryStateInProgressImplCopyWithImpl( - _$DictionaryStateInProgressImpl _value, - $Res Function(_$DictionaryStateInProgressImpl) _then) + _$DictionaryStateInProgressImpl _value, $Res Function(_$DictionaryStateInProgressImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -404,8 +395,7 @@ class _$DictionaryStateInProgressImpl implements _DictionaryStateInProgress { return identical(this, other) || (other.runtimeType == runtimeType && other is _$DictionaryStateInProgressImpl && - (identical(other.dictionary, dictionary) || - other.dictionary == dictionary)); + (identical(other.dictionary, dictionary) || other.dictionary == dictionary)); } @override @@ -414,9 +404,8 @@ class _$DictionaryStateInProgressImpl implements _DictionaryStateInProgress { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$DictionaryStateInProgressImplCopyWith<_$DictionaryStateInProgressImpl> - get copyWith => __$$DictionaryStateInProgressImplCopyWithImpl< - _$DictionaryStateInProgressImpl>(this, _$identity); + _$$DictionaryStateInProgressImplCopyWith<_$DictionaryStateInProgressImpl> get copyWith => + __$$DictionaryStateInProgressImplCopyWithImpl<_$DictionaryStateInProgressImpl>(this, _$identity); @override @optionalTypeArgs @@ -451,13 +440,13 @@ class _$DictionaryStateInProgressImpl implements _DictionaryStateInProgress { } abstract class _DictionaryStateInProgress implements DictionaryState { - const factory _DictionaryStateInProgress({required final Locale dictionary}) = - _$DictionaryStateInProgressImpl; + const factory _DictionaryStateInProgress({required final Locale dictionary}) = _$DictionaryStateInProgressImpl; @override Locale get dictionary; + @override @JsonKey(ignore: true) - _$$DictionaryStateInProgressImplCopyWith<_$DictionaryStateInProgressImpl> - get copyWith => throw _privateConstructorUsedError; + _$$DictionaryStateInProgressImplCopyWith<_$DictionaryStateInProgressImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/src/feature/app/logic/locale_bloc.freezed.dart b/lib/src/feature/app/logic/locale_bloc.freezed.dart index 7602aa26..6fab37e8 100644 --- a/lib/src/feature/app/logic/locale_bloc.freezed.dart +++ b/lib/src/feature/app/logic/locale_bloc.freezed.dart @@ -23,6 +23,7 @@ mixin _$LocaleEvent { required TResult Function(_LocaleEventUpdate value) update, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? mapOrNull({ TResult? Function(_LocaleEventUpdate value)? update, @@ -36,26 +37,25 @@ mixin _$LocaleEvent { throw _privateConstructorUsedError; @JsonKey(ignore: true) - $LocaleEventCopyWith get copyWith => - throw _privateConstructorUsedError; + $LocaleEventCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $LocaleEventCopyWith<$Res> { - factory $LocaleEventCopyWith( - LocaleEvent value, $Res Function(LocaleEvent) then) = + factory $LocaleEventCopyWith(LocaleEvent value, $Res Function(LocaleEvent) then) = _$LocaleEventCopyWithImpl<$Res, LocaleEvent>; + @useResult $Res call({Locale locale}); } /// @nodoc -class _$LocaleEventCopyWithImpl<$Res, $Val extends LocaleEvent> - implements $LocaleEventCopyWith<$Res> { +class _$LocaleEventCopyWithImpl<$Res, $Val extends LocaleEvent> implements $LocaleEventCopyWith<$Res> { _$LocaleEventCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -74,22 +74,19 @@ class _$LocaleEventCopyWithImpl<$Res, $Val extends LocaleEvent> } /// @nodoc -abstract class _$$LocaleEventUpdateImplCopyWith<$Res> - implements $LocaleEventCopyWith<$Res> { - factory _$$LocaleEventUpdateImplCopyWith(_$LocaleEventUpdateImpl value, - $Res Function(_$LocaleEventUpdateImpl) then) = +abstract class _$$LocaleEventUpdateImplCopyWith<$Res> implements $LocaleEventCopyWith<$Res> { + factory _$$LocaleEventUpdateImplCopyWith(_$LocaleEventUpdateImpl value, $Res Function(_$LocaleEventUpdateImpl) then) = __$$LocaleEventUpdateImplCopyWithImpl<$Res>; + @override @useResult $Res call({Locale locale}); } /// @nodoc -class __$$LocaleEventUpdateImplCopyWithImpl<$Res> - extends _$LocaleEventCopyWithImpl<$Res, _$LocaleEventUpdateImpl> +class __$$LocaleEventUpdateImplCopyWithImpl<$Res> extends _$LocaleEventCopyWithImpl<$Res, _$LocaleEventUpdateImpl> implements _$$LocaleEventUpdateImplCopyWith<$Res> { - __$$LocaleEventUpdateImplCopyWithImpl(_$LocaleEventUpdateImpl _value, - $Res Function(_$LocaleEventUpdateImpl) _then) + __$$LocaleEventUpdateImplCopyWithImpl(_$LocaleEventUpdateImpl _value, $Res Function(_$LocaleEventUpdateImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -134,8 +131,7 @@ class _$LocaleEventUpdateImpl implements _LocaleEventUpdate { @override @pragma('vm:prefer-inline') _$$LocaleEventUpdateImplCopyWith<_$LocaleEventUpdateImpl> get copyWith => - __$$LocaleEventUpdateImplCopyWithImpl<_$LocaleEventUpdateImpl>( - this, _$identity); + __$$LocaleEventUpdateImplCopyWithImpl<_$LocaleEventUpdateImpl>(this, _$identity); @override @optionalTypeArgs @@ -167,15 +163,14 @@ class _$LocaleEventUpdateImpl implements _LocaleEventUpdate { } abstract class _LocaleEventUpdate implements LocaleEvent { - const factory _LocaleEventUpdate({required final Locale locale}) = - _$LocaleEventUpdateImpl; + const factory _LocaleEventUpdate({required final Locale locale}) = _$LocaleEventUpdateImpl; @override Locale get locale; + @override @JsonKey(ignore: true) - _$$LocaleEventUpdateImplCopyWith<_$LocaleEventUpdateImpl> get copyWith => - throw _privateConstructorUsedError; + _$$LocaleEventUpdateImplCopyWith<_$LocaleEventUpdateImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc @@ -188,6 +183,7 @@ mixin _$LocaleState { required TResult Function(_LocaleStateInProgress value) inProgress, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? mapOrNull({ TResult? Function(_LocaleStateIdle value)? idle, @@ -203,26 +199,25 @@ mixin _$LocaleState { throw _privateConstructorUsedError; @JsonKey(ignore: true) - $LocaleStateCopyWith get copyWith => - throw _privateConstructorUsedError; + $LocaleStateCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $LocaleStateCopyWith<$Res> { - factory $LocaleStateCopyWith( - LocaleState value, $Res Function(LocaleState) then) = + factory $LocaleStateCopyWith(LocaleState value, $Res Function(LocaleState) then) = _$LocaleStateCopyWithImpl<$Res, LocaleState>; + @useResult $Res call({Locale locale}); } /// @nodoc -class _$LocaleStateCopyWithImpl<$Res, $Val extends LocaleState> - implements $LocaleStateCopyWith<$Res> { +class _$LocaleStateCopyWithImpl<$Res, $Val extends LocaleState> implements $LocaleStateCopyWith<$Res> { _$LocaleStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -241,22 +236,19 @@ class _$LocaleStateCopyWithImpl<$Res, $Val extends LocaleState> } /// @nodoc -abstract class _$$LocaleStateIdleImplCopyWith<$Res> - implements $LocaleStateCopyWith<$Res> { - factory _$$LocaleStateIdleImplCopyWith(_$LocaleStateIdleImpl value, - $Res Function(_$LocaleStateIdleImpl) then) = +abstract class _$$LocaleStateIdleImplCopyWith<$Res> implements $LocaleStateCopyWith<$Res> { + factory _$$LocaleStateIdleImplCopyWith(_$LocaleStateIdleImpl value, $Res Function(_$LocaleStateIdleImpl) then) = __$$LocaleStateIdleImplCopyWithImpl<$Res>; + @override @useResult $Res call({Locale locale}); } /// @nodoc -class __$$LocaleStateIdleImplCopyWithImpl<$Res> - extends _$LocaleStateCopyWithImpl<$Res, _$LocaleStateIdleImpl> +class __$$LocaleStateIdleImplCopyWithImpl<$Res> extends _$LocaleStateCopyWithImpl<$Res, _$LocaleStateIdleImpl> implements _$$LocaleStateIdleImplCopyWith<$Res> { - __$$LocaleStateIdleImplCopyWithImpl( - _$LocaleStateIdleImpl _value, $Res Function(_$LocaleStateIdleImpl) _then) + __$$LocaleStateIdleImplCopyWithImpl(_$LocaleStateIdleImpl _value, $Res Function(_$LocaleStateIdleImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -301,8 +293,7 @@ class _$LocaleStateIdleImpl implements _LocaleStateIdle { @override @pragma('vm:prefer-inline') _$$LocaleStateIdleImplCopyWith<_$LocaleStateIdleImpl> get copyWith => - __$$LocaleStateIdleImplCopyWithImpl<_$LocaleStateIdleImpl>( - this, _$identity); + __$$LocaleStateIdleImplCopyWithImpl<_$LocaleStateIdleImpl>(this, _$identity); @override @optionalTypeArgs @@ -337,24 +328,22 @@ class _$LocaleStateIdleImpl implements _LocaleStateIdle { } abstract class _LocaleStateIdle implements LocaleState { - const factory _LocaleStateIdle({required final Locale locale}) = - _$LocaleStateIdleImpl; + const factory _LocaleStateIdle({required final Locale locale}) = _$LocaleStateIdleImpl; @override Locale get locale; + @override @JsonKey(ignore: true) - _$$LocaleStateIdleImplCopyWith<_$LocaleStateIdleImpl> get copyWith => - throw _privateConstructorUsedError; + _$$LocaleStateIdleImplCopyWith<_$LocaleStateIdleImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$LocaleStateInProgressImplCopyWith<$Res> - implements $LocaleStateCopyWith<$Res> { +abstract class _$$LocaleStateInProgressImplCopyWith<$Res> implements $LocaleStateCopyWith<$Res> { factory _$$LocaleStateInProgressImplCopyWith( - _$LocaleStateInProgressImpl value, - $Res Function(_$LocaleStateInProgressImpl) then) = + _$LocaleStateInProgressImpl value, $Res Function(_$LocaleStateInProgressImpl) then) = __$$LocaleStateInProgressImplCopyWithImpl<$Res>; + @override @useResult $Res call({Locale locale}); @@ -364,8 +353,8 @@ abstract class _$$LocaleStateInProgressImplCopyWith<$Res> class __$$LocaleStateInProgressImplCopyWithImpl<$Res> extends _$LocaleStateCopyWithImpl<$Res, _$LocaleStateInProgressImpl> implements _$$LocaleStateInProgressImplCopyWith<$Res> { - __$$LocaleStateInProgressImplCopyWithImpl(_$LocaleStateInProgressImpl _value, - $Res Function(_$LocaleStateInProgressImpl) _then) + __$$LocaleStateInProgressImplCopyWithImpl( + _$LocaleStateInProgressImpl _value, $Res Function(_$LocaleStateInProgressImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -409,9 +398,8 @@ class _$LocaleStateInProgressImpl implements _LocaleStateInProgress { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$LocaleStateInProgressImplCopyWith<_$LocaleStateInProgressImpl> - get copyWith => __$$LocaleStateInProgressImplCopyWithImpl< - _$LocaleStateInProgressImpl>(this, _$identity); + _$$LocaleStateInProgressImplCopyWith<_$LocaleStateInProgressImpl> get copyWith => + __$$LocaleStateInProgressImplCopyWithImpl<_$LocaleStateInProgressImpl>(this, _$identity); @override @optionalTypeArgs @@ -446,13 +434,12 @@ class _$LocaleStateInProgressImpl implements _LocaleStateInProgress { } abstract class _LocaleStateInProgress implements LocaleState { - const factory _LocaleStateInProgress({required final Locale locale}) = - _$LocaleStateInProgressImpl; + const factory _LocaleStateInProgress({required final Locale locale}) = _$LocaleStateInProgressImpl; @override Locale get locale; + @override @JsonKey(ignore: true) - _$$LocaleStateInProgressImplCopyWith<_$LocaleStateInProgressImpl> - get copyWith => throw _privateConstructorUsedError; + _$$LocaleStateInProgressImplCopyWith<_$LocaleStateInProgressImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/feature/app/logic/theme_bloc.freezed.dart b/lib/src/feature/app/logic/theme_bloc.freezed.dart index 625b6818..921c5b17 100644 --- a/lib/src/feature/app/logic/theme_bloc.freezed.dart +++ b/lib/src/feature/app/logic/theme_bloc.freezed.dart @@ -23,6 +23,7 @@ mixin _$ThemeEvent { required TResult Function(_ThemeEventUpdate value) update, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? mapOrNull({ TResult? Function(_ThemeEventUpdate value)? update, @@ -36,26 +37,25 @@ mixin _$ThemeEvent { throw _privateConstructorUsedError; @JsonKey(ignore: true) - $ThemeEventCopyWith get copyWith => - throw _privateConstructorUsedError; + $ThemeEventCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ThemeEventCopyWith<$Res> { - factory $ThemeEventCopyWith( - ThemeEvent value, $Res Function(ThemeEvent) then) = + factory $ThemeEventCopyWith(ThemeEvent value, $Res Function(ThemeEvent) then) = _$ThemeEventCopyWithImpl<$Res, ThemeEvent>; + @useResult $Res call({AppTheme theme}); } /// @nodoc -class _$ThemeEventCopyWithImpl<$Res, $Val extends ThemeEvent> - implements $ThemeEventCopyWith<$Res> { +class _$ThemeEventCopyWithImpl<$Res, $Val extends ThemeEvent> implements $ThemeEventCopyWith<$Res> { _$ThemeEventCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -74,22 +74,19 @@ class _$ThemeEventCopyWithImpl<$Res, $Val extends ThemeEvent> } /// @nodoc -abstract class _$$ThemeEventUpdateImplCopyWith<$Res> - implements $ThemeEventCopyWith<$Res> { - factory _$$ThemeEventUpdateImplCopyWith(_$ThemeEventUpdateImpl value, - $Res Function(_$ThemeEventUpdateImpl) then) = +abstract class _$$ThemeEventUpdateImplCopyWith<$Res> implements $ThemeEventCopyWith<$Res> { + factory _$$ThemeEventUpdateImplCopyWith(_$ThemeEventUpdateImpl value, $Res Function(_$ThemeEventUpdateImpl) then) = __$$ThemeEventUpdateImplCopyWithImpl<$Res>; + @override @useResult $Res call({AppTheme theme}); } /// @nodoc -class __$$ThemeEventUpdateImplCopyWithImpl<$Res> - extends _$ThemeEventCopyWithImpl<$Res, _$ThemeEventUpdateImpl> +class __$$ThemeEventUpdateImplCopyWithImpl<$Res> extends _$ThemeEventCopyWithImpl<$Res, _$ThemeEventUpdateImpl> implements _$$ThemeEventUpdateImplCopyWith<$Res> { - __$$ThemeEventUpdateImplCopyWithImpl(_$ThemeEventUpdateImpl _value, - $Res Function(_$ThemeEventUpdateImpl) _then) + __$$ThemeEventUpdateImplCopyWithImpl(_$ThemeEventUpdateImpl _value, $Res Function(_$ThemeEventUpdateImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -134,8 +131,7 @@ class _$ThemeEventUpdateImpl implements _ThemeEventUpdate { @override @pragma('vm:prefer-inline') _$$ThemeEventUpdateImplCopyWith<_$ThemeEventUpdateImpl> get copyWith => - __$$ThemeEventUpdateImplCopyWithImpl<_$ThemeEventUpdateImpl>( - this, _$identity); + __$$ThemeEventUpdateImplCopyWithImpl<_$ThemeEventUpdateImpl>(this, _$identity); @override @optionalTypeArgs @@ -167,15 +163,14 @@ class _$ThemeEventUpdateImpl implements _ThemeEventUpdate { } abstract class _ThemeEventUpdate implements ThemeEvent { - const factory _ThemeEventUpdate(final AppTheme theme) = - _$ThemeEventUpdateImpl; + const factory _ThemeEventUpdate(final AppTheme theme) = _$ThemeEventUpdateImpl; @override AppTheme get theme; + @override @JsonKey(ignore: true) - _$$ThemeEventUpdateImplCopyWith<_$ThemeEventUpdateImpl> get copyWith => - throw _privateConstructorUsedError; + _$$ThemeEventUpdateImplCopyWith<_$ThemeEventUpdateImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc @@ -188,6 +183,7 @@ mixin _$ThemeState { required TResult Function(_ThemeStateInProgress value) inProgress, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? mapOrNull({ TResult? Function(_ThemeStateIdle value)? idle, @@ -203,26 +199,25 @@ mixin _$ThemeState { throw _privateConstructorUsedError; @JsonKey(ignore: true) - $ThemeStateCopyWith get copyWith => - throw _privateConstructorUsedError; + $ThemeStateCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $ThemeStateCopyWith<$Res> { - factory $ThemeStateCopyWith( - ThemeState value, $Res Function(ThemeState) then) = + factory $ThemeStateCopyWith(ThemeState value, $Res Function(ThemeState) then) = _$ThemeStateCopyWithImpl<$Res, ThemeState>; + @useResult $Res call({AppTheme theme}); } /// @nodoc -class _$ThemeStateCopyWithImpl<$Res, $Val extends ThemeState> - implements $ThemeStateCopyWith<$Res> { +class _$ThemeStateCopyWithImpl<$Res, $Val extends ThemeState> implements $ThemeStateCopyWith<$Res> { _$ThemeStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -241,22 +236,19 @@ class _$ThemeStateCopyWithImpl<$Res, $Val extends ThemeState> } /// @nodoc -abstract class _$$ThemeStateIdleImplCopyWith<$Res> - implements $ThemeStateCopyWith<$Res> { - factory _$$ThemeStateIdleImplCopyWith(_$ThemeStateIdleImpl value, - $Res Function(_$ThemeStateIdleImpl) then) = +abstract class _$$ThemeStateIdleImplCopyWith<$Res> implements $ThemeStateCopyWith<$Res> { + factory _$$ThemeStateIdleImplCopyWith(_$ThemeStateIdleImpl value, $Res Function(_$ThemeStateIdleImpl) then) = __$$ThemeStateIdleImplCopyWithImpl<$Res>; + @override @useResult $Res call({AppTheme theme}); } /// @nodoc -class __$$ThemeStateIdleImplCopyWithImpl<$Res> - extends _$ThemeStateCopyWithImpl<$Res, _$ThemeStateIdleImpl> +class __$$ThemeStateIdleImplCopyWithImpl<$Res> extends _$ThemeStateCopyWithImpl<$Res, _$ThemeStateIdleImpl> implements _$$ThemeStateIdleImplCopyWith<$Res> { - __$$ThemeStateIdleImplCopyWithImpl( - _$ThemeStateIdleImpl _value, $Res Function(_$ThemeStateIdleImpl) _then) + __$$ThemeStateIdleImplCopyWithImpl(_$ThemeStateIdleImpl _value, $Res Function(_$ThemeStateIdleImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -301,8 +293,7 @@ class _$ThemeStateIdleImpl implements _ThemeStateIdle { @override @pragma('vm:prefer-inline') _$$ThemeStateIdleImplCopyWith<_$ThemeStateIdleImpl> get copyWith => - __$$ThemeStateIdleImplCopyWithImpl<_$ThemeStateIdleImpl>( - this, _$identity); + __$$ThemeStateIdleImplCopyWithImpl<_$ThemeStateIdleImpl>(this, _$identity); @override @optionalTypeArgs @@ -341,29 +332,28 @@ abstract class _ThemeStateIdle implements ThemeState { @override AppTheme get theme; + @override @JsonKey(ignore: true) - _$$ThemeStateIdleImplCopyWith<_$ThemeStateIdleImpl> get copyWith => - throw _privateConstructorUsedError; + _$$ThemeStateIdleImplCopyWith<_$ThemeStateIdleImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$ThemeStateInProgressImplCopyWith<$Res> - implements $ThemeStateCopyWith<$Res> { - factory _$$ThemeStateInProgressImplCopyWith(_$ThemeStateInProgressImpl value, - $Res Function(_$ThemeStateInProgressImpl) then) = +abstract class _$$ThemeStateInProgressImplCopyWith<$Res> implements $ThemeStateCopyWith<$Res> { + factory _$$ThemeStateInProgressImplCopyWith( + _$ThemeStateInProgressImpl value, $Res Function(_$ThemeStateInProgressImpl) then) = __$$ThemeStateInProgressImplCopyWithImpl<$Res>; + @override @useResult $Res call({AppTheme theme}); } /// @nodoc -class __$$ThemeStateInProgressImplCopyWithImpl<$Res> - extends _$ThemeStateCopyWithImpl<$Res, _$ThemeStateInProgressImpl> +class __$$ThemeStateInProgressImplCopyWithImpl<$Res> extends _$ThemeStateCopyWithImpl<$Res, _$ThemeStateInProgressImpl> implements _$$ThemeStateInProgressImplCopyWith<$Res> { - __$$ThemeStateInProgressImplCopyWithImpl(_$ThemeStateInProgressImpl _value, - $Res Function(_$ThemeStateInProgressImpl) _then) + __$$ThemeStateInProgressImplCopyWithImpl( + _$ThemeStateInProgressImpl _value, $Res Function(_$ThemeStateInProgressImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -407,10 +397,8 @@ class _$ThemeStateInProgressImpl implements _ThemeStateInProgress { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$ThemeStateInProgressImplCopyWith<_$ThemeStateInProgressImpl> - get copyWith => - __$$ThemeStateInProgressImplCopyWithImpl<_$ThemeStateInProgressImpl>( - this, _$identity); + _$$ThemeStateInProgressImplCopyWith<_$ThemeStateInProgressImpl> get copyWith => + __$$ThemeStateInProgressImplCopyWithImpl<_$ThemeStateInProgressImpl>(this, _$identity); @override @optionalTypeArgs @@ -445,13 +433,12 @@ class _$ThemeStateInProgressImpl implements _ThemeStateInProgress { } abstract class _ThemeStateInProgress implements ThemeState { - const factory _ThemeStateInProgress(final AppTheme theme) = - _$ThemeStateInProgressImpl; + const factory _ThemeStateInProgress(final AppTheme theme) = _$ThemeStateInProgressImpl; @override AppTheme get theme; + @override @JsonKey(ignore: true) - _$$ThemeStateInProgressImplCopyWith<_$ThemeStateInProgressImpl> - get copyWith => throw _privateConstructorUsedError; + _$$ThemeStateInProgressImplCopyWith<_$ThemeStateInProgressImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/feature/game/logic/game_bloc.dart b/lib/src/feature/game/logic/game_bloc.dart index 2ee869eb..dca1ad65 100644 --- a/lib/src/feature/game/logic/game_bloc.dart +++ b/lib/src/feature/game/logic/game_bloc.dart @@ -3,8 +3,7 @@ import 'dart:ui' show Locale; import 'package:collection/collection.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:meta/meta.dart'; -import 'package:wordly/src/core/utils/pattern_match.dart'; +import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:wordly/src/feature/game/data/game_repository.dart'; import 'package:wordly/src/feature/game/model/game_mode.dart'; import 'package:wordly/src/feature/game/model/game_result.dart'; @@ -13,9 +12,28 @@ import 'package:wordly/src/feature/game/model/word_error.dart'; import 'package:wordly/src/feature/level/data/level_repository.dart'; import 'package:wordly/src/feature/statistic/data/statistics_repository.dart'; -@immutable -sealed class GameState extends _GameStateBase { - const GameState(); +part 'game_bloc.freezed.dart'; + +@Freezed() +sealed class GameEvent with _$GameEvent { + const factory GameEvent.changeDictionary(Locale dictionary) = _GameEventChangeDictionary; + + const factory GameEvent.changeGameMode(GameMode gameMode) = _GameEventChangeGameMode; + + const factory GameEvent.resetBoard(GameMode gameMode) = _GameEventResetBoard; + + const factory GameEvent.letterPressed(String key) = _GameEventLetterPressed; + + const factory GameEvent.deletePressed() = _GameEventDeletePressed; + + const factory GameEvent.deleteLongPressed() = _GameEventDeleteLongPressed; + + const factory GameEvent.enterPressed() = _GameEventEnterPressed; +} + +@Freezed() +sealed class GameState with _$GameState { + const GameState._(); const factory GameState.idle({ required Locale dictionary, @@ -60,429 +78,7 @@ sealed class GameState extends _GameStateBase { int get currentWordIndex => (board.length - 1) ~/ 5; - bool get isResultState => maybeMap(win: (_) => true, loss: (_) => true, orElse: false); -} - -final class _GameStateIdle extends GameState { - const _GameStateIdle({ - required this.dictionary, - required this.secretWord, - required this.gameMode, - required this.gameCompleted, - required this.board, - required this.statuses, - required this.lvlNumber, - }); - - @override - final Locale dictionary; - @override - final String secretWord; - @override - final GameMode gameMode; - @override - final bool gameCompleted; - @override - final List board; - @override - final Map statuses; - @override - final int? lvlNumber; - - @override - String toString() => 'GameState.idle(board: $board)'; - - @override - bool operator ==(Object other) => - identical(this, other) || - (other is _GameStateIdle && - dictionary == other.dictionary && - secretWord == other.secretWord && - gameMode == other.gameMode && - gameCompleted == other.gameCompleted && - const DeepCollectionEquality().equals(board, other.board) && - const DeepCollectionEquality().equals(statuses, other.statuses)) && - lvlNumber == other.lvlNumber; - - @override - int get hashCode => - dictionary.hashCode ^ - secretWord.hashCode ^ - gameMode.hashCode ^ - gameCompleted.hashCode ^ - const DeepCollectionEquality().hash(board) ^ - const DeepCollectionEquality().hash(statuses) ^ - lvlNumber.hashCode; -} - -final class _GameStateWin extends GameState { - const _GameStateWin({ - required this.dictionary, - required this.secretWord, - required this.gameMode, - required this.gameCompleted, - required this.board, - required this.statuses, - required this.lvlNumber, - }); - - @override - final Locale dictionary; - @override - final String secretWord; - @override - final GameMode gameMode; - @override - final bool gameCompleted; - @override - final List board; - @override - final Map statuses; - @override - final int? lvlNumber; - - @override - String toString() => 'GameState.win(board: $board)'; - - @override - bool operator ==(Object other) => - identical(this, other) || - (other is _GameStateWin && - dictionary == other.dictionary && - secretWord == other.secretWord && - gameMode == other.gameMode && - gameCompleted == other.gameCompleted && - const DeepCollectionEquality().equals(board, other.board) && - const DeepCollectionEquality().equals(statuses, other.statuses)) && - lvlNumber == other.lvlNumber; - - @override - int get hashCode => - dictionary.hashCode ^ - secretWord.hashCode ^ - gameMode.hashCode ^ - gameCompleted.hashCode ^ - const DeepCollectionEquality().hash(board) ^ - const DeepCollectionEquality().hash(statuses) ^ - lvlNumber.hashCode; -} - -final class _GameStateLoss extends GameState { - const _GameStateLoss({ - required this.dictionary, - required this.secretWord, - required this.gameMode, - required this.gameCompleted, - required this.board, - required this.statuses, - required this.lvlNumber, - }); - - @override - final Locale dictionary; - @override - final String secretWord; - @override - final GameMode gameMode; - @override - final bool gameCompleted; - @override - final List board; - @override - final Map statuses; - @override - final int? lvlNumber; - - @override - String toString() => 'GameState.loss(board: $board)'; - - @override - bool operator ==(Object other) => - identical(this, other) || - (other is _GameStateLoss && - dictionary == other.dictionary && - secretWord == other.secretWord && - gameMode == other.gameMode && - gameCompleted == other.gameCompleted && - const DeepCollectionEquality().equals(board, other.board) && - const DeepCollectionEquality().equals(statuses, other.statuses)) && - lvlNumber == other.lvlNumber; - - @override - int get hashCode => - dictionary.hashCode ^ - secretWord.hashCode ^ - gameMode.hashCode ^ - gameCompleted.hashCode ^ - const DeepCollectionEquality().hash(board) ^ - const DeepCollectionEquality().hash(statuses) ^ - lvlNumber.hashCode; -} - -final class _GameStateError extends GameState { - const _GameStateError({ - required this.dictionary, - required this.secretWord, - required this.gameMode, - required this.gameCompleted, - required this.board, - required this.statuses, - required this.error, - required this.lvlNumber, - }); - - @override - final Locale dictionary; - @override - final String secretWord; - @override - final GameMode gameMode; - @override - final bool gameCompleted; - @override - final List board; - @override - final Map statuses; - @override - final int? lvlNumber; - final WordError error; - - @override - String toString() => 'GameState.error(board: $board, error: $error)'; - - @override - bool operator ==(Object other) => - identical(this, other) || - (other is _GameStateError && - dictionary == other.dictionary && - secretWord == other.secretWord && - gameMode == other.gameMode && - gameCompleted == other.gameCompleted && - const DeepCollectionEquality().equals(board, other.board) && - const DeepCollectionEquality().equals(statuses, other.statuses) && - error == other.error && - lvlNumber == other.lvlNumber); - - @override - int get hashCode => - dictionary.hashCode ^ - secretWord.hashCode ^ - gameCompleted.hashCode ^ - const DeepCollectionEquality().hash(board) ^ - const DeepCollectionEquality().hash(statuses) ^ - error.hashCode ^ - lvlNumber.hashCode; -} - -abstract base class _GameStateBase { - const _GameStateBase(); - - Locale get dictionary; - - String get secretWord; - - GameMode get gameMode; - - bool get gameCompleted; - - List get board; - - Map get statuses; - - int? get lvlNumber; - - T map({ - required PatternMatch idle, - required PatternMatch win, - required PatternMatch loss, - required PatternMatch error, - }) => - switch (this) { - final _GameStateIdle state => idle(state), - final _GameStateWin state => win(state), - final _GameStateLoss state => loss(state), - final _GameStateError state => error(state), - _ => throw AssertionError('Unknown state: $this'), - }; - - T maybeMap({ - required T orElse, - PatternMatch? idle, - PatternMatch? win, - PatternMatch? loss, - PatternMatch? error, - }) => - map( - idle: idle ?? (_) => orElse, - win: win ?? (_) => orElse, - loss: loss ?? (_) => orElse, - error: error ?? (_) => orElse, - ); -} - -@immutable -sealed class GameEvent extends _GameEventBase { - const GameEvent(); - - const factory GameEvent.changeDictionary(Locale dictionary) = _GameEventChangeDictionary; - - const factory GameEvent.changeGameMode(GameMode gameMode) = _GameEventChangeGameMode; - - const factory GameEvent.resetBoard(GameMode gameMode) = _GameEventResetBoard; - - const factory GameEvent.letterPressed(Object key) = _GameEventLetterPressed; - - const factory GameEvent.deletePressed() = _GameEventDeletePressed; - - const factory GameEvent.deleteLongPressed() = _GameEventDeleteLongPressed; - - const factory GameEvent.enterPressed() = _GameEventEnterPressed; -} - -final class _GameEventChangeDictionary extends GameEvent { - const _GameEventChangeDictionary(this.dictionary); - - final Locale dictionary; - - @override - String toString() => 'GameEvent.changeDictionary(dictionary: $dictionary)'; - - @override - bool operator ==(Object other) => - identical(this, other) || (other is _GameEventChangeDictionary && dictionary == other.dictionary); - - @override - int get hashCode => dictionary.hashCode; -} - -final class _GameEventChangeGameMode extends GameEvent { - const _GameEventChangeGameMode(this.gameMode); - - final GameMode gameMode; - - @override - String toString() => 'GameEvent.changeGameMode(gameMode: $gameMode)'; - - @override - bool operator ==(Object other) => - identical(this, other) || (other is _GameEventChangeGameMode && gameMode == other.gameMode); - - @override - int get hashCode => gameMode.hashCode; -} - -final class _GameEventResetBoard extends GameEvent { - const _GameEventResetBoard(this.gameMode); - - final GameMode gameMode; - - @override - String toString() => 'GameEvent.resetBoard(gameMode: $gameMode)'; - - @override - bool operator ==(Object other) => - identical(this, other) || (other is _GameEventResetBoard && gameMode == other.gameMode); - - @override - int get hashCode => gameMode.hashCode; -} - -final class _GameEventLetterPressed extends GameEvent { - const _GameEventLetterPressed(this.key); - - final Object key; - - @override - String toString() => 'GameEvent.letterPressed(key: $key)'; - - @override - bool operator ==(Object other) => identical(this, other) || (other is _GameEventLetterPressed && key == other.key); - - @override - int get hashCode => key.hashCode; -} - -final class _GameEventEnterPressed extends GameEvent { - const _GameEventEnterPressed(); - - @override - String toString() => 'GameEvent.enterPressed()'; - - @override - bool operator ==(Object other) => identical(this, other) || (other is _GameEventEnterPressed); - - @override - int get hashCode => runtimeType.hashCode; -} - -final class _GameEventDeletePressed extends GameEvent { - const _GameEventDeletePressed(); - - @override - String toString() => 'GameEvent.deletePressed()'; - - @override - bool operator ==(Object other) => identical(this, other) || (other is _GameEventDeletePressed); - - @override - int get hashCode => runtimeType.hashCode; -} - -final class _GameEventDeleteLongPressed extends GameEvent { - const _GameEventDeleteLongPressed(); - - @override - String toString() => 'GameEvent.deleteLongPressed()'; - - @override - bool operator ==(Object other) => identical(this, other) || (other is _GameEventDeleteLongPressed); - - @override - int get hashCode => runtimeType.hashCode; -} - -abstract base class _GameEventBase { - const _GameEventBase(); - - T map({ - required PatternMatch changeDictionary, - required PatternMatch changeGameMode, - required PatternMatch resetBoard, - required PatternMatch letterPressed, - required PatternMatch enterPressed, - required PatternMatch deletePressed, - required PatternMatch deleteLongPressed, - }) => - switch (this) { - final _GameEventChangeDictionary event => changeDictionary(event), - final _GameEventChangeGameMode event => changeGameMode(event), - final _GameEventResetBoard event => resetBoard(event), - final _GameEventLetterPressed event => letterPressed(event), - final _GameEventEnterPressed event => enterPressed(event), - final _GameEventDeletePressed event => deletePressed(event), - final _GameEventDeleteLongPressed event => deleteLongPressed(event), - _ => throw AssertionError('Unknown event: $this'), - }; - - T maybeMap({ - required T orElse, - PatternMatch? changeDictionary, - PatternMatch? changeGameMode, - PatternMatch? resetBoard, - PatternMatch? letterPressed, - PatternMatch? enterPressed, - PatternMatch? deletePressed, - PatternMatch? deleteLongPressed, - }) => - map( - changeDictionary: changeDictionary ?? (_) => orElse, - changeGameMode: changeGameMode ?? (_) => orElse, - resetBoard: resetBoard ?? (_) => orElse, - letterPressed: letterPressed ?? (_) => orElse, - enterPressed: enterPressed ?? (_) => orElse, - deletePressed: deletePressed ?? (_) => orElse, - deleteLongPressed: deleteLongPressed ?? (_) => orElse, - ); + bool get isResultState => maybeMap(win: (_) => true, loss: (_) => true, orElse: () => false); } class GameBloc extends Bloc { @@ -620,7 +216,7 @@ class GameBloc extends Bloc { secretWord: state.secretWord, gameMode: state.gameMode, gameCompleted: state.gameCompleted, - board: List.of(state.board)..add(LetterInfo(letter: event.key.toString())), + board: List.of(state.board)..add(LetterInfo(letter: event.key)), statuses: state.statuses, lvlNumber: state.lvlNumber, ), diff --git a/lib/src/feature/game/logic/game_bloc.freezed.dart b/lib/src/feature/game/logic/game_bloc.freezed.dart new file mode 100644 index 00000000..45267974 --- /dev/null +++ b/lib/src/feature/game/logic/game_bloc.freezed.dart @@ -0,0 +1,1791 @@ +// coverage:ignore-file +// GENERATED CODE - DO NOT MODIFY BY HAND +// ignore_for_file: type=lint +// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark + +part of 'game_bloc.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +T _$identity(T value) => value; + +final _privateConstructorUsedError = UnsupportedError( + 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#custom-getters-and-methods'); + +/// @nodoc +mixin _$GameEvent { + @optionalTypeArgs + TResult map({ + required TResult Function(_GameEventChangeDictionary value) changeDictionary, + required TResult Function(_GameEventChangeGameMode value) changeGameMode, + required TResult Function(_GameEventResetBoard value) resetBoard, + required TResult Function(_GameEventLetterPressed value) letterPressed, + required TResult Function(_GameEventDeletePressed value) deletePressed, + required TResult Function(_GameEventDeleteLongPressed value) deleteLongPressed, + required TResult Function(_GameEventEnterPressed value) enterPressed, + }) => + throw _privateConstructorUsedError; + + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_GameEventChangeDictionary value)? changeDictionary, + TResult? Function(_GameEventChangeGameMode value)? changeGameMode, + TResult? Function(_GameEventResetBoard value)? resetBoard, + TResult? Function(_GameEventLetterPressed value)? letterPressed, + TResult? Function(_GameEventDeletePressed value)? deletePressed, + TResult? Function(_GameEventDeleteLongPressed value)? deleteLongPressed, + TResult? Function(_GameEventEnterPressed value)? enterPressed, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_GameEventChangeDictionary value)? changeDictionary, + TResult Function(_GameEventChangeGameMode value)? changeGameMode, + TResult Function(_GameEventResetBoard value)? resetBoard, + TResult Function(_GameEventLetterPressed value)? letterPressed, + TResult Function(_GameEventDeletePressed value)? deletePressed, + TResult Function(_GameEventDeleteLongPressed value)? deleteLongPressed, + TResult Function(_GameEventEnterPressed value)? enterPressed, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $GameEventCopyWith<$Res> { + factory $GameEventCopyWith(GameEvent value, $Res Function(GameEvent) then) = _$GameEventCopyWithImpl<$Res, GameEvent>; +} + +/// @nodoc +class _$GameEventCopyWithImpl<$Res, $Val extends GameEvent> implements $GameEventCopyWith<$Res> { + _$GameEventCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + + // ignore: unused_field + final $Res Function($Val) _then; +} + +/// @nodoc +abstract class _$$GameEventChangeDictionaryImplCopyWith<$Res> { + factory _$$GameEventChangeDictionaryImplCopyWith( + _$GameEventChangeDictionaryImpl value, $Res Function(_$GameEventChangeDictionaryImpl) then) = + __$$GameEventChangeDictionaryImplCopyWithImpl<$Res>; + + @useResult + $Res call({Locale dictionary}); +} + +/// @nodoc +class __$$GameEventChangeDictionaryImplCopyWithImpl<$Res> + extends _$GameEventCopyWithImpl<$Res, _$GameEventChangeDictionaryImpl> + implements _$$GameEventChangeDictionaryImplCopyWith<$Res> { + __$$GameEventChangeDictionaryImplCopyWithImpl( + _$GameEventChangeDictionaryImpl _value, $Res Function(_$GameEventChangeDictionaryImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? dictionary = null, + }) { + return _then(_$GameEventChangeDictionaryImpl( + null == dictionary + ? _value.dictionary + : dictionary // ignore: cast_nullable_to_non_nullable + as Locale, + )); + } +} + +/// @nodoc + +class _$GameEventChangeDictionaryImpl implements _GameEventChangeDictionary { + const _$GameEventChangeDictionaryImpl(this.dictionary); + + @override + final Locale dictionary; + + @override + String toString() { + return 'GameEvent.changeDictionary(dictionary: $dictionary)'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$GameEventChangeDictionaryImpl && + (identical(other.dictionary, dictionary) || other.dictionary == dictionary)); + } + + @override + int get hashCode => Object.hash(runtimeType, dictionary); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$GameEventChangeDictionaryImplCopyWith<_$GameEventChangeDictionaryImpl> get copyWith => + __$$GameEventChangeDictionaryImplCopyWithImpl<_$GameEventChangeDictionaryImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_GameEventChangeDictionary value) changeDictionary, + required TResult Function(_GameEventChangeGameMode value) changeGameMode, + required TResult Function(_GameEventResetBoard value) resetBoard, + required TResult Function(_GameEventLetterPressed value) letterPressed, + required TResult Function(_GameEventDeletePressed value) deletePressed, + required TResult Function(_GameEventDeleteLongPressed value) deleteLongPressed, + required TResult Function(_GameEventEnterPressed value) enterPressed, + }) { + return changeDictionary(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_GameEventChangeDictionary value)? changeDictionary, + TResult? Function(_GameEventChangeGameMode value)? changeGameMode, + TResult? Function(_GameEventResetBoard value)? resetBoard, + TResult? Function(_GameEventLetterPressed value)? letterPressed, + TResult? Function(_GameEventDeletePressed value)? deletePressed, + TResult? Function(_GameEventDeleteLongPressed value)? deleteLongPressed, + TResult? Function(_GameEventEnterPressed value)? enterPressed, + }) { + return changeDictionary?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_GameEventChangeDictionary value)? changeDictionary, + TResult Function(_GameEventChangeGameMode value)? changeGameMode, + TResult Function(_GameEventResetBoard value)? resetBoard, + TResult Function(_GameEventLetterPressed value)? letterPressed, + TResult Function(_GameEventDeletePressed value)? deletePressed, + TResult Function(_GameEventDeleteLongPressed value)? deleteLongPressed, + TResult Function(_GameEventEnterPressed value)? enterPressed, + required TResult orElse(), + }) { + if (changeDictionary != null) { + return changeDictionary(this); + } + return orElse(); + } +} + +abstract class _GameEventChangeDictionary implements GameEvent { + const factory _GameEventChangeDictionary(final Locale dictionary) = _$GameEventChangeDictionaryImpl; + + Locale get dictionary; + + @JsonKey(ignore: true) + _$$GameEventChangeDictionaryImplCopyWith<_$GameEventChangeDictionaryImpl> get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$GameEventChangeGameModeImplCopyWith<$Res> { + factory _$$GameEventChangeGameModeImplCopyWith( + _$GameEventChangeGameModeImpl value, $Res Function(_$GameEventChangeGameModeImpl) then) = + __$$GameEventChangeGameModeImplCopyWithImpl<$Res>; + + @useResult + $Res call({GameMode gameMode}); +} + +/// @nodoc +class __$$GameEventChangeGameModeImplCopyWithImpl<$Res> + extends _$GameEventCopyWithImpl<$Res, _$GameEventChangeGameModeImpl> + implements _$$GameEventChangeGameModeImplCopyWith<$Res> { + __$$GameEventChangeGameModeImplCopyWithImpl( + _$GameEventChangeGameModeImpl _value, $Res Function(_$GameEventChangeGameModeImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? gameMode = null, + }) { + return _then(_$GameEventChangeGameModeImpl( + null == gameMode + ? _value.gameMode + : gameMode // ignore: cast_nullable_to_non_nullable + as GameMode, + )); + } +} + +/// @nodoc + +class _$GameEventChangeGameModeImpl implements _GameEventChangeGameMode { + const _$GameEventChangeGameModeImpl(this.gameMode); + + @override + final GameMode gameMode; + + @override + String toString() { + return 'GameEvent.changeGameMode(gameMode: $gameMode)'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$GameEventChangeGameModeImpl && + (identical(other.gameMode, gameMode) || other.gameMode == gameMode)); + } + + @override + int get hashCode => Object.hash(runtimeType, gameMode); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$GameEventChangeGameModeImplCopyWith<_$GameEventChangeGameModeImpl> get copyWith => + __$$GameEventChangeGameModeImplCopyWithImpl<_$GameEventChangeGameModeImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_GameEventChangeDictionary value) changeDictionary, + required TResult Function(_GameEventChangeGameMode value) changeGameMode, + required TResult Function(_GameEventResetBoard value) resetBoard, + required TResult Function(_GameEventLetterPressed value) letterPressed, + required TResult Function(_GameEventDeletePressed value) deletePressed, + required TResult Function(_GameEventDeleteLongPressed value) deleteLongPressed, + required TResult Function(_GameEventEnterPressed value) enterPressed, + }) { + return changeGameMode(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_GameEventChangeDictionary value)? changeDictionary, + TResult? Function(_GameEventChangeGameMode value)? changeGameMode, + TResult? Function(_GameEventResetBoard value)? resetBoard, + TResult? Function(_GameEventLetterPressed value)? letterPressed, + TResult? Function(_GameEventDeletePressed value)? deletePressed, + TResult? Function(_GameEventDeleteLongPressed value)? deleteLongPressed, + TResult? Function(_GameEventEnterPressed value)? enterPressed, + }) { + return changeGameMode?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_GameEventChangeDictionary value)? changeDictionary, + TResult Function(_GameEventChangeGameMode value)? changeGameMode, + TResult Function(_GameEventResetBoard value)? resetBoard, + TResult Function(_GameEventLetterPressed value)? letterPressed, + TResult Function(_GameEventDeletePressed value)? deletePressed, + TResult Function(_GameEventDeleteLongPressed value)? deleteLongPressed, + TResult Function(_GameEventEnterPressed value)? enterPressed, + required TResult orElse(), + }) { + if (changeGameMode != null) { + return changeGameMode(this); + } + return orElse(); + } +} + +abstract class _GameEventChangeGameMode implements GameEvent { + const factory _GameEventChangeGameMode(final GameMode gameMode) = _$GameEventChangeGameModeImpl; + + GameMode get gameMode; + + @JsonKey(ignore: true) + _$$GameEventChangeGameModeImplCopyWith<_$GameEventChangeGameModeImpl> get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$GameEventResetBoardImplCopyWith<$Res> { + factory _$$GameEventResetBoardImplCopyWith( + _$GameEventResetBoardImpl value, $Res Function(_$GameEventResetBoardImpl) then) = + __$$GameEventResetBoardImplCopyWithImpl<$Res>; + + @useResult + $Res call({GameMode gameMode}); +} + +/// @nodoc +class __$$GameEventResetBoardImplCopyWithImpl<$Res> extends _$GameEventCopyWithImpl<$Res, _$GameEventResetBoardImpl> + implements _$$GameEventResetBoardImplCopyWith<$Res> { + __$$GameEventResetBoardImplCopyWithImpl( + _$GameEventResetBoardImpl _value, $Res Function(_$GameEventResetBoardImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? gameMode = null, + }) { + return _then(_$GameEventResetBoardImpl( + null == gameMode + ? _value.gameMode + : gameMode // ignore: cast_nullable_to_non_nullable + as GameMode, + )); + } +} + +/// @nodoc + +class _$GameEventResetBoardImpl implements _GameEventResetBoard { + const _$GameEventResetBoardImpl(this.gameMode); + + @override + final GameMode gameMode; + + @override + String toString() { + return 'GameEvent.resetBoard(gameMode: $gameMode)'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$GameEventResetBoardImpl && + (identical(other.gameMode, gameMode) || other.gameMode == gameMode)); + } + + @override + int get hashCode => Object.hash(runtimeType, gameMode); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$GameEventResetBoardImplCopyWith<_$GameEventResetBoardImpl> get copyWith => + __$$GameEventResetBoardImplCopyWithImpl<_$GameEventResetBoardImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_GameEventChangeDictionary value) changeDictionary, + required TResult Function(_GameEventChangeGameMode value) changeGameMode, + required TResult Function(_GameEventResetBoard value) resetBoard, + required TResult Function(_GameEventLetterPressed value) letterPressed, + required TResult Function(_GameEventDeletePressed value) deletePressed, + required TResult Function(_GameEventDeleteLongPressed value) deleteLongPressed, + required TResult Function(_GameEventEnterPressed value) enterPressed, + }) { + return resetBoard(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_GameEventChangeDictionary value)? changeDictionary, + TResult? Function(_GameEventChangeGameMode value)? changeGameMode, + TResult? Function(_GameEventResetBoard value)? resetBoard, + TResult? Function(_GameEventLetterPressed value)? letterPressed, + TResult? Function(_GameEventDeletePressed value)? deletePressed, + TResult? Function(_GameEventDeleteLongPressed value)? deleteLongPressed, + TResult? Function(_GameEventEnterPressed value)? enterPressed, + }) { + return resetBoard?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_GameEventChangeDictionary value)? changeDictionary, + TResult Function(_GameEventChangeGameMode value)? changeGameMode, + TResult Function(_GameEventResetBoard value)? resetBoard, + TResult Function(_GameEventLetterPressed value)? letterPressed, + TResult Function(_GameEventDeletePressed value)? deletePressed, + TResult Function(_GameEventDeleteLongPressed value)? deleteLongPressed, + TResult Function(_GameEventEnterPressed value)? enterPressed, + required TResult orElse(), + }) { + if (resetBoard != null) { + return resetBoard(this); + } + return orElse(); + } +} + +abstract class _GameEventResetBoard implements GameEvent { + const factory _GameEventResetBoard(final GameMode gameMode) = _$GameEventResetBoardImpl; + + GameMode get gameMode; + + @JsonKey(ignore: true) + _$$GameEventResetBoardImplCopyWith<_$GameEventResetBoardImpl> get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$GameEventLetterPressedImplCopyWith<$Res> { + factory _$$GameEventLetterPressedImplCopyWith( + _$GameEventLetterPressedImpl value, $Res Function(_$GameEventLetterPressedImpl) then) = + __$$GameEventLetterPressedImplCopyWithImpl<$Res>; + + @useResult + $Res call({String key}); +} + +/// @nodoc +class __$$GameEventLetterPressedImplCopyWithImpl<$Res> + extends _$GameEventCopyWithImpl<$Res, _$GameEventLetterPressedImpl> + implements _$$GameEventLetterPressedImplCopyWith<$Res> { + __$$GameEventLetterPressedImplCopyWithImpl( + _$GameEventLetterPressedImpl _value, $Res Function(_$GameEventLetterPressedImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? key = null, + }) { + return _then(_$GameEventLetterPressedImpl( + null == key + ? _value.key + : key // ignore: cast_nullable_to_non_nullable + as String, + )); + } +} + +/// @nodoc + +class _$GameEventLetterPressedImpl implements _GameEventLetterPressed { + const _$GameEventLetterPressedImpl(this.key); + + @override + final String key; + + @override + String toString() { + return 'GameEvent.letterPressed(key: $key)'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$GameEventLetterPressedImpl && + (identical(other.key, key) || other.key == key)); + } + + @override + int get hashCode => Object.hash(runtimeType, key); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$GameEventLetterPressedImplCopyWith<_$GameEventLetterPressedImpl> get copyWith => + __$$GameEventLetterPressedImplCopyWithImpl<_$GameEventLetterPressedImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_GameEventChangeDictionary value) changeDictionary, + required TResult Function(_GameEventChangeGameMode value) changeGameMode, + required TResult Function(_GameEventResetBoard value) resetBoard, + required TResult Function(_GameEventLetterPressed value) letterPressed, + required TResult Function(_GameEventDeletePressed value) deletePressed, + required TResult Function(_GameEventDeleteLongPressed value) deleteLongPressed, + required TResult Function(_GameEventEnterPressed value) enterPressed, + }) { + return letterPressed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_GameEventChangeDictionary value)? changeDictionary, + TResult? Function(_GameEventChangeGameMode value)? changeGameMode, + TResult? Function(_GameEventResetBoard value)? resetBoard, + TResult? Function(_GameEventLetterPressed value)? letterPressed, + TResult? Function(_GameEventDeletePressed value)? deletePressed, + TResult? Function(_GameEventDeleteLongPressed value)? deleteLongPressed, + TResult? Function(_GameEventEnterPressed value)? enterPressed, + }) { + return letterPressed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_GameEventChangeDictionary value)? changeDictionary, + TResult Function(_GameEventChangeGameMode value)? changeGameMode, + TResult Function(_GameEventResetBoard value)? resetBoard, + TResult Function(_GameEventLetterPressed value)? letterPressed, + TResult Function(_GameEventDeletePressed value)? deletePressed, + TResult Function(_GameEventDeleteLongPressed value)? deleteLongPressed, + TResult Function(_GameEventEnterPressed value)? enterPressed, + required TResult orElse(), + }) { + if (letterPressed != null) { + return letterPressed(this); + } + return orElse(); + } +} + +abstract class _GameEventLetterPressed implements GameEvent { + const factory _GameEventLetterPressed(final String key) = _$GameEventLetterPressedImpl; + + String get key; + + @JsonKey(ignore: true) + _$$GameEventLetterPressedImplCopyWith<_$GameEventLetterPressedImpl> get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$GameEventDeletePressedImplCopyWith<$Res> { + factory _$$GameEventDeletePressedImplCopyWith( + _$GameEventDeletePressedImpl value, $Res Function(_$GameEventDeletePressedImpl) then) = + __$$GameEventDeletePressedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$GameEventDeletePressedImplCopyWithImpl<$Res> + extends _$GameEventCopyWithImpl<$Res, _$GameEventDeletePressedImpl> + implements _$$GameEventDeletePressedImplCopyWith<$Res> { + __$$GameEventDeletePressedImplCopyWithImpl( + _$GameEventDeletePressedImpl _value, $Res Function(_$GameEventDeletePressedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$GameEventDeletePressedImpl implements _GameEventDeletePressed { + const _$GameEventDeletePressedImpl(); + + @override + String toString() { + return 'GameEvent.deletePressed()'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || (other.runtimeType == runtimeType && other is _$GameEventDeletePressedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_GameEventChangeDictionary value) changeDictionary, + required TResult Function(_GameEventChangeGameMode value) changeGameMode, + required TResult Function(_GameEventResetBoard value) resetBoard, + required TResult Function(_GameEventLetterPressed value) letterPressed, + required TResult Function(_GameEventDeletePressed value) deletePressed, + required TResult Function(_GameEventDeleteLongPressed value) deleteLongPressed, + required TResult Function(_GameEventEnterPressed value) enterPressed, + }) { + return deletePressed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_GameEventChangeDictionary value)? changeDictionary, + TResult? Function(_GameEventChangeGameMode value)? changeGameMode, + TResult? Function(_GameEventResetBoard value)? resetBoard, + TResult? Function(_GameEventLetterPressed value)? letterPressed, + TResult? Function(_GameEventDeletePressed value)? deletePressed, + TResult? Function(_GameEventDeleteLongPressed value)? deleteLongPressed, + TResult? Function(_GameEventEnterPressed value)? enterPressed, + }) { + return deletePressed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_GameEventChangeDictionary value)? changeDictionary, + TResult Function(_GameEventChangeGameMode value)? changeGameMode, + TResult Function(_GameEventResetBoard value)? resetBoard, + TResult Function(_GameEventLetterPressed value)? letterPressed, + TResult Function(_GameEventDeletePressed value)? deletePressed, + TResult Function(_GameEventDeleteLongPressed value)? deleteLongPressed, + TResult Function(_GameEventEnterPressed value)? enterPressed, + required TResult orElse(), + }) { + if (deletePressed != null) { + return deletePressed(this); + } + return orElse(); + } +} + +abstract class _GameEventDeletePressed implements GameEvent { + const factory _GameEventDeletePressed() = _$GameEventDeletePressedImpl; +} + +/// @nodoc +abstract class _$$GameEventDeleteLongPressedImplCopyWith<$Res> { + factory _$$GameEventDeleteLongPressedImplCopyWith( + _$GameEventDeleteLongPressedImpl value, $Res Function(_$GameEventDeleteLongPressedImpl) then) = + __$$GameEventDeleteLongPressedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$GameEventDeleteLongPressedImplCopyWithImpl<$Res> + extends _$GameEventCopyWithImpl<$Res, _$GameEventDeleteLongPressedImpl> + implements _$$GameEventDeleteLongPressedImplCopyWith<$Res> { + __$$GameEventDeleteLongPressedImplCopyWithImpl( + _$GameEventDeleteLongPressedImpl _value, $Res Function(_$GameEventDeleteLongPressedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$GameEventDeleteLongPressedImpl implements _GameEventDeleteLongPressed { + const _$GameEventDeleteLongPressedImpl(); + + @override + String toString() { + return 'GameEvent.deleteLongPressed()'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || (other.runtimeType == runtimeType && other is _$GameEventDeleteLongPressedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_GameEventChangeDictionary value) changeDictionary, + required TResult Function(_GameEventChangeGameMode value) changeGameMode, + required TResult Function(_GameEventResetBoard value) resetBoard, + required TResult Function(_GameEventLetterPressed value) letterPressed, + required TResult Function(_GameEventDeletePressed value) deletePressed, + required TResult Function(_GameEventDeleteLongPressed value) deleteLongPressed, + required TResult Function(_GameEventEnterPressed value) enterPressed, + }) { + return deleteLongPressed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_GameEventChangeDictionary value)? changeDictionary, + TResult? Function(_GameEventChangeGameMode value)? changeGameMode, + TResult? Function(_GameEventResetBoard value)? resetBoard, + TResult? Function(_GameEventLetterPressed value)? letterPressed, + TResult? Function(_GameEventDeletePressed value)? deletePressed, + TResult? Function(_GameEventDeleteLongPressed value)? deleteLongPressed, + TResult? Function(_GameEventEnterPressed value)? enterPressed, + }) { + return deleteLongPressed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_GameEventChangeDictionary value)? changeDictionary, + TResult Function(_GameEventChangeGameMode value)? changeGameMode, + TResult Function(_GameEventResetBoard value)? resetBoard, + TResult Function(_GameEventLetterPressed value)? letterPressed, + TResult Function(_GameEventDeletePressed value)? deletePressed, + TResult Function(_GameEventDeleteLongPressed value)? deleteLongPressed, + TResult Function(_GameEventEnterPressed value)? enterPressed, + required TResult orElse(), + }) { + if (deleteLongPressed != null) { + return deleteLongPressed(this); + } + return orElse(); + } +} + +abstract class _GameEventDeleteLongPressed implements GameEvent { + const factory _GameEventDeleteLongPressed() = _$GameEventDeleteLongPressedImpl; +} + +/// @nodoc +abstract class _$$GameEventEnterPressedImplCopyWith<$Res> { + factory _$$GameEventEnterPressedImplCopyWith( + _$GameEventEnterPressedImpl value, $Res Function(_$GameEventEnterPressedImpl) then) = + __$$GameEventEnterPressedImplCopyWithImpl<$Res>; +} + +/// @nodoc +class __$$GameEventEnterPressedImplCopyWithImpl<$Res> extends _$GameEventCopyWithImpl<$Res, _$GameEventEnterPressedImpl> + implements _$$GameEventEnterPressedImplCopyWith<$Res> { + __$$GameEventEnterPressedImplCopyWithImpl( + _$GameEventEnterPressedImpl _value, $Res Function(_$GameEventEnterPressedImpl) _then) + : super(_value, _then); +} + +/// @nodoc + +class _$GameEventEnterPressedImpl implements _GameEventEnterPressed { + const _$GameEventEnterPressedImpl(); + + @override + String toString() { + return 'GameEvent.enterPressed()'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || (other.runtimeType == runtimeType && other is _$GameEventEnterPressedImpl); + } + + @override + int get hashCode => runtimeType.hashCode; + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_GameEventChangeDictionary value) changeDictionary, + required TResult Function(_GameEventChangeGameMode value) changeGameMode, + required TResult Function(_GameEventResetBoard value) resetBoard, + required TResult Function(_GameEventLetterPressed value) letterPressed, + required TResult Function(_GameEventDeletePressed value) deletePressed, + required TResult Function(_GameEventDeleteLongPressed value) deleteLongPressed, + required TResult Function(_GameEventEnterPressed value) enterPressed, + }) { + return enterPressed(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_GameEventChangeDictionary value)? changeDictionary, + TResult? Function(_GameEventChangeGameMode value)? changeGameMode, + TResult? Function(_GameEventResetBoard value)? resetBoard, + TResult? Function(_GameEventLetterPressed value)? letterPressed, + TResult? Function(_GameEventDeletePressed value)? deletePressed, + TResult? Function(_GameEventDeleteLongPressed value)? deleteLongPressed, + TResult? Function(_GameEventEnterPressed value)? enterPressed, + }) { + return enterPressed?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_GameEventChangeDictionary value)? changeDictionary, + TResult Function(_GameEventChangeGameMode value)? changeGameMode, + TResult Function(_GameEventResetBoard value)? resetBoard, + TResult Function(_GameEventLetterPressed value)? letterPressed, + TResult Function(_GameEventDeletePressed value)? deletePressed, + TResult Function(_GameEventDeleteLongPressed value)? deleteLongPressed, + TResult Function(_GameEventEnterPressed value)? enterPressed, + required TResult orElse(), + }) { + if (enterPressed != null) { + return enterPressed(this); + } + return orElse(); + } +} + +abstract class _GameEventEnterPressed implements GameEvent { + const factory _GameEventEnterPressed() = _$GameEventEnterPressedImpl; +} + +/// @nodoc +mixin _$GameState { + Locale get dictionary => throw _privateConstructorUsedError; + + String get secretWord => throw _privateConstructorUsedError; + + GameMode get gameMode => throw _privateConstructorUsedError; + + bool get gameCompleted => throw _privateConstructorUsedError; + + List get board => throw _privateConstructorUsedError; + + Map get statuses => throw _privateConstructorUsedError; + + int? get lvlNumber => throw _privateConstructorUsedError; + + @optionalTypeArgs + TResult map({ + required TResult Function(_GameStateIdle value) idle, + required TResult Function(_GameStateWin value) win, + required TResult Function(_GameStateLoss value) loss, + required TResult Function(_GameStateError value) error, + }) => + throw _privateConstructorUsedError; + + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_GameStateIdle value)? idle, + TResult? Function(_GameStateWin value)? win, + TResult? Function(_GameStateLoss value)? loss, + TResult? Function(_GameStateError value)? error, + }) => + throw _privateConstructorUsedError; + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_GameStateIdle value)? idle, + TResult Function(_GameStateWin value)? win, + TResult Function(_GameStateLoss value)? loss, + TResult Function(_GameStateError value)? error, + required TResult orElse(), + }) => + throw _privateConstructorUsedError; + + @JsonKey(ignore: true) + $GameStateCopyWith get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $GameStateCopyWith<$Res> { + factory $GameStateCopyWith(GameState value, $Res Function(GameState) then) = _$GameStateCopyWithImpl<$Res, GameState>; + + @useResult + $Res call( + {Locale dictionary, + String secretWord, + GameMode gameMode, + bool gameCompleted, + List board, + Map statuses, + int? lvlNumber}); +} + +/// @nodoc +class _$GameStateCopyWithImpl<$Res, $Val extends GameState> implements $GameStateCopyWith<$Res> { + _$GameStateCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + + // ignore: unused_field + final $Res Function($Val) _then; + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? dictionary = null, + Object? secretWord = null, + Object? gameMode = null, + Object? gameCompleted = null, + Object? board = null, + Object? statuses = null, + Object? lvlNumber = freezed, + }) { + return _then(_value.copyWith( + dictionary: null == dictionary + ? _value.dictionary + : dictionary // ignore: cast_nullable_to_non_nullable + as Locale, + secretWord: null == secretWord + ? _value.secretWord + : secretWord // ignore: cast_nullable_to_non_nullable + as String, + gameMode: null == gameMode + ? _value.gameMode + : gameMode // ignore: cast_nullable_to_non_nullable + as GameMode, + gameCompleted: null == gameCompleted + ? _value.gameCompleted + : gameCompleted // ignore: cast_nullable_to_non_nullable + as bool, + board: null == board + ? _value.board + : board // ignore: cast_nullable_to_non_nullable + as List, + statuses: null == statuses + ? _value.statuses + : statuses // ignore: cast_nullable_to_non_nullable + as Map, + lvlNumber: freezed == lvlNumber + ? _value.lvlNumber + : lvlNumber // ignore: cast_nullable_to_non_nullable + as int?, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$GameStateIdleImplCopyWith<$Res> implements $GameStateCopyWith<$Res> { + factory _$$GameStateIdleImplCopyWith(_$GameStateIdleImpl value, $Res Function(_$GameStateIdleImpl) then) = + __$$GameStateIdleImplCopyWithImpl<$Res>; + + @override + @useResult + $Res call( + {Locale dictionary, + String secretWord, + GameMode gameMode, + bool gameCompleted, + List board, + Map statuses, + int? lvlNumber}); +} + +/// @nodoc +class __$$GameStateIdleImplCopyWithImpl<$Res> extends _$GameStateCopyWithImpl<$Res, _$GameStateIdleImpl> + implements _$$GameStateIdleImplCopyWith<$Res> { + __$$GameStateIdleImplCopyWithImpl(_$GameStateIdleImpl _value, $Res Function(_$GameStateIdleImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? dictionary = null, + Object? secretWord = null, + Object? gameMode = null, + Object? gameCompleted = null, + Object? board = null, + Object? statuses = null, + Object? lvlNumber = freezed, + }) { + return _then(_$GameStateIdleImpl( + dictionary: null == dictionary + ? _value.dictionary + : dictionary // ignore: cast_nullable_to_non_nullable + as Locale, + secretWord: null == secretWord + ? _value.secretWord + : secretWord // ignore: cast_nullable_to_non_nullable + as String, + gameMode: null == gameMode + ? _value.gameMode + : gameMode // ignore: cast_nullable_to_non_nullable + as GameMode, + gameCompleted: null == gameCompleted + ? _value.gameCompleted + : gameCompleted // ignore: cast_nullable_to_non_nullable + as bool, + board: null == board + ? _value._board + : board // ignore: cast_nullable_to_non_nullable + as List, + statuses: null == statuses + ? _value._statuses + : statuses // ignore: cast_nullable_to_non_nullable + as Map, + lvlNumber: freezed == lvlNumber + ? _value.lvlNumber + : lvlNumber // ignore: cast_nullable_to_non_nullable + as int?, + )); + } +} + +/// @nodoc + +class _$GameStateIdleImpl extends _GameStateIdle { + const _$GameStateIdleImpl( + {required this.dictionary, + required this.secretWord, + required this.gameMode, + required this.gameCompleted, + required final List board, + required final Map statuses, + required this.lvlNumber}) + : _board = board, + _statuses = statuses, + super._(); + + @override + final Locale dictionary; + @override + final String secretWord; + @override + final GameMode gameMode; + @override + final bool gameCompleted; + final List _board; + + @override + List get board { + if (_board is EqualUnmodifiableListView) return _board; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_board); + } + + final Map _statuses; + + @override + Map get statuses { + if (_statuses is EqualUnmodifiableMapView) return _statuses; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(_statuses); + } + + @override + final int? lvlNumber; + + @override + String toString() { + return 'GameState.idle(dictionary: $dictionary, secretWord: $secretWord, gameMode: $gameMode, gameCompleted: $gameCompleted, board: $board, statuses: $statuses, lvlNumber: $lvlNumber)'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$GameStateIdleImpl && + (identical(other.dictionary, dictionary) || other.dictionary == dictionary) && + (identical(other.secretWord, secretWord) || other.secretWord == secretWord) && + (identical(other.gameMode, gameMode) || other.gameMode == gameMode) && + (identical(other.gameCompleted, gameCompleted) || other.gameCompleted == gameCompleted) && + const DeepCollectionEquality().equals(other._board, _board) && + const DeepCollectionEquality().equals(other._statuses, _statuses) && + (identical(other.lvlNumber, lvlNumber) || other.lvlNumber == lvlNumber)); + } + + @override + int get hashCode => Object.hash(runtimeType, dictionary, secretWord, gameMode, gameCompleted, + const DeepCollectionEquality().hash(_board), const DeepCollectionEquality().hash(_statuses), lvlNumber); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$GameStateIdleImplCopyWith<_$GameStateIdleImpl> get copyWith => + __$$GameStateIdleImplCopyWithImpl<_$GameStateIdleImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_GameStateIdle value) idle, + required TResult Function(_GameStateWin value) win, + required TResult Function(_GameStateLoss value) loss, + required TResult Function(_GameStateError value) error, + }) { + return idle(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_GameStateIdle value)? idle, + TResult? Function(_GameStateWin value)? win, + TResult? Function(_GameStateLoss value)? loss, + TResult? Function(_GameStateError value)? error, + }) { + return idle?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_GameStateIdle value)? idle, + TResult Function(_GameStateWin value)? win, + TResult Function(_GameStateLoss value)? loss, + TResult Function(_GameStateError value)? error, + required TResult orElse(), + }) { + if (idle != null) { + return idle(this); + } + return orElse(); + } +} + +abstract class _GameStateIdle extends GameState { + const factory _GameStateIdle( + {required final Locale dictionary, + required final String secretWord, + required final GameMode gameMode, + required final bool gameCompleted, + required final List board, + required final Map statuses, + required final int? lvlNumber}) = _$GameStateIdleImpl; + + const _GameStateIdle._() : super._(); + + @override + Locale get dictionary; + + @override + String get secretWord; + + @override + GameMode get gameMode; + + @override + bool get gameCompleted; + + @override + List get board; + + @override + Map get statuses; + + @override + int? get lvlNumber; + + @override + @JsonKey(ignore: true) + _$$GameStateIdleImplCopyWith<_$GameStateIdleImpl> get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$GameStateWinImplCopyWith<$Res> implements $GameStateCopyWith<$Res> { + factory _$$GameStateWinImplCopyWith(_$GameStateWinImpl value, $Res Function(_$GameStateWinImpl) then) = + __$$GameStateWinImplCopyWithImpl<$Res>; + + @override + @useResult + $Res call( + {Locale dictionary, + String secretWord, + GameMode gameMode, + bool gameCompleted, + List board, + Map statuses, + int? lvlNumber}); +} + +/// @nodoc +class __$$GameStateWinImplCopyWithImpl<$Res> extends _$GameStateCopyWithImpl<$Res, _$GameStateWinImpl> + implements _$$GameStateWinImplCopyWith<$Res> { + __$$GameStateWinImplCopyWithImpl(_$GameStateWinImpl _value, $Res Function(_$GameStateWinImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? dictionary = null, + Object? secretWord = null, + Object? gameMode = null, + Object? gameCompleted = null, + Object? board = null, + Object? statuses = null, + Object? lvlNumber = freezed, + }) { + return _then(_$GameStateWinImpl( + dictionary: null == dictionary + ? _value.dictionary + : dictionary // ignore: cast_nullable_to_non_nullable + as Locale, + secretWord: null == secretWord + ? _value.secretWord + : secretWord // ignore: cast_nullable_to_non_nullable + as String, + gameMode: null == gameMode + ? _value.gameMode + : gameMode // ignore: cast_nullable_to_non_nullable + as GameMode, + gameCompleted: null == gameCompleted + ? _value.gameCompleted + : gameCompleted // ignore: cast_nullable_to_non_nullable + as bool, + board: null == board + ? _value._board + : board // ignore: cast_nullable_to_non_nullable + as List, + statuses: null == statuses + ? _value._statuses + : statuses // ignore: cast_nullable_to_non_nullable + as Map, + lvlNumber: freezed == lvlNumber + ? _value.lvlNumber + : lvlNumber // ignore: cast_nullable_to_non_nullable + as int?, + )); + } +} + +/// @nodoc + +class _$GameStateWinImpl extends _GameStateWin { + const _$GameStateWinImpl( + {required this.dictionary, + required this.secretWord, + required this.gameMode, + required this.gameCompleted, + required final List board, + required final Map statuses, + required this.lvlNumber}) + : _board = board, + _statuses = statuses, + super._(); + + @override + final Locale dictionary; + @override + final String secretWord; + @override + final GameMode gameMode; + @override + final bool gameCompleted; + final List _board; + + @override + List get board { + if (_board is EqualUnmodifiableListView) return _board; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_board); + } + + final Map _statuses; + + @override + Map get statuses { + if (_statuses is EqualUnmodifiableMapView) return _statuses; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(_statuses); + } + + @override + final int? lvlNumber; + + @override + String toString() { + return 'GameState.win(dictionary: $dictionary, secretWord: $secretWord, gameMode: $gameMode, gameCompleted: $gameCompleted, board: $board, statuses: $statuses, lvlNumber: $lvlNumber)'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$GameStateWinImpl && + (identical(other.dictionary, dictionary) || other.dictionary == dictionary) && + (identical(other.secretWord, secretWord) || other.secretWord == secretWord) && + (identical(other.gameMode, gameMode) || other.gameMode == gameMode) && + (identical(other.gameCompleted, gameCompleted) || other.gameCompleted == gameCompleted) && + const DeepCollectionEquality().equals(other._board, _board) && + const DeepCollectionEquality().equals(other._statuses, _statuses) && + (identical(other.lvlNumber, lvlNumber) || other.lvlNumber == lvlNumber)); + } + + @override + int get hashCode => Object.hash(runtimeType, dictionary, secretWord, gameMode, gameCompleted, + const DeepCollectionEquality().hash(_board), const DeepCollectionEquality().hash(_statuses), lvlNumber); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$GameStateWinImplCopyWith<_$GameStateWinImpl> get copyWith => + __$$GameStateWinImplCopyWithImpl<_$GameStateWinImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_GameStateIdle value) idle, + required TResult Function(_GameStateWin value) win, + required TResult Function(_GameStateLoss value) loss, + required TResult Function(_GameStateError value) error, + }) { + return win(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_GameStateIdle value)? idle, + TResult? Function(_GameStateWin value)? win, + TResult? Function(_GameStateLoss value)? loss, + TResult? Function(_GameStateError value)? error, + }) { + return win?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_GameStateIdle value)? idle, + TResult Function(_GameStateWin value)? win, + TResult Function(_GameStateLoss value)? loss, + TResult Function(_GameStateError value)? error, + required TResult orElse(), + }) { + if (win != null) { + return win(this); + } + return orElse(); + } +} + +abstract class _GameStateWin extends GameState { + const factory _GameStateWin( + {required final Locale dictionary, + required final String secretWord, + required final GameMode gameMode, + required final bool gameCompleted, + required final List board, + required final Map statuses, + required final int? lvlNumber}) = _$GameStateWinImpl; + + const _GameStateWin._() : super._(); + + @override + Locale get dictionary; + + @override + String get secretWord; + + @override + GameMode get gameMode; + + @override + bool get gameCompleted; + + @override + List get board; + + @override + Map get statuses; + + @override + int? get lvlNumber; + + @override + @JsonKey(ignore: true) + _$$GameStateWinImplCopyWith<_$GameStateWinImpl> get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$GameStateLossImplCopyWith<$Res> implements $GameStateCopyWith<$Res> { + factory _$$GameStateLossImplCopyWith(_$GameStateLossImpl value, $Res Function(_$GameStateLossImpl) then) = + __$$GameStateLossImplCopyWithImpl<$Res>; + + @override + @useResult + $Res call( + {Locale dictionary, + String secretWord, + GameMode gameMode, + bool gameCompleted, + List board, + Map statuses, + int? lvlNumber}); +} + +/// @nodoc +class __$$GameStateLossImplCopyWithImpl<$Res> extends _$GameStateCopyWithImpl<$Res, _$GameStateLossImpl> + implements _$$GameStateLossImplCopyWith<$Res> { + __$$GameStateLossImplCopyWithImpl(_$GameStateLossImpl _value, $Res Function(_$GameStateLossImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? dictionary = null, + Object? secretWord = null, + Object? gameMode = null, + Object? gameCompleted = null, + Object? board = null, + Object? statuses = null, + Object? lvlNumber = freezed, + }) { + return _then(_$GameStateLossImpl( + dictionary: null == dictionary + ? _value.dictionary + : dictionary // ignore: cast_nullable_to_non_nullable + as Locale, + secretWord: null == secretWord + ? _value.secretWord + : secretWord // ignore: cast_nullable_to_non_nullable + as String, + gameMode: null == gameMode + ? _value.gameMode + : gameMode // ignore: cast_nullable_to_non_nullable + as GameMode, + gameCompleted: null == gameCompleted + ? _value.gameCompleted + : gameCompleted // ignore: cast_nullable_to_non_nullable + as bool, + board: null == board + ? _value._board + : board // ignore: cast_nullable_to_non_nullable + as List, + statuses: null == statuses + ? _value._statuses + : statuses // ignore: cast_nullable_to_non_nullable + as Map, + lvlNumber: freezed == lvlNumber + ? _value.lvlNumber + : lvlNumber // ignore: cast_nullable_to_non_nullable + as int?, + )); + } +} + +/// @nodoc + +class _$GameStateLossImpl extends _GameStateLoss { + const _$GameStateLossImpl( + {required this.dictionary, + required this.secretWord, + required this.gameMode, + required this.gameCompleted, + required final List board, + required final Map statuses, + required this.lvlNumber}) + : _board = board, + _statuses = statuses, + super._(); + + @override + final Locale dictionary; + @override + final String secretWord; + @override + final GameMode gameMode; + @override + final bool gameCompleted; + final List _board; + + @override + List get board { + if (_board is EqualUnmodifiableListView) return _board; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_board); + } + + final Map _statuses; + + @override + Map get statuses { + if (_statuses is EqualUnmodifiableMapView) return _statuses; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(_statuses); + } + + @override + final int? lvlNumber; + + @override + String toString() { + return 'GameState.loss(dictionary: $dictionary, secretWord: $secretWord, gameMode: $gameMode, gameCompleted: $gameCompleted, board: $board, statuses: $statuses, lvlNumber: $lvlNumber)'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$GameStateLossImpl && + (identical(other.dictionary, dictionary) || other.dictionary == dictionary) && + (identical(other.secretWord, secretWord) || other.secretWord == secretWord) && + (identical(other.gameMode, gameMode) || other.gameMode == gameMode) && + (identical(other.gameCompleted, gameCompleted) || other.gameCompleted == gameCompleted) && + const DeepCollectionEquality().equals(other._board, _board) && + const DeepCollectionEquality().equals(other._statuses, _statuses) && + (identical(other.lvlNumber, lvlNumber) || other.lvlNumber == lvlNumber)); + } + + @override + int get hashCode => Object.hash(runtimeType, dictionary, secretWord, gameMode, gameCompleted, + const DeepCollectionEquality().hash(_board), const DeepCollectionEquality().hash(_statuses), lvlNumber); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$GameStateLossImplCopyWith<_$GameStateLossImpl> get copyWith => + __$$GameStateLossImplCopyWithImpl<_$GameStateLossImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_GameStateIdle value) idle, + required TResult Function(_GameStateWin value) win, + required TResult Function(_GameStateLoss value) loss, + required TResult Function(_GameStateError value) error, + }) { + return loss(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_GameStateIdle value)? idle, + TResult? Function(_GameStateWin value)? win, + TResult? Function(_GameStateLoss value)? loss, + TResult? Function(_GameStateError value)? error, + }) { + return loss?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_GameStateIdle value)? idle, + TResult Function(_GameStateWin value)? win, + TResult Function(_GameStateLoss value)? loss, + TResult Function(_GameStateError value)? error, + required TResult orElse(), + }) { + if (loss != null) { + return loss(this); + } + return orElse(); + } +} + +abstract class _GameStateLoss extends GameState { + const factory _GameStateLoss( + {required final Locale dictionary, + required final String secretWord, + required final GameMode gameMode, + required final bool gameCompleted, + required final List board, + required final Map statuses, + required final int? lvlNumber}) = _$GameStateLossImpl; + + const _GameStateLoss._() : super._(); + + @override + Locale get dictionary; + + @override + String get secretWord; + + @override + GameMode get gameMode; + + @override + bool get gameCompleted; + + @override + List get board; + + @override + Map get statuses; + + @override + int? get lvlNumber; + + @override + @JsonKey(ignore: true) + _$$GameStateLossImplCopyWith<_$GameStateLossImpl> get copyWith => throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class _$$GameStateErrorImplCopyWith<$Res> implements $GameStateCopyWith<$Res> { + factory _$$GameStateErrorImplCopyWith(_$GameStateErrorImpl value, $Res Function(_$GameStateErrorImpl) then) = + __$$GameStateErrorImplCopyWithImpl<$Res>; + + @override + @useResult + $Res call( + {Locale dictionary, + String secretWord, + GameMode gameMode, + bool gameCompleted, + List board, + Map statuses, + WordError error, + int? lvlNumber}); +} + +/// @nodoc +class __$$GameStateErrorImplCopyWithImpl<$Res> extends _$GameStateCopyWithImpl<$Res, _$GameStateErrorImpl> + implements _$$GameStateErrorImplCopyWith<$Res> { + __$$GameStateErrorImplCopyWithImpl(_$GameStateErrorImpl _value, $Res Function(_$GameStateErrorImpl) _then) + : super(_value, _then); + + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? dictionary = null, + Object? secretWord = null, + Object? gameMode = null, + Object? gameCompleted = null, + Object? board = null, + Object? statuses = null, + Object? error = null, + Object? lvlNumber = freezed, + }) { + return _then(_$GameStateErrorImpl( + dictionary: null == dictionary + ? _value.dictionary + : dictionary // ignore: cast_nullable_to_non_nullable + as Locale, + secretWord: null == secretWord + ? _value.secretWord + : secretWord // ignore: cast_nullable_to_non_nullable + as String, + gameMode: null == gameMode + ? _value.gameMode + : gameMode // ignore: cast_nullable_to_non_nullable + as GameMode, + gameCompleted: null == gameCompleted + ? _value.gameCompleted + : gameCompleted // ignore: cast_nullable_to_non_nullable + as bool, + board: null == board + ? _value._board + : board // ignore: cast_nullable_to_non_nullable + as List, + statuses: null == statuses + ? _value._statuses + : statuses // ignore: cast_nullable_to_non_nullable + as Map, + error: null == error + ? _value.error + : error // ignore: cast_nullable_to_non_nullable + as WordError, + lvlNumber: freezed == lvlNumber + ? _value.lvlNumber + : lvlNumber // ignore: cast_nullable_to_non_nullable + as int?, + )); + } +} + +/// @nodoc + +class _$GameStateErrorImpl extends _GameStateError { + const _$GameStateErrorImpl( + {required this.dictionary, + required this.secretWord, + required this.gameMode, + required this.gameCompleted, + required final List board, + required final Map statuses, + required this.error, + required this.lvlNumber}) + : _board = board, + _statuses = statuses, + super._(); + + @override + final Locale dictionary; + @override + final String secretWord; + @override + final GameMode gameMode; + @override + final bool gameCompleted; + final List _board; + + @override + List get board { + if (_board is EqualUnmodifiableListView) return _board; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_board); + } + + final Map _statuses; + + @override + Map get statuses { + if (_statuses is EqualUnmodifiableMapView) return _statuses; + // ignore: implicit_dynamic_type + return EqualUnmodifiableMapView(_statuses); + } + + @override + final WordError error; + @override + final int? lvlNumber; + + @override + String toString() { + return 'GameState.error(dictionary: $dictionary, secretWord: $secretWord, gameMode: $gameMode, gameCompleted: $gameCompleted, board: $board, statuses: $statuses, error: $error, lvlNumber: $lvlNumber)'; + } + + @override + bool operator ==(dynamic other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$GameStateErrorImpl && + (identical(other.dictionary, dictionary) || other.dictionary == dictionary) && + (identical(other.secretWord, secretWord) || other.secretWord == secretWord) && + (identical(other.gameMode, gameMode) || other.gameMode == gameMode) && + (identical(other.gameCompleted, gameCompleted) || other.gameCompleted == gameCompleted) && + const DeepCollectionEquality().equals(other._board, _board) && + const DeepCollectionEquality().equals(other._statuses, _statuses) && + (identical(other.error, error) || other.error == error) && + (identical(other.lvlNumber, lvlNumber) || other.lvlNumber == lvlNumber)); + } + + @override + int get hashCode => Object.hash(runtimeType, dictionary, secretWord, gameMode, gameCompleted, + const DeepCollectionEquality().hash(_board), const DeepCollectionEquality().hash(_statuses), error, lvlNumber); + + @JsonKey(ignore: true) + @override + @pragma('vm:prefer-inline') + _$$GameStateErrorImplCopyWith<_$GameStateErrorImpl> get copyWith => + __$$GameStateErrorImplCopyWithImpl<_$GameStateErrorImpl>(this, _$identity); + + @override + @optionalTypeArgs + TResult map({ + required TResult Function(_GameStateIdle value) idle, + required TResult Function(_GameStateWin value) win, + required TResult Function(_GameStateLoss value) loss, + required TResult Function(_GameStateError value) error, + }) { + return error(this); + } + + @override + @optionalTypeArgs + TResult? mapOrNull({ + TResult? Function(_GameStateIdle value)? idle, + TResult? Function(_GameStateWin value)? win, + TResult? Function(_GameStateLoss value)? loss, + TResult? Function(_GameStateError value)? error, + }) { + return error?.call(this); + } + + @override + @optionalTypeArgs + TResult maybeMap({ + TResult Function(_GameStateIdle value)? idle, + TResult Function(_GameStateWin value)? win, + TResult Function(_GameStateLoss value)? loss, + TResult Function(_GameStateError value)? error, + required TResult orElse(), + }) { + if (error != null) { + return error(this); + } + return orElse(); + } +} + +abstract class _GameStateError extends GameState { + const factory _GameStateError( + {required final Locale dictionary, + required final String secretWord, + required final GameMode gameMode, + required final bool gameCompleted, + required final List board, + required final Map statuses, + required final WordError error, + required final int? lvlNumber}) = _$GameStateErrorImpl; + + const _GameStateError._() : super._(); + + @override + Locale get dictionary; + + @override + String get secretWord; + + @override + GameMode get gameMode; + + @override + bool get gameCompleted; + + @override + List get board; + + @override + Map get statuses; + + WordError get error; + + @override + int? get lvlNumber; + + @override + @JsonKey(ignore: true) + _$$GameStateErrorImplCopyWith<_$GameStateErrorImpl> get copyWith => throw _privateConstructorUsedError; +} diff --git a/lib/src/feature/game/widget/game_page.dart b/lib/src/feature/game/widget/game_page.dart index 31eede57..56c4e9bb 100644 --- a/lib/src/feature/game/widget/game_page.dart +++ b/lib/src/feature/game/widget/game_page.dart @@ -34,7 +34,7 @@ class _GamePageState extends State { state.secretWord, context.dependencies.gameRepository.currentDictionary(state.dictionary)[state.secretWord] ?? '', state.gameMode, - isWin: state.maybeMap(win: (_) => true, orElse: false), + isWin: state.maybeMap(win: (_) => true, orElse: () => false), onTimerEnd: GameMode.daily == state.gameMode ? () => bloc.add(GameEvent.resetBoard(state.gameMode)) : null, nextLevelPressed: () => bloc.add(const GameEvent.resetBoard(GameMode.lvl)), ), @@ -59,7 +59,7 @@ class _GamePageState extends State { state.secretWord, context.dependencies.gameRepository.currentDictionary(state.dictionary)[state.secretWord] ?? '', state.gameMode, - isWin: state.maybeMap(win: (_) => true, orElse: false), + isWin: state.maybeMap(win: (_) => true, orElse: () => false), onTimerEnd: GameMode.daily == state.gameMode ? () { Navigator.of(context).pop(); diff --git a/lib/src/feature/settings/widget/change_color_page.dart b/lib/src/feature/settings/widget/change_color_page.dart index b16a279e..90d463f8 100644 --- a/lib/src/feature/settings/widget/change_color_page.dart +++ b/lib/src/feature/settings/widget/change_color_page.dart @@ -49,10 +49,9 @@ class _ChangeColorPageState extends State { @override Widget build(BuildContext context) { final word = _wordByDictionary(DictionaryScope.of(context).dictionary); - return WillPopScope( - onWillPop: () async { + return PopScope( + onPopInvoked: (_) { Navigator.of(context).pop(ChangeColorResult(colorMode: _currentColorMode, otherColors: _currentOtherColors)); - return false; }, child: Scaffold( appBar: AppBar(title: Text(context.r.colorMode)), diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index b8e2b22f..724bb2ac 100644 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -5,10 +5,8 @@ import FlutterMacOS import Foundation -import path_provider_foundation import shared_preferences_foundation func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { - PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) } diff --git a/pubspec.lock b/pubspec.lock index 09d7f341..cd4c1caf 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,18 +5,18 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: ae92f5d747aee634b87f89d9946000c2de774be1d6ac3e58268224348cd0101a + sha256: eb376e9acf6938204f90eb3b1f00b578640d3188b4c8a8ec054f9f479af8d051 url: "https://pub.dev" source: hosted - version: "61.0.0" + version: "64.0.0" analyzer: - dependency: transitive + dependency: "direct overridden" description: name: analyzer - sha256: ea3d8652bda62982addfd92fdc2d0214e5f82e43325104990d4f4c4a2a313562 + sha256: "69f54f967773f6c26c7dcb13e93d7ccee8b17a641689da39e878d5cf13b06893" url: "https://pub.dev" source: hosted - version: "5.13.0" + version: "6.2.0" archive: dependency: transitive description: @@ -133,10 +133,10 @@ packages: dependency: "direct dev" description: name: carapacik_lints - sha256: "6ffb75dc7fa47f130435e8f7968c3ae2710ff09aa088d3c4530c48163b9ebdef" + sha256: b6916057b3aa120b876413d17a7ba8464ae6852ffe6a55ee7d794c83ba84f074 url: "https://pub.dev" source: hosted - version: "1.5.1" + version: "1.6.0" characters: dependency: transitive description: @@ -181,10 +181,10 @@ packages: dependency: "direct main" description: name: collection - sha256: f092b211a4319e98e5ff58223576de6c2803db36221657b46c82574721240687 + sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a url: "https://pub.dev" source: hosted - version: "1.17.2" + version: "1.18.0" color: dependency: transitive description: @@ -221,10 +221,10 @@ packages: dependency: transitive description: name: dart_style - sha256: "1efa911ca7086affd35f463ca2fc1799584fb6aa89883cf0af8e3664d6a02d55" + sha256: abd7625e16f51f554ea244d090292945ec4d4be7bfbaf2ec8cccea568919d334 url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.3.3" dartx: dependency: transitive description: @@ -352,14 +352,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.2" - google_fonts: - dependency: "direct main" - description: - name: google_fonts - sha256: f0b8d115a13ecf827013ec9fc883390ccc0e87a96ed5347a3114cac177ef18e8 - url: "https://pub.dev" - source: hosted - version: "6.1.0" graphs: dependency: transitive description: @@ -476,10 +468,10 @@ packages: dependency: "direct main" description: name: meta - sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.9.1" + version: "1.10.0" mime: dependency: transitive description: @@ -512,30 +504,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.8.3" - path_provider: - dependency: transitive - description: - name: path_provider - sha256: a1aa8aaa2542a6bc57e381f132af822420216c80d4781f7aa085ca3229208aaa - url: "https://pub.dev" - source: hosted - version: "2.1.1" - path_provider_android: - dependency: transitive - description: - name: path_provider_android - sha256: e595b98692943b4881b219f0a9e3945118d3c16bd7e2813f98ec6e532d905f72 - url: "https://pub.dev" - source: hosted - version: "2.2.1" - path_provider_foundation: - dependency: transitive - description: - name: path_provider_foundation - sha256: "19314d595120f82aca0ba62787d58dde2cc6b5df7d2f0daf72489e38d1b57f2d" - url: "https://pub.dev" - source: hosted - version: "2.3.1" path_provider_linux: dependency: transitive description: @@ -564,10 +532,10 @@ packages: dependency: transitive description: name: petitparser - sha256: cb3798bef7fc021ac45b308f4b51208a152792445cce0448c9a4ba5879dd8750 + sha256: eeb2d1428ee7f4170e2bd498827296a18d4e7fc462b71727d111c0ac7707cfa6 url: "https://pub.dev" source: hosted - version: "5.4.0" + version: "6.0.1" platform: dependency: transitive description: @@ -825,10 +793,10 @@ packages: dependency: transitive description: name: web - sha256: dc8ccd225a2005c1be616fe02951e2e342092edf968cf0844220383757ef8f10 + sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 url: "https://pub.dev" source: hosted - version: "0.1.4-beta" + version: "0.3.0" web_socket_channel: dependency: transitive description: @@ -841,10 +809,10 @@ packages: dependency: transitive description: name: win32 - sha256: "350a11abd2d1d97e0cc7a28a81b781c08002aa2864d9e3f192ca0ffa18b06ed3" + sha256: "7c99c0e1e2fa190b48d25c81ca5e42036d5cac81430ef249027d97b0935c553f" url: "https://pub.dev" source: hosted - version: "5.0.9" + version: "5.1.0" xdg_directories: dependency: transitive description: @@ -857,10 +825,10 @@ packages: dependency: transitive description: name: xml - sha256: "5bc72e1e45e941d825fd7468b9b4cc3b9327942649aeb6fc5cdbf135f0a86e84" + sha256: af5e77e9b83f2f4adc5d3f0a4ece1c7f45a2467b695c2540381bac793e34e556 url: "https://pub.dev" source: hosted - version: "6.3.0" + version: "6.4.2" yaml: dependency: transitive description: @@ -870,5 +838,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.1.0 <4.0.0" - flutter: ">=3.13.0" + dart: ">=3.2.0 <4.0.0" + flutter: ">=3.16.0" diff --git a/pubspec.yaml b/pubspec.yaml index 1644cb1a..cfafa9c0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,8 +3,8 @@ description: Guess the WORD in six tries publish_to: none version: 3.0.0+30 environment: - sdk: '>=3.1.0 <4.0.0' - flutter: '>=3.13.0' + sdk: '>=3.2.0 <4.0.0' + flutter: '>=3.16.0' dependencies: # Flutter SDK @@ -16,7 +16,6 @@ dependencies: # Design flutter_colorpicker: ^1.0.3 - google_fonts: ^6.1.0 # Localization intl: any @@ -45,17 +44,19 @@ dependencies: dev_dependencies: build_runner: ^2.4.6 - carapacik_lints: ^1.5.1 + carapacik_lints: ^1.6.0 flutter_gen_runner: ^5.3.2 flutter_launcher_icons: ^0.13.1 freezed: ^2.4.5 intl_utils: ^2.8.5 +dependency_overrides: + analyzer: ^6.2.0 + flutter: uses-material-design: true assets: - assets/dictionary/ - - google_fonts/ flutter_gen: output: lib/src/core/assets/generated