diff --git a/lib/src/core/localization/generated/intl/messages_en.dart b/lib/src/core/localization/generated/intl/messages_en.dart index 55400d87..d31dbffa 100644 --- a/lib/src/core/localization/generated/intl/messages_en.dart +++ b/lib/src/core/localization/generated/intl/messages_en.dart @@ -46,6 +46,7 @@ class MessageLookup extends MessageLookupByLibrary { MessageLookupByLibrary.simpleMessage("Current\nStreak"), "daily": MessageLookupByLibrary.simpleMessage("Daily"), "en": MessageLookupByLibrary.simpleMessage("English"), + "examples": MessageLookupByLibrary.simpleMessage("Examples"), "guessDistribution": MessageLookupByLibrary.simpleMessage("Guess distribution"), "highContrast": MessageLookupByLibrary.simpleMessage("High contrast"), @@ -53,6 +54,8 @@ class MessageLookup extends MessageLookupByLibrary { "levels": MessageLookupByLibrary.simpleMessage("Levels"), "loseMessage": MessageLookupByLibrary.simpleMessage("You lost"), "maxStreak": MessageLookupByLibrary.simpleMessage("Max\nStreak"), + "newWordAvailableEachDay": MessageLookupByLibrary.simpleMessage( + "A new word will be available each day!"), "nextLevel": MessageLookupByLibrary.simpleMessage("Next level"), "nextWord": MessageLookupByLibrary.simpleMessage("Next word in"), "notPlayed": MessageLookupByLibrary.simpleMessage( @@ -72,6 +75,18 @@ class MessageLookup extends MessageLookupByLibrary { "themeMode": MessageLookupByLibrary.simpleMessage("Theme mode"), "themeSystem": MessageLookupByLibrary.simpleMessage("System"), "tutorial": MessageLookupByLibrary.simpleMessage("How to play"), + "tutorialDescription1": MessageLookupByLibrary.simpleMessage( + "Each guess must be a valid 5 letter word. Hit the enter button to submit."), + "tutorialDescription2": MessageLookupByLibrary.simpleMessage( + "After each guess, the color of the tiles will change to show how close your guess was to the word."), + "tutorialNotInWordSpot": MessageLookupByLibrary.simpleMessage( + "The letter E is not in the word in any spot."), + "tutorialTitle": + MessageLookupByLibrary.simpleMessage("Guess the WORD in 6 tries."), + "tutorialWordCorrectSpot": MessageLookupByLibrary.simpleMessage( + "The letter P is in the word and in the correct spot."), + "tutorialWordWrongSpot": MessageLookupByLibrary.simpleMessage( + "The letter A is in the word but in the wrong spot."), "viewLevels": MessageLookupByLibrary.simpleMessage("View levels"), "viewStatistic": MessageLookupByLibrary.simpleMessage("View statistic"), "winMessage": MessageLookupByLibrary.simpleMessage("You win!"), diff --git a/lib/src/core/localization/generated/intl/messages_ru.dart b/lib/src/core/localization/generated/intl/messages_ru.dart index 84ab305c..9bb2dede 100644 --- a/lib/src/core/localization/generated/intl/messages_ru.dart +++ b/lib/src/core/localization/generated/intl/messages_ru.dart @@ -45,6 +45,7 @@ class MessageLookup extends MessageLookupByLibrary { "currentStreak": MessageLookupByLibrary.simpleMessage("Текущая\nСерия"), "daily": MessageLookupByLibrary.simpleMessage("Ежедневный"), "en": MessageLookupByLibrary.simpleMessage("Английский"), + "examples": MessageLookupByLibrary.simpleMessage("Примеры"), "guessDistribution": MessageLookupByLibrary.simpleMessage("Распределение догадок"), "highContrast": @@ -53,6 +54,8 @@ class MessageLookup extends MessageLookupByLibrary { "levels": MessageLookupByLibrary.simpleMessage("Уровни"), "loseMessage": MessageLookupByLibrary.simpleMessage("Вы проиграли"), "maxStreak": MessageLookupByLibrary.simpleMessage("Макс.\nСерия"), + "newWordAvailableEachDay": MessageLookupByLibrary.simpleMessage( + "Новое слово будет доступно каждый день!"), "nextLevel": MessageLookupByLibrary.simpleMessage("Следующий уровень"), "nextWord": MessageLookupByLibrary.simpleMessage("Следующее слово через"), @@ -73,6 +76,18 @@ class MessageLookup extends MessageLookupByLibrary { "themeMode": MessageLookupByLibrary.simpleMessage("Тема"), "themeSystem": MessageLookupByLibrary.simpleMessage("Системная"), "tutorial": MessageLookupByLibrary.simpleMessage("Как играть"), + "tutorialDescription1": MessageLookupByLibrary.simpleMessage( + "Каждое предположение должно быть словом из 5 букв. Нажмите кнопку ввода, чтобы отправить."), + "tutorialDescription2": MessageLookupByLibrary.simpleMessage( + "После каждого угадывания цвет плиток будет меняться, чтобы показать, насколько близко ваше предположение было к слову."), + "tutorialNotInWordSpot": MessageLookupByLibrary.simpleMessage( + "Буквы А нет в слове ни в одном месте."), + "tutorialTitle": MessageLookupByLibrary.simpleMessage( + "Угадайте СЛОВО за 6 попыток."), + "tutorialWordCorrectSpot": MessageLookupByLibrary.simpleMessage( + "Буква П есть в слове и в нужном месте."), + "tutorialWordWrongSpot": MessageLookupByLibrary.simpleMessage( + "Буква Ш есть в слове, но не в том месте."), "viewLevels": MessageLookupByLibrary.simpleMessage("Посмотреть уровни"), "viewStatistic": MessageLookupByLibrary.simpleMessage("Посмотреть статистику"), diff --git a/lib/src/core/localization/generated/l10n.dart b/lib/src/core/localization/generated/l10n.dart index 51ae3f41..4ca61626 100644 --- a/lib/src/core/localization/generated/l10n.dart +++ b/lib/src/core/localization/generated/l10n.dart @@ -181,6 +181,16 @@ class GeneratedLocalization { ); } + /// `Examples` + String get examples { + return Intl.message( + 'Examples', + name: 'examples', + desc: '', + args: [], + ); + } + /// `Guess distribution` String get guessDistribution { return Intl.message( @@ -241,6 +251,16 @@ class GeneratedLocalization { ); } + /// `A new word will be available each day!` + String get newWordAvailableEachDay { + return Intl.message( + 'A new word will be available each day!', + name: 'newWordAvailableEachDay', + desc: '', + args: [], + ); + } + /// `Next level` String get nextLevel { return Intl.message( @@ -411,6 +431,66 @@ class GeneratedLocalization { ); } + /// `Each guess must be a valid 5 letter word. Hit the enter button to submit.` + String get tutorialDescription1 { + return Intl.message( + 'Each guess must be a valid 5 letter word. Hit the enter button to submit.', + name: 'tutorialDescription1', + desc: '', + args: [], + ); + } + + /// `After each guess, the color of the tiles will change to show how close your guess was to the word.` + String get tutorialDescription2 { + return Intl.message( + 'After each guess, the color of the tiles will change to show how close your guess was to the word.', + name: 'tutorialDescription2', + desc: '', + args: [], + ); + } + + /// `The letter E is not in the word in any spot.` + String get tutorialNotInWordSpot { + return Intl.message( + 'The letter E is not in the word in any spot.', + name: 'tutorialNotInWordSpot', + desc: '', + args: [], + ); + } + + /// `Guess the WORD in 6 tries.` + String get tutorialTitle { + return Intl.message( + 'Guess the WORD in 6 tries.', + name: 'tutorialTitle', + desc: '', + args: [], + ); + } + + /// `The letter P is in the word and in the correct spot.` + String get tutorialWordCorrectSpot { + return Intl.message( + 'The letter P is in the word and in the correct spot.', + name: 'tutorialWordCorrectSpot', + desc: '', + args: [], + ); + } + + /// `The letter A is in the word but in the wrong spot.` + String get tutorialWordWrongSpot { + return Intl.message( + 'The letter A is in the word but in the wrong spot.', + name: 'tutorialWordWrongSpot', + desc: '', + args: [], + ); + } + /// `View levels` String get viewLevels { return Intl.message( diff --git a/lib/src/core/localization/translations/intl_en.arb b/lib/src/core/localization/translations/intl_en.arb index 09239d8f..212c7b2e 100644 --- a/lib/src/core/localization/translations/intl_en.arb +++ b/lib/src/core/localization/translations/intl_en.arb @@ -16,12 +16,14 @@ "currentStreak": "Current\nStreak", "daily": "Daily", "en": "English", + "examples": "Examples", "guessDistribution": "Guess distribution", "highContrast": "High contrast", "levelNumber": "Level {number}", "levels": "Levels", "loseMessage": "You lost", "maxStreak": "Max\nStreak", + "newWordAvailableEachDay": "A new word will be available each day!", "nextLevel": "Next level", "nextWord": "Next word in", "notPlayed": "You haven't played a single game", @@ -39,6 +41,12 @@ "themeMode": "Theme mode", "themeSystem": "System", "tutorial": "How to play", + "tutorialDescription1": "Each guess must be a valid 5 letter word. Hit the enter button to submit.", + "tutorialDescription2": "After each guess, the color of the tiles will change to show how close your guess was to the word.", + "tutorialNotInWordSpot": "The letter E is not in the word in any spot.", + "tutorialTitle": "Guess the WORD in 6 tries.", + "tutorialWordCorrectSpot": "The letter P is in the word and in the correct spot.", + "tutorialWordWrongSpot": "The letter A is in the word but in the wrong spot.", "viewLevels": "View levels", "viewStatistic": "View statistic", "winMessage": "You win!", diff --git a/lib/src/core/localization/translations/intl_ru.arb b/lib/src/core/localization/translations/intl_ru.arb index f1152891..adc3450f 100644 --- a/lib/src/core/localization/translations/intl_ru.arb +++ b/lib/src/core/localization/translations/intl_ru.arb @@ -16,12 +16,14 @@ "currentStreak": "Текущая\nСерия", "daily": "Ежедневный", "en": "Английский", + "examples": "Примеры", "guessDistribution": "Распределение догадок", "highContrast": "Высокий контраст", "levelNumber": "Уровень {number}", "levels": "Уровни", "loseMessage": "Вы проиграли", "maxStreak": "Макс.\nСерия", + "newWordAvailableEachDay": "Новое слово будет доступно каждый день!", "nextLevel": "Следующий уровень", "nextWord": "Следующее слово через", "notPlayed": "Вы не сыграли ни одной игры", @@ -39,6 +41,12 @@ "themeMode": "Тема", "themeSystem": "Системная", "tutorial": "Как играть", + "tutorialDescription1": "Каждое предположение должно быть словом из 5 букв. Нажмите кнопку ввода, чтобы отправить.", + "tutorialDescription2": "После каждого угадывания цвет плиток будет меняться, чтобы показать, насколько близко ваше предположение было к слову.", + "tutorialNotInWordSpot": "Буквы А нет в слове ни в одном месте.", + "tutorialTitle": "Угадайте СЛОВО за 6 попыток.", + "tutorialWordCorrectSpot": "Буква П есть в слове и в нужном месте.", + "tutorialWordWrongSpot": "Буква Ш есть в слове, но не в том месте.", "viewLevels": "Посмотреть уровни", "viewStatistic": "Посмотреть статистику", "winMessage": "Вы победили!", diff --git a/lib/src/feature/game/bloc/game_bloc.freezed.dart b/lib/src/feature/game/bloc/game_bloc.freezed.dart index 72d56a28..3267e3c1 100644 --- a/lib/src/feature/game/bloc/game_bloc.freezed.dart +++ b/lib/src/feature/game/bloc/game_bloc.freezed.dart @@ -18,18 +18,17 @@ final _privateConstructorUsedError = UnsupportedError( mixin _$GameEvent { @optionalTypeArgs TResult map({ - required TResult Function(_GameEventChangeDictionary value) - changeDictionary, + 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(_GameEventDeleteLongPressed value) deleteLongPressed, required TResult Function(_GameEventEnterPressed value) enterPressed, required TResult Function(_GameEventListenKeyEvent value) listenKeyEvent, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? mapOrNull({ TResult? Function(_GameEventChangeDictionary value)? changeDictionary, @@ -59,17 +58,16 @@ mixin _$GameEvent { /// @nodoc abstract class $GameEventCopyWith<$Res> { - factory $GameEventCopyWith(GameEvent value, $Res Function(GameEvent) then) = - _$GameEventCopyWithImpl<$Res, GameEvent>; + factory $GameEventCopyWith(GameEvent value, $Res Function(GameEvent) then) = _$GameEventCopyWithImpl<$Res, GameEvent>; } /// @nodoc -class _$GameEventCopyWithImpl<$Res, $Val extends GameEvent> - implements $GameEventCopyWith<$Res> { +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; } @@ -77,9 +75,9 @@ class _$GameEventCopyWithImpl<$Res, $Val extends GameEvent> /// @nodoc abstract class _$$GameEventChangeDictionaryImplCopyWith<$Res> { factory _$$GameEventChangeDictionaryImplCopyWith( - _$GameEventChangeDictionaryImpl value, - $Res Function(_$GameEventChangeDictionaryImpl) then) = + _$GameEventChangeDictionaryImpl value, $Res Function(_$GameEventChangeDictionaryImpl) then) = __$$GameEventChangeDictionaryImplCopyWithImpl<$Res>; + @useResult $Res call({Locale dictionary}); } @@ -89,8 +87,7 @@ class __$$GameEventChangeDictionaryImplCopyWithImpl<$Res> extends _$GameEventCopyWithImpl<$Res, _$GameEventChangeDictionaryImpl> implements _$$GameEventChangeDictionaryImplCopyWith<$Res> { __$$GameEventChangeDictionaryImplCopyWithImpl( - _$GameEventChangeDictionaryImpl _value, - $Res Function(_$GameEventChangeDictionaryImpl) _then) + _$GameEventChangeDictionaryImpl _value, $Res Function(_$GameEventChangeDictionaryImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -125,8 +122,7 @@ class _$GameEventChangeDictionaryImpl implements _GameEventChangeDictionary { return identical(this, other) || (other.runtimeType == runtimeType && other is _$GameEventChangeDictionaryImpl && - (identical(other.dictionary, dictionary) || - other.dictionary == dictionary)); + (identical(other.dictionary, dictionary) || other.dictionary == dictionary)); } @override @@ -135,21 +131,18 @@ class _$GameEventChangeDictionaryImpl implements _GameEventChangeDictionary { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$GameEventChangeDictionaryImplCopyWith<_$GameEventChangeDictionaryImpl> - get copyWith => __$$GameEventChangeDictionaryImplCopyWithImpl< - _$GameEventChangeDictionaryImpl>(this, _$identity); + _$$GameEventChangeDictionaryImplCopyWith<_$GameEventChangeDictionaryImpl> get copyWith => + __$$GameEventChangeDictionaryImplCopyWithImpl<_$GameEventChangeDictionaryImpl>(this, _$identity); @override @optionalTypeArgs TResult map({ - required TResult Function(_GameEventChangeDictionary value) - changeDictionary, + 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(_GameEventDeleteLongPressed value) deleteLongPressed, required TResult Function(_GameEventEnterPressed value) enterPressed, required TResult Function(_GameEventListenKeyEvent value) listenKeyEvent, }) { @@ -192,21 +185,21 @@ class _$GameEventChangeDictionaryImpl implements _GameEventChangeDictionary { } abstract class _GameEventChangeDictionary implements GameEvent { - const factory _GameEventChangeDictionary(final Locale dictionary) = - _$GameEventChangeDictionaryImpl; + const factory _GameEventChangeDictionary(final Locale dictionary) = _$GameEventChangeDictionaryImpl; Locale get dictionary; + @JsonKey(ignore: true) - _$$GameEventChangeDictionaryImplCopyWith<_$GameEventChangeDictionaryImpl> - get copyWith => throw _privateConstructorUsedError; + _$$GameEventChangeDictionaryImplCopyWith<_$GameEventChangeDictionaryImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class _$$GameEventChangeGameModeImplCopyWith<$Res> { factory _$$GameEventChangeGameModeImplCopyWith( - _$GameEventChangeGameModeImpl value, - $Res Function(_$GameEventChangeGameModeImpl) then) = + _$GameEventChangeGameModeImpl value, $Res Function(_$GameEventChangeGameModeImpl) then) = __$$GameEventChangeGameModeImplCopyWithImpl<$Res>; + @useResult $Res call({GameMode gameMode}); } @@ -216,8 +209,7 @@ class __$$GameEventChangeGameModeImplCopyWithImpl<$Res> extends _$GameEventCopyWithImpl<$Res, _$GameEventChangeGameModeImpl> implements _$$GameEventChangeGameModeImplCopyWith<$Res> { __$$GameEventChangeGameModeImplCopyWithImpl( - _$GameEventChangeGameModeImpl _value, - $Res Function(_$GameEventChangeGameModeImpl) _then) + _$GameEventChangeGameModeImpl _value, $Res Function(_$GameEventChangeGameModeImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -252,8 +244,7 @@ class _$GameEventChangeGameModeImpl implements _GameEventChangeGameMode { return identical(this, other) || (other.runtimeType == runtimeType && other is _$GameEventChangeGameModeImpl && - (identical(other.gameMode, gameMode) || - other.gameMode == gameMode)); + (identical(other.gameMode, gameMode) || other.gameMode == gameMode)); } @override @@ -262,21 +253,18 @@ class _$GameEventChangeGameModeImpl implements _GameEventChangeGameMode { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$GameEventChangeGameModeImplCopyWith<_$GameEventChangeGameModeImpl> - get copyWith => __$$GameEventChangeGameModeImplCopyWithImpl< - _$GameEventChangeGameModeImpl>(this, _$identity); + _$$GameEventChangeGameModeImplCopyWith<_$GameEventChangeGameModeImpl> get copyWith => + __$$GameEventChangeGameModeImplCopyWithImpl<_$GameEventChangeGameModeImpl>(this, _$identity); @override @optionalTypeArgs TResult map({ - required TResult Function(_GameEventChangeDictionary value) - changeDictionary, + 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(_GameEventDeleteLongPressed value) deleteLongPressed, required TResult Function(_GameEventEnterPressed value) enterPressed, required TResult Function(_GameEventListenKeyEvent value) listenKeyEvent, }) { @@ -319,30 +307,30 @@ class _$GameEventChangeGameModeImpl implements _GameEventChangeGameMode { } abstract class _GameEventChangeGameMode implements GameEvent { - const factory _GameEventChangeGameMode(final GameMode gameMode) = - _$GameEventChangeGameModeImpl; + const factory _GameEventChangeGameMode(final GameMode gameMode) = _$GameEventChangeGameModeImpl; GameMode get gameMode; + @JsonKey(ignore: true) - _$$GameEventChangeGameModeImplCopyWith<_$GameEventChangeGameModeImpl> - get copyWith => throw _privateConstructorUsedError; + _$$GameEventChangeGameModeImplCopyWith<_$GameEventChangeGameModeImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class _$$GameEventResetBoardImplCopyWith<$Res> { - factory _$$GameEventResetBoardImplCopyWith(_$GameEventResetBoardImpl value, - $Res Function(_$GameEventResetBoardImpl) then) = + factory _$$GameEventResetBoardImplCopyWith( + _$GameEventResetBoardImpl value, $Res Function(_$GameEventResetBoardImpl) then) = __$$GameEventResetBoardImplCopyWithImpl<$Res>; + @useResult $Res call({GameMode gameMode}); } /// @nodoc -class __$$GameEventResetBoardImplCopyWithImpl<$Res> - extends _$GameEventCopyWithImpl<$Res, _$GameEventResetBoardImpl> +class __$$GameEventResetBoardImplCopyWithImpl<$Res> extends _$GameEventCopyWithImpl<$Res, _$GameEventResetBoardImpl> implements _$$GameEventResetBoardImplCopyWith<$Res> { - __$$GameEventResetBoardImplCopyWithImpl(_$GameEventResetBoardImpl _value, - $Res Function(_$GameEventResetBoardImpl) _then) + __$$GameEventResetBoardImplCopyWithImpl( + _$GameEventResetBoardImpl _value, $Res Function(_$GameEventResetBoardImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -377,8 +365,7 @@ class _$GameEventResetBoardImpl implements _GameEventResetBoard { return identical(this, other) || (other.runtimeType == runtimeType && other is _$GameEventResetBoardImpl && - (identical(other.gameMode, gameMode) || - other.gameMode == gameMode)); + (identical(other.gameMode, gameMode) || other.gameMode == gameMode)); } @override @@ -388,20 +375,17 @@ class _$GameEventResetBoardImpl implements _GameEventResetBoard { @override @pragma('vm:prefer-inline') _$$GameEventResetBoardImplCopyWith<_$GameEventResetBoardImpl> get copyWith => - __$$GameEventResetBoardImplCopyWithImpl<_$GameEventResetBoardImpl>( - this, _$identity); + __$$GameEventResetBoardImplCopyWithImpl<_$GameEventResetBoardImpl>(this, _$identity); @override @optionalTypeArgs TResult map({ - required TResult Function(_GameEventChangeDictionary value) - changeDictionary, + 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(_GameEventDeleteLongPressed value) deleteLongPressed, required TResult Function(_GameEventEnterPressed value) enterPressed, required TResult Function(_GameEventListenKeyEvent value) listenKeyEvent, }) { @@ -444,21 +428,20 @@ class _$GameEventResetBoardImpl implements _GameEventResetBoard { } abstract class _GameEventResetBoard implements GameEvent { - const factory _GameEventResetBoard(final GameMode gameMode) = - _$GameEventResetBoardImpl; + const factory _GameEventResetBoard(final GameMode gameMode) = _$GameEventResetBoardImpl; GameMode get gameMode; + @JsonKey(ignore: true) - _$$GameEventResetBoardImplCopyWith<_$GameEventResetBoardImpl> get copyWith => - throw _privateConstructorUsedError; + _$$GameEventResetBoardImplCopyWith<_$GameEventResetBoardImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class _$$GameEventLetterPressedImplCopyWith<$Res> { factory _$$GameEventLetterPressedImplCopyWith( - _$GameEventLetterPressedImpl value, - $Res Function(_$GameEventLetterPressedImpl) then) = + _$GameEventLetterPressedImpl value, $Res Function(_$GameEventLetterPressedImpl) then) = __$$GameEventLetterPressedImplCopyWithImpl<$Res>; + @useResult $Res call({String key}); } @@ -468,8 +451,7 @@ class __$$GameEventLetterPressedImplCopyWithImpl<$Res> extends _$GameEventCopyWithImpl<$Res, _$GameEventLetterPressedImpl> implements _$$GameEventLetterPressedImplCopyWith<$Res> { __$$GameEventLetterPressedImplCopyWithImpl( - _$GameEventLetterPressedImpl _value, - $Res Function(_$GameEventLetterPressedImpl) _then) + _$GameEventLetterPressedImpl _value, $Res Function(_$GameEventLetterPressedImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -513,21 +495,18 @@ class _$GameEventLetterPressedImpl implements _GameEventLetterPressed { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$GameEventLetterPressedImplCopyWith<_$GameEventLetterPressedImpl> - get copyWith => __$$GameEventLetterPressedImplCopyWithImpl< - _$GameEventLetterPressedImpl>(this, _$identity); + _$$GameEventLetterPressedImplCopyWith<_$GameEventLetterPressedImpl> get copyWith => + __$$GameEventLetterPressedImplCopyWithImpl<_$GameEventLetterPressedImpl>(this, _$identity); @override @optionalTypeArgs TResult map({ - required TResult Function(_GameEventChangeDictionary value) - changeDictionary, + 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(_GameEventDeleteLongPressed value) deleteLongPressed, required TResult Function(_GameEventEnterPressed value) enterPressed, required TResult Function(_GameEventListenKeyEvent value) listenKeyEvent, }) { @@ -570,20 +549,19 @@ class _$GameEventLetterPressedImpl implements _GameEventLetterPressed { } abstract class _GameEventLetterPressed implements GameEvent { - const factory _GameEventLetterPressed(final String key) = - _$GameEventLetterPressedImpl; + const factory _GameEventLetterPressed(final String key) = _$GameEventLetterPressedImpl; String get key; + @JsonKey(ignore: true) - _$$GameEventLetterPressedImplCopyWith<_$GameEventLetterPressedImpl> - get copyWith => throw _privateConstructorUsedError; + _$$GameEventLetterPressedImplCopyWith<_$GameEventLetterPressedImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class _$$GameEventDeletePressedImplCopyWith<$Res> { factory _$$GameEventDeletePressedImplCopyWith( - _$GameEventDeletePressedImpl value, - $Res Function(_$GameEventDeletePressedImpl) then) = + _$GameEventDeletePressedImpl value, $Res Function(_$GameEventDeletePressedImpl) then) = __$$GameEventDeletePressedImplCopyWithImpl<$Res>; } @@ -592,8 +570,7 @@ class __$$GameEventDeletePressedImplCopyWithImpl<$Res> extends _$GameEventCopyWithImpl<$Res, _$GameEventDeletePressedImpl> implements _$$GameEventDeletePressedImplCopyWith<$Res> { __$$GameEventDeletePressedImplCopyWithImpl( - _$GameEventDeletePressedImpl _value, - $Res Function(_$GameEventDeletePressedImpl) _then) + _$GameEventDeletePressedImpl _value, $Res Function(_$GameEventDeletePressedImpl) _then) : super(_value, _then); } @@ -609,9 +586,7 @@ class _$GameEventDeletePressedImpl implements _GameEventDeletePressed { @override bool operator ==(dynamic other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$GameEventDeletePressedImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$GameEventDeletePressedImpl); } @override @@ -620,14 +595,12 @@ class _$GameEventDeletePressedImpl implements _GameEventDeletePressed { @override @optionalTypeArgs TResult map({ - required TResult Function(_GameEventChangeDictionary value) - changeDictionary, + 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(_GameEventDeleteLongPressed value) deleteLongPressed, required TResult Function(_GameEventEnterPressed value) enterPressed, required TResult Function(_GameEventListenKeyEvent value) listenKeyEvent, }) { @@ -676,8 +649,7 @@ abstract class _GameEventDeletePressed implements GameEvent { /// @nodoc abstract class _$$GameEventDeleteLongPressedImplCopyWith<$Res> { factory _$$GameEventDeleteLongPressedImplCopyWith( - _$GameEventDeleteLongPressedImpl value, - $Res Function(_$GameEventDeleteLongPressedImpl) then) = + _$GameEventDeleteLongPressedImpl value, $Res Function(_$GameEventDeleteLongPressedImpl) then) = __$$GameEventDeleteLongPressedImplCopyWithImpl<$Res>; } @@ -686,8 +658,7 @@ class __$$GameEventDeleteLongPressedImplCopyWithImpl<$Res> extends _$GameEventCopyWithImpl<$Res, _$GameEventDeleteLongPressedImpl> implements _$$GameEventDeleteLongPressedImplCopyWith<$Res> { __$$GameEventDeleteLongPressedImplCopyWithImpl( - _$GameEventDeleteLongPressedImpl _value, - $Res Function(_$GameEventDeleteLongPressedImpl) _then) + _$GameEventDeleteLongPressedImpl _value, $Res Function(_$GameEventDeleteLongPressedImpl) _then) : super(_value, _then); } @@ -703,9 +674,7 @@ class _$GameEventDeleteLongPressedImpl implements _GameEventDeleteLongPressed { @override bool operator ==(dynamic other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$GameEventDeleteLongPressedImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$GameEventDeleteLongPressedImpl); } @override @@ -714,14 +683,12 @@ class _$GameEventDeleteLongPressedImpl implements _GameEventDeleteLongPressed { @override @optionalTypeArgs TResult map({ - required TResult Function(_GameEventChangeDictionary value) - changeDictionary, + 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(_GameEventDeleteLongPressed value) deleteLongPressed, required TResult Function(_GameEventEnterPressed value) enterPressed, required TResult Function(_GameEventListenKeyEvent value) listenKeyEvent, }) { @@ -764,24 +731,21 @@ class _$GameEventDeleteLongPressedImpl implements _GameEventDeleteLongPressed { } abstract class _GameEventDeleteLongPressed implements GameEvent { - const factory _GameEventDeleteLongPressed() = - _$GameEventDeleteLongPressedImpl; + const factory _GameEventDeleteLongPressed() = _$GameEventDeleteLongPressedImpl; } /// @nodoc abstract class _$$GameEventEnterPressedImplCopyWith<$Res> { factory _$$GameEventEnterPressedImplCopyWith( - _$GameEventEnterPressedImpl value, - $Res Function(_$GameEventEnterPressedImpl) then) = + _$GameEventEnterPressedImpl value, $Res Function(_$GameEventEnterPressedImpl) then) = __$$GameEventEnterPressedImplCopyWithImpl<$Res>; } /// @nodoc -class __$$GameEventEnterPressedImplCopyWithImpl<$Res> - extends _$GameEventCopyWithImpl<$Res, _$GameEventEnterPressedImpl> +class __$$GameEventEnterPressedImplCopyWithImpl<$Res> extends _$GameEventCopyWithImpl<$Res, _$GameEventEnterPressedImpl> implements _$$GameEventEnterPressedImplCopyWith<$Res> { - __$$GameEventEnterPressedImplCopyWithImpl(_$GameEventEnterPressedImpl _value, - $Res Function(_$GameEventEnterPressedImpl) _then) + __$$GameEventEnterPressedImplCopyWithImpl( + _$GameEventEnterPressedImpl _value, $Res Function(_$GameEventEnterPressedImpl) _then) : super(_value, _then); } @@ -797,9 +761,7 @@ class _$GameEventEnterPressedImpl implements _GameEventEnterPressed { @override bool operator ==(dynamic other) { - return identical(this, other) || - (other.runtimeType == runtimeType && - other is _$GameEventEnterPressedImpl); + return identical(this, other) || (other.runtimeType == runtimeType && other is _$GameEventEnterPressedImpl); } @override @@ -808,14 +770,12 @@ class _$GameEventEnterPressedImpl implements _GameEventEnterPressed { @override @optionalTypeArgs TResult map({ - required TResult Function(_GameEventChangeDictionary value) - changeDictionary, + 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(_GameEventDeleteLongPressed value) deleteLongPressed, required TResult Function(_GameEventEnterPressed value) enterPressed, required TResult Function(_GameEventListenKeyEvent value) listenKeyEvent, }) { @@ -864,9 +824,9 @@ abstract class _GameEventEnterPressed implements GameEvent { /// @nodoc abstract class _$$GameEventListenKeyEventImplCopyWith<$Res> { factory _$$GameEventListenKeyEventImplCopyWith( - _$GameEventListenKeyEventImpl value, - $Res Function(_$GameEventListenKeyEventImpl) then) = + _$GameEventListenKeyEventImpl value, $Res Function(_$GameEventListenKeyEventImpl) then) = __$$GameEventListenKeyEventImplCopyWithImpl<$Res>; + @useResult $Res call({KeyEvent keyEvent}); } @@ -876,8 +836,7 @@ class __$$GameEventListenKeyEventImplCopyWithImpl<$Res> extends _$GameEventCopyWithImpl<$Res, _$GameEventListenKeyEventImpl> implements _$$GameEventListenKeyEventImplCopyWith<$Res> { __$$GameEventListenKeyEventImplCopyWithImpl( - _$GameEventListenKeyEventImpl _value, - $Res Function(_$GameEventListenKeyEventImpl) _then) + _$GameEventListenKeyEventImpl _value, $Res Function(_$GameEventListenKeyEventImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -912,8 +871,7 @@ class _$GameEventListenKeyEventImpl implements _GameEventListenKeyEvent { return identical(this, other) || (other.runtimeType == runtimeType && other is _$GameEventListenKeyEventImpl && - (identical(other.keyEvent, keyEvent) || - other.keyEvent == keyEvent)); + (identical(other.keyEvent, keyEvent) || other.keyEvent == keyEvent)); } @override @@ -922,21 +880,18 @@ class _$GameEventListenKeyEventImpl implements _GameEventListenKeyEvent { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$GameEventListenKeyEventImplCopyWith<_$GameEventListenKeyEventImpl> - get copyWith => __$$GameEventListenKeyEventImplCopyWithImpl< - _$GameEventListenKeyEventImpl>(this, _$identity); + _$$GameEventListenKeyEventImplCopyWith<_$GameEventListenKeyEventImpl> get copyWith => + __$$GameEventListenKeyEventImplCopyWithImpl<_$GameEventListenKeyEventImpl>(this, _$identity); @override @optionalTypeArgs TResult map({ - required TResult Function(_GameEventChangeDictionary value) - changeDictionary, + 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(_GameEventDeleteLongPressed value) deleteLongPressed, required TResult Function(_GameEventEnterPressed value) enterPressed, required TResult Function(_GameEventListenKeyEvent value) listenKeyEvent, }) { @@ -979,23 +934,29 @@ class _$GameEventListenKeyEventImpl implements _GameEventListenKeyEvent { } abstract class _GameEventListenKeyEvent implements GameEvent { - const factory _GameEventListenKeyEvent(final KeyEvent keyEvent) = - _$GameEventListenKeyEventImpl; + const factory _GameEventListenKeyEvent(final KeyEvent keyEvent) = _$GameEventListenKeyEventImpl; KeyEvent get keyEvent; + @JsonKey(ignore: true) - _$$GameEventListenKeyEventImplCopyWith<_$GameEventListenKeyEventImpl> - get copyWith => throw _privateConstructorUsedError; + _$$GameEventListenKeyEventImplCopyWith<_$GameEventListenKeyEventImpl> get copyWith => + throw _privateConstructorUsedError; } /// @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 @@ -1006,6 +967,7 @@ mixin _$GameState { required TResult Function(_GameStateError value) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? mapOrNull({ TResult? Function(_GameStateIdle value)? idle, @@ -1025,14 +987,13 @@ mixin _$GameState { throw _privateConstructorUsedError; @JsonKey(ignore: true) - $GameStateCopyWith get copyWith => - throw _privateConstructorUsedError; + $GameStateCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $GameStateCopyWith<$Res> { - factory $GameStateCopyWith(GameState value, $Res Function(GameState) then) = - _$GameStateCopyWithImpl<$Res, GameState>; + factory $GameStateCopyWith(GameState value, $Res Function(GameState) then) = _$GameStateCopyWithImpl<$Res, GameState>; + @useResult $Res call( {Locale dictionary, @@ -1045,12 +1006,12 @@ abstract class $GameStateCopyWith<$Res> { } /// @nodoc -class _$GameStateCopyWithImpl<$Res, $Val extends GameState> - implements $GameStateCopyWith<$Res> { +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; @@ -1099,11 +1060,10 @@ class _$GameStateCopyWithImpl<$Res, $Val extends GameState> } /// @nodoc -abstract class _$$GameStateIdleImplCopyWith<$Res> - implements $GameStateCopyWith<$Res> { - factory _$$GameStateIdleImplCopyWith( - _$GameStateIdleImpl value, $Res Function(_$GameStateIdleImpl) then) = +abstract class _$$GameStateIdleImplCopyWith<$Res> implements $GameStateCopyWith<$Res> { + factory _$$GameStateIdleImplCopyWith(_$GameStateIdleImpl value, $Res Function(_$GameStateIdleImpl) then) = __$$GameStateIdleImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -1117,11 +1077,9 @@ abstract class _$$GameStateIdleImplCopyWith<$Res> } /// @nodoc -class __$$GameStateIdleImplCopyWithImpl<$Res> - extends _$GameStateCopyWithImpl<$Res, _$GameStateIdleImpl> +class __$$GameStateIdleImplCopyWithImpl<$Res> extends _$GameStateCopyWithImpl<$Res, _$GameStateIdleImpl> implements _$$GameStateIdleImplCopyWith<$Res> { - __$$GameStateIdleImplCopyWithImpl( - _$GameStateIdleImpl _value, $Res Function(_$GameStateIdleImpl) _then) + __$$GameStateIdleImplCopyWithImpl(_$GameStateIdleImpl _value, $Res Function(_$GameStateIdleImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -1192,6 +1150,7 @@ class _$GameStateIdleImpl extends _GameStateIdle { @override final bool gameCompleted; final List _board; + @override List get board { if (_board is EqualUnmodifiableListView) return _board; @@ -1200,6 +1159,7 @@ class _$GameStateIdleImpl extends _GameStateIdle { } final Map _statuses; + @override Map get statuses { if (_statuses is EqualUnmodifiableMapView) return _statuses; @@ -1220,30 +1180,18 @@ class _$GameStateIdleImpl extends _GameStateIdle { 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) && + (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)); + (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); + int get hashCode => Object.hash(runtimeType, dictionary, secretWord, gameMode, gameCompleted, + const DeepCollectionEquality().hash(_board), const DeepCollectionEquality().hash(_statuses), lvlNumber); @JsonKey(ignore: true) @override @@ -1298,34 +1246,40 @@ abstract class _GameStateIdle extends GameState { 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; + _$$GameStateIdleImplCopyWith<_$GameStateIdleImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$GameStateWinImplCopyWith<$Res> - implements $GameStateCopyWith<$Res> { - factory _$$GameStateWinImplCopyWith( - _$GameStateWinImpl value, $Res Function(_$GameStateWinImpl) then) = +abstract class _$$GameStateWinImplCopyWith<$Res> implements $GameStateCopyWith<$Res> { + factory _$$GameStateWinImplCopyWith(_$GameStateWinImpl value, $Res Function(_$GameStateWinImpl) then) = __$$GameStateWinImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -1339,11 +1293,9 @@ abstract class _$$GameStateWinImplCopyWith<$Res> } /// @nodoc -class __$$GameStateWinImplCopyWithImpl<$Res> - extends _$GameStateCopyWithImpl<$Res, _$GameStateWinImpl> +class __$$GameStateWinImplCopyWithImpl<$Res> extends _$GameStateCopyWithImpl<$Res, _$GameStateWinImpl> implements _$$GameStateWinImplCopyWith<$Res> { - __$$GameStateWinImplCopyWithImpl( - _$GameStateWinImpl _value, $Res Function(_$GameStateWinImpl) _then) + __$$GameStateWinImplCopyWithImpl(_$GameStateWinImpl _value, $Res Function(_$GameStateWinImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -1414,6 +1366,7 @@ class _$GameStateWinImpl extends _GameStateWin { @override final bool gameCompleted; final List _board; + @override List get board { if (_board is EqualUnmodifiableListView) return _board; @@ -1422,6 +1375,7 @@ class _$GameStateWinImpl extends _GameStateWin { } final Map _statuses; + @override Map get statuses { if (_statuses is EqualUnmodifiableMapView) return _statuses; @@ -1442,30 +1396,18 @@ class _$GameStateWinImpl extends _GameStateWin { 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) && + (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)); + (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); + int get hashCode => Object.hash(runtimeType, dictionary, secretWord, gameMode, gameCompleted, + const DeepCollectionEquality().hash(_board), const DeepCollectionEquality().hash(_statuses), lvlNumber); @JsonKey(ignore: true) @override @@ -1520,34 +1462,40 @@ abstract class _GameStateWin extends GameState { 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; + _$$GameStateWinImplCopyWith<_$GameStateWinImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$GameStateLossImplCopyWith<$Res> - implements $GameStateCopyWith<$Res> { - factory _$$GameStateLossImplCopyWith( - _$GameStateLossImpl value, $Res Function(_$GameStateLossImpl) then) = +abstract class _$$GameStateLossImplCopyWith<$Res> implements $GameStateCopyWith<$Res> { + factory _$$GameStateLossImplCopyWith(_$GameStateLossImpl value, $Res Function(_$GameStateLossImpl) then) = __$$GameStateLossImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -1561,11 +1509,9 @@ abstract class _$$GameStateLossImplCopyWith<$Res> } /// @nodoc -class __$$GameStateLossImplCopyWithImpl<$Res> - extends _$GameStateCopyWithImpl<$Res, _$GameStateLossImpl> +class __$$GameStateLossImplCopyWithImpl<$Res> extends _$GameStateCopyWithImpl<$Res, _$GameStateLossImpl> implements _$$GameStateLossImplCopyWith<$Res> { - __$$GameStateLossImplCopyWithImpl( - _$GameStateLossImpl _value, $Res Function(_$GameStateLossImpl) _then) + __$$GameStateLossImplCopyWithImpl(_$GameStateLossImpl _value, $Res Function(_$GameStateLossImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -1636,6 +1582,7 @@ class _$GameStateLossImpl extends _GameStateLoss { @override final bool gameCompleted; final List _board; + @override List get board { if (_board is EqualUnmodifiableListView) return _board; @@ -1644,6 +1591,7 @@ class _$GameStateLossImpl extends _GameStateLoss { } final Map _statuses; + @override Map get statuses { if (_statuses is EqualUnmodifiableMapView) return _statuses; @@ -1664,30 +1612,18 @@ class _$GameStateLossImpl extends _GameStateLoss { 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) && + (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)); + (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); + int get hashCode => Object.hash(runtimeType, dictionary, secretWord, gameMode, gameCompleted, + const DeepCollectionEquality().hash(_board), const DeepCollectionEquality().hash(_statuses), lvlNumber); @JsonKey(ignore: true) @override @@ -1742,34 +1678,40 @@ abstract class _GameStateLoss extends GameState { 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; + _$$GameStateLossImplCopyWith<_$GameStateLossImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$GameStateErrorImplCopyWith<$Res> - implements $GameStateCopyWith<$Res> { - factory _$$GameStateErrorImplCopyWith(_$GameStateErrorImpl value, - $Res Function(_$GameStateErrorImpl) then) = +abstract class _$$GameStateErrorImplCopyWith<$Res> implements $GameStateCopyWith<$Res> { + factory _$$GameStateErrorImplCopyWith(_$GameStateErrorImpl value, $Res Function(_$GameStateErrorImpl) then) = __$$GameStateErrorImplCopyWithImpl<$Res>; + @override @useResult $Res call( @@ -1784,11 +1726,9 @@ abstract class _$$GameStateErrorImplCopyWith<$Res> } /// @nodoc -class __$$GameStateErrorImplCopyWithImpl<$Res> - extends _$GameStateCopyWithImpl<$Res, _$GameStateErrorImpl> +class __$$GameStateErrorImplCopyWithImpl<$Res> extends _$GameStateCopyWithImpl<$Res, _$GameStateErrorImpl> implements _$$GameStateErrorImplCopyWith<$Res> { - __$$GameStateErrorImplCopyWithImpl( - _$GameStateErrorImpl _value, $Res Function(_$GameStateErrorImpl) _then) + __$$GameStateErrorImplCopyWithImpl(_$GameStateErrorImpl _value, $Res Function(_$GameStateErrorImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -1865,6 +1805,7 @@ class _$GameStateErrorImpl extends _GameStateError { @override final bool gameCompleted; final List _board; + @override List get board { if (_board is EqualUnmodifiableListView) return _board; @@ -1873,6 +1814,7 @@ class _$GameStateErrorImpl extends _GameStateError { } final Map _statuses; + @override Map get statuses { if (_statuses is EqualUnmodifiableMapView) return _statuses; @@ -1895,39 +1837,25 @@ class _$GameStateErrorImpl extends _GameStateError { 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) && + (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)); + (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); + 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); + __$$GameStateErrorImplCopyWithImpl<_$GameStateErrorImpl>(this, _$identity); @override @optionalTypeArgs @@ -1977,25 +1905,33 @@ abstract class _GameStateError extends GameState { 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; + _$$GameStateErrorImplCopyWith<_$GameStateErrorImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/src/feature/game/widget/keyboard_by_language.dart b/lib/src/feature/game/widget/keyboard_by_language.dart index b9d7cfd2..ceb52d30 100644 --- a/lib/src/feature/game/widget/keyboard_by_language.dart +++ b/lib/src/feature/game/widget/keyboard_by_language.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:wordly/src/core/assets/generated/assets.gen.dart'; import 'package:wordly/src/core/assets/generated/fonts.gen.dart'; import 'package:wordly/src/feature/game/bloc/game_bloc.dart'; import 'package:wordly/src/feature/game/model/keyboard.dart'; diff --git a/lib/src/feature/level/data/level_datasource.dart b/lib/src/feature/level/data/level_datasource.dart index 6fc78dae..48d5f4fe 100644 --- a/lib/src/feature/level/data/level_datasource.dart +++ b/lib/src/feature/level/data/level_datasource.dart @@ -1,6 +1,8 @@ import 'dart:async'; -import 'dart:convert'; +import 'dart:convert' show json; +import 'dart:ui' show Locale; +import 'package:collection/collection.dart'; import 'package:shared_preferences/shared_preferences.dart'; import 'package:wordly/src/feature/game/model/game_result.dart'; @@ -29,15 +31,14 @@ final class LevelDataSourceImpl implements LevelDataSource { final SharedPreferences _sharedPreferences; static const _prefix = 'level'; + static const _migrationVersionPrefix = 'level_migration_version'; @override List? loadLevelFromCache(String dictionaryKey) { final levels = _sharedPreferences.getStringList('${_prefix}_$dictionaryKey'); - if (levels == null) { return null; } - // for old version try { return levels.map((l) => GameResult.fromJson(json.decode(l) as Map)).toList(); } on Object catch (_) { @@ -54,5 +55,41 @@ final class LevelDataSourceImpl implements LevelDataSource { } @override - Future runMigration() async {} + Future runMigration() async { + final migrationVersion = _sharedPreferences.getInt(_migrationVersionPrefix); + if (migrationVersion == null || migrationVersion < 1) { + return; + } + const dictionaries = [ + Locale('en'), + Locale('ru'), + ]; + for (final dictionary in dictionaries) { + try { + final key = '${_prefix}_${dictionary.languageCode}'; + final levels = _sharedPreferences.getStringList(key); + if (levels == null || levels.isEmpty) { + continue; + } + // detect old api + final decodedFirst = json.decode(levels.first) as Map; + if (!decodedFirst.containsKey('word') || !decodedFirst.containsKey('isWin')) { + continue; + } + await _sharedPreferences.setStringList(key, []); + final newLevels = levels.mapIndexed((index, e) { + final decoded = json.decode(e) as Map; + return GameResult( + secretWord: decoded['word'].toString(), + isWin: decoded['isWin'] as bool?, + lvlNumber: index + 1, + ); + }); + await _sharedPreferences.setStringList(key, newLevels.map((e) => json.encode(e.toJson())).toList()); + } on Object { + // for new api + } + } + await _sharedPreferences.setInt(_migrationVersionPrefix, 1); + } } diff --git a/lib/src/feature/settings/bloc/settings_bloc.freezed.dart b/lib/src/feature/settings/bloc/settings_bloc.freezed.dart index 663b160c..a1eadf5f 100644 --- a/lib/src/feature/settings/bloc/settings_bloc.freezed.dart +++ b/lib/src/feature/settings/bloc/settings_bloc.freezed.dart @@ -32,6 +32,7 @@ mixin _$SettingsState { required TResult Function(_ErrorSettingsState value) error, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? mapOrNull({ TResult? Function(_IdleSettingsState value)? idle, @@ -49,26 +50,25 @@ mixin _$SettingsState { throw _privateConstructorUsedError; @JsonKey(ignore: true) - $SettingsStateCopyWith get copyWith => - throw _privateConstructorUsedError; + $SettingsStateCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc abstract class $SettingsStateCopyWith<$Res> { - factory $SettingsStateCopyWith( - SettingsState value, $Res Function(SettingsState) then) = + factory $SettingsStateCopyWith(SettingsState value, $Res Function(SettingsState) then) = _$SettingsStateCopyWithImpl<$Res, SettingsState>; + @useResult $Res call({Locale locale, Locale dictionary, AppTheme appTheme}); } /// @nodoc -class _$SettingsStateCopyWithImpl<$Res, $Val extends SettingsState> - implements $SettingsStateCopyWith<$Res> { +class _$SettingsStateCopyWithImpl<$Res, $Val extends SettingsState> implements $SettingsStateCopyWith<$Res> { _$SettingsStateCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; @@ -97,22 +97,19 @@ class _$SettingsStateCopyWithImpl<$Res, $Val extends SettingsState> } /// @nodoc -abstract class _$$IdleSettingsStateImplCopyWith<$Res> - implements $SettingsStateCopyWith<$Res> { - factory _$$IdleSettingsStateImplCopyWith(_$IdleSettingsStateImpl value, - $Res Function(_$IdleSettingsStateImpl) then) = +abstract class _$$IdleSettingsStateImplCopyWith<$Res> implements $SettingsStateCopyWith<$Res> { + factory _$$IdleSettingsStateImplCopyWith(_$IdleSettingsStateImpl value, $Res Function(_$IdleSettingsStateImpl) then) = __$$IdleSettingsStateImplCopyWithImpl<$Res>; + @override @useResult $Res call({Locale locale, Locale dictionary, AppTheme appTheme}); } /// @nodoc -class __$$IdleSettingsStateImplCopyWithImpl<$Res> - extends _$SettingsStateCopyWithImpl<$Res, _$IdleSettingsStateImpl> +class __$$IdleSettingsStateImplCopyWithImpl<$Res> extends _$SettingsStateCopyWithImpl<$Res, _$IdleSettingsStateImpl> implements _$$IdleSettingsStateImplCopyWith<$Res> { - __$$IdleSettingsStateImplCopyWithImpl(_$IdleSettingsStateImpl _value, - $Res Function(_$IdleSettingsStateImpl) _then) + __$$IdleSettingsStateImplCopyWithImpl(_$IdleSettingsStateImpl _value, $Res Function(_$IdleSettingsStateImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -142,9 +139,7 @@ class __$$IdleSettingsStateImplCopyWithImpl<$Res> /// @nodoc class _$IdleSettingsStateImpl extends _IdleSettingsState { - const _$IdleSettingsStateImpl( - {required this.locale, required this.dictionary, required this.appTheme}) - : super._(); + const _$IdleSettingsStateImpl({required this.locale, required this.dictionary, required this.appTheme}) : super._(); /// The current locale. @override @@ -169,10 +164,8 @@ class _$IdleSettingsStateImpl extends _IdleSettingsState { (other.runtimeType == runtimeType && other is _$IdleSettingsStateImpl && (identical(other.locale, locale) || other.locale == locale) && - (identical(other.dictionary, dictionary) || - other.dictionary == dictionary) && - (identical(other.appTheme, appTheme) || - other.appTheme == appTheme)); + (identical(other.dictionary, dictionary) || other.dictionary == dictionary) && + (identical(other.appTheme, appTheme) || other.appTheme == appTheme)); } @override @@ -182,8 +175,7 @@ class _$IdleSettingsStateImpl extends _IdleSettingsState { @override @pragma('vm:prefer-inline') _$$IdleSettingsStateImplCopyWith<_$IdleSettingsStateImpl> get copyWith => - __$$IdleSettingsStateImplCopyWithImpl<_$IdleSettingsStateImpl>( - this, _$identity); + __$$IdleSettingsStateImplCopyWithImpl<_$IdleSettingsStateImpl>(this, _$identity); @override @optionalTypeArgs @@ -225,33 +217,35 @@ abstract class _IdleSettingsState extends SettingsState { {required final Locale locale, required final Locale dictionary, required final AppTheme appTheme}) = _$IdleSettingsStateImpl; + const _IdleSettingsState._() : super._(); @override /// The current locale. Locale get locale; + @override /// The current dictionary. Locale get dictionary; + @override /// The current theme mode. AppTheme get appTheme; + @override @JsonKey(ignore: true) - _$$IdleSettingsStateImplCopyWith<_$IdleSettingsStateImpl> get copyWith => - throw _privateConstructorUsedError; + _$$IdleSettingsStateImplCopyWith<_$IdleSettingsStateImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$ProcessingSettingsStateImplCopyWith<$Res> - implements $SettingsStateCopyWith<$Res> { +abstract class _$$ProcessingSettingsStateImplCopyWith<$Res> implements $SettingsStateCopyWith<$Res> { factory _$$ProcessingSettingsStateImplCopyWith( - _$ProcessingSettingsStateImpl value, - $Res Function(_$ProcessingSettingsStateImpl) then) = + _$ProcessingSettingsStateImpl value, $Res Function(_$ProcessingSettingsStateImpl) then) = __$$ProcessingSettingsStateImplCopyWithImpl<$Res>; + @override @useResult $Res call({Locale locale, Locale dictionary, AppTheme appTheme}); @@ -262,8 +256,7 @@ class __$$ProcessingSettingsStateImplCopyWithImpl<$Res> extends _$SettingsStateCopyWithImpl<$Res, _$ProcessingSettingsStateImpl> implements _$$ProcessingSettingsStateImplCopyWith<$Res> { __$$ProcessingSettingsStateImplCopyWithImpl( - _$ProcessingSettingsStateImpl _value, - $Res Function(_$ProcessingSettingsStateImpl) _then) + _$ProcessingSettingsStateImpl _value, $Res Function(_$ProcessingSettingsStateImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -293,8 +286,7 @@ class __$$ProcessingSettingsStateImplCopyWithImpl<$Res> /// @nodoc class _$ProcessingSettingsStateImpl extends _ProcessingSettingsState { - const _$ProcessingSettingsStateImpl( - {required this.locale, required this.dictionary, required this.appTheme}) + const _$ProcessingSettingsStateImpl({required this.locale, required this.dictionary, required this.appTheme}) : super._(); /// The current locale. @@ -320,10 +312,8 @@ class _$ProcessingSettingsStateImpl extends _ProcessingSettingsState { (other.runtimeType == runtimeType && other is _$ProcessingSettingsStateImpl && (identical(other.locale, locale) || other.locale == locale) && - (identical(other.dictionary, dictionary) || - other.dictionary == dictionary) && - (identical(other.appTheme, appTheme) || - other.appTheme == appTheme)); + (identical(other.dictionary, dictionary) || other.dictionary == dictionary) && + (identical(other.appTheme, appTheme) || other.appTheme == appTheme)); } @override @@ -332,9 +322,8 @@ class _$ProcessingSettingsStateImpl extends _ProcessingSettingsState { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$ProcessingSettingsStateImplCopyWith<_$ProcessingSettingsStateImpl> - get copyWith => __$$ProcessingSettingsStateImplCopyWithImpl< - _$ProcessingSettingsStateImpl>(this, _$identity); + _$$ProcessingSettingsStateImplCopyWith<_$ProcessingSettingsStateImpl> get copyWith => + __$$ProcessingSettingsStateImplCopyWithImpl<_$ProcessingSettingsStateImpl>(this, _$identity); @override @optionalTypeArgs @@ -376,44 +365,45 @@ abstract class _ProcessingSettingsState extends SettingsState { {required final Locale locale, required final Locale dictionary, required final AppTheme appTheme}) = _$ProcessingSettingsStateImpl; + const _ProcessingSettingsState._() : super._(); @override /// The current locale. Locale get locale; + @override /// The current dictionary. Locale get dictionary; + @override /// The current theme mode. AppTheme get appTheme; + @override @JsonKey(ignore: true) - _$$ProcessingSettingsStateImplCopyWith<_$ProcessingSettingsStateImpl> - get copyWith => throw _privateConstructorUsedError; + _$$ProcessingSettingsStateImplCopyWith<_$ProcessingSettingsStateImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc -abstract class _$$ErrorSettingsStateImplCopyWith<$Res> - implements $SettingsStateCopyWith<$Res> { - factory _$$ErrorSettingsStateImplCopyWith(_$ErrorSettingsStateImpl value, - $Res Function(_$ErrorSettingsStateImpl) then) = +abstract class _$$ErrorSettingsStateImplCopyWith<$Res> implements $SettingsStateCopyWith<$Res> { + factory _$$ErrorSettingsStateImplCopyWith( + _$ErrorSettingsStateImpl value, $Res Function(_$ErrorSettingsStateImpl) then) = __$$ErrorSettingsStateImplCopyWithImpl<$Res>; + @override @useResult - $Res call( - {Locale locale, Locale dictionary, AppTheme appTheme, String message}); + $Res call({Locale locale, Locale dictionary, AppTheme appTheme, String message}); } /// @nodoc -class __$$ErrorSettingsStateImplCopyWithImpl<$Res> - extends _$SettingsStateCopyWithImpl<$Res, _$ErrorSettingsStateImpl> +class __$$ErrorSettingsStateImplCopyWithImpl<$Res> extends _$SettingsStateCopyWithImpl<$Res, _$ErrorSettingsStateImpl> implements _$$ErrorSettingsStateImplCopyWith<$Res> { - __$$ErrorSettingsStateImplCopyWithImpl(_$ErrorSettingsStateImpl _value, - $Res Function(_$ErrorSettingsStateImpl) _then) + __$$ErrorSettingsStateImplCopyWithImpl(_$ErrorSettingsStateImpl _value, $Res Function(_$ErrorSettingsStateImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -449,10 +439,7 @@ class __$$ErrorSettingsStateImplCopyWithImpl<$Res> class _$ErrorSettingsStateImpl extends _ErrorSettingsState { const _$ErrorSettingsStateImpl( - {required this.locale, - required this.dictionary, - required this.appTheme, - required this.message}) + {required this.locale, required this.dictionary, required this.appTheme, required this.message}) : super._(); /// The current locale. @@ -482,23 +469,19 @@ class _$ErrorSettingsStateImpl extends _ErrorSettingsState { (other.runtimeType == runtimeType && other is _$ErrorSettingsStateImpl && (identical(other.locale, locale) || other.locale == locale) && - (identical(other.dictionary, dictionary) || - other.dictionary == dictionary) && - (identical(other.appTheme, appTheme) || - other.appTheme == appTheme) && + (identical(other.dictionary, dictionary) || other.dictionary == dictionary) && + (identical(other.appTheme, appTheme) || other.appTheme == appTheme) && (identical(other.message, message) || other.message == message)); } @override - int get hashCode => - Object.hash(runtimeType, locale, dictionary, appTheme, message); + int get hashCode => Object.hash(runtimeType, locale, dictionary, appTheme, message); @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') _$$ErrorSettingsStateImplCopyWith<_$ErrorSettingsStateImpl> get copyWith => - __$$ErrorSettingsStateImplCopyWithImpl<_$ErrorSettingsStateImpl>( - this, _$identity); + __$$ErrorSettingsStateImplCopyWithImpl<_$ErrorSettingsStateImpl>(this, _$identity); @override @optionalTypeArgs @@ -541,16 +524,19 @@ abstract class _ErrorSettingsState extends SettingsState { required final Locale dictionary, required final AppTheme appTheme, required final String message}) = _$ErrorSettingsStateImpl; + const _ErrorSettingsState._() : super._(); @override /// The current locale. Locale get locale; + @override /// The current dictionary. Locale get dictionary; + @override /// The current theme mode. @@ -558,10 +544,10 @@ abstract class _ErrorSettingsState extends SettingsState { /// The error message. String get message; + @override @JsonKey(ignore: true) - _$$ErrorSettingsStateImplCopyWith<_$ErrorSettingsStateImpl> get copyWith => - throw _privateConstructorUsedError; + _$$ErrorSettingsStateImplCopyWith<_$ErrorSettingsStateImpl> get copyWith => throw _privateConstructorUsedError; } /// @nodoc @@ -569,11 +555,11 @@ mixin _$SettingsEvent { @optionalTypeArgs TResult map({ required TResult Function(_UpdateThemeSettingsEvent value) updateTheme, - required TResult Function(_UpdateDictionarySettingsEvent value) - updateDictionary, + required TResult Function(_UpdateDictionarySettingsEvent value) updateDictionary, required TResult Function(_UpdateLocaleSettingsEvent value) updateLocale, }) => throw _privateConstructorUsedError; + @optionalTypeArgs TResult? mapOrNull({ TResult? Function(_UpdateThemeSettingsEvent value)? updateTheme, @@ -593,18 +579,17 @@ mixin _$SettingsEvent { /// @nodoc abstract class $SettingsEventCopyWith<$Res> { - factory $SettingsEventCopyWith( - SettingsEvent value, $Res Function(SettingsEvent) then) = + factory $SettingsEventCopyWith(SettingsEvent value, $Res Function(SettingsEvent) then) = _$SettingsEventCopyWithImpl<$Res, SettingsEvent>; } /// @nodoc -class _$SettingsEventCopyWithImpl<$Res, $Val extends SettingsEvent> - implements $SettingsEventCopyWith<$Res> { +class _$SettingsEventCopyWithImpl<$Res, $Val extends SettingsEvent> implements $SettingsEventCopyWith<$Res> { _$SettingsEventCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; + // ignore: unused_field final $Res Function($Val) _then; } @@ -612,9 +597,9 @@ class _$SettingsEventCopyWithImpl<$Res, $Val extends SettingsEvent> /// @nodoc abstract class _$$UpdateThemeSettingsEventImplCopyWith<$Res> { factory _$$UpdateThemeSettingsEventImplCopyWith( - _$UpdateThemeSettingsEventImpl value, - $Res Function(_$UpdateThemeSettingsEventImpl) then) = + _$UpdateThemeSettingsEventImpl value, $Res Function(_$UpdateThemeSettingsEventImpl) then) = __$$UpdateThemeSettingsEventImplCopyWithImpl<$Res>; + @useResult $Res call({AppTheme appTheme}); } @@ -624,8 +609,7 @@ class __$$UpdateThemeSettingsEventImplCopyWithImpl<$Res> extends _$SettingsEventCopyWithImpl<$Res, _$UpdateThemeSettingsEventImpl> implements _$$UpdateThemeSettingsEventImplCopyWith<$Res> { __$$UpdateThemeSettingsEventImplCopyWithImpl( - _$UpdateThemeSettingsEventImpl _value, - $Res Function(_$UpdateThemeSettingsEventImpl) _then) + _$UpdateThemeSettingsEventImpl _value, $Res Function(_$UpdateThemeSettingsEventImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -661,8 +645,7 @@ class _$UpdateThemeSettingsEventImpl implements _UpdateThemeSettingsEvent { return identical(this, other) || (other.runtimeType == runtimeType && other is _$UpdateThemeSettingsEventImpl && - (identical(other.appTheme, appTheme) || - other.appTheme == appTheme)); + (identical(other.appTheme, appTheme) || other.appTheme == appTheme)); } @override @@ -671,16 +654,14 @@ class _$UpdateThemeSettingsEventImpl implements _UpdateThemeSettingsEvent { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$UpdateThemeSettingsEventImplCopyWith<_$UpdateThemeSettingsEventImpl> - get copyWith => __$$UpdateThemeSettingsEventImplCopyWithImpl< - _$UpdateThemeSettingsEventImpl>(this, _$identity); + _$$UpdateThemeSettingsEventImplCopyWith<_$UpdateThemeSettingsEventImpl> get copyWith => + __$$UpdateThemeSettingsEventImplCopyWithImpl<_$UpdateThemeSettingsEventImpl>(this, _$identity); @override @optionalTypeArgs TResult map({ required TResult Function(_UpdateThemeSettingsEvent value) updateTheme, - required TResult Function(_UpdateDictionarySettingsEvent value) - updateDictionary, + required TResult Function(_UpdateDictionarySettingsEvent value) updateDictionary, required TResult Function(_UpdateLocaleSettingsEvent value) updateLocale, }) { return updateTheme(this); @@ -712,34 +693,32 @@ class _$UpdateThemeSettingsEventImpl implements _UpdateThemeSettingsEvent { } abstract class _UpdateThemeSettingsEvent implements SettingsEvent { - const factory _UpdateThemeSettingsEvent({required final AppTheme appTheme}) = - _$UpdateThemeSettingsEventImpl; + const factory _UpdateThemeSettingsEvent({required final AppTheme appTheme}) = _$UpdateThemeSettingsEventImpl; /// The new theme mode. AppTheme get appTheme; + @JsonKey(ignore: true) - _$$UpdateThemeSettingsEventImplCopyWith<_$UpdateThemeSettingsEventImpl> - get copyWith => throw _privateConstructorUsedError; + _$$UpdateThemeSettingsEventImplCopyWith<_$UpdateThemeSettingsEventImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class _$$UpdateDictionarySettingsEventImplCopyWith<$Res> { factory _$$UpdateDictionarySettingsEventImplCopyWith( - _$UpdateDictionarySettingsEventImpl value, - $Res Function(_$UpdateDictionarySettingsEventImpl) then) = + _$UpdateDictionarySettingsEventImpl value, $Res Function(_$UpdateDictionarySettingsEventImpl) then) = __$$UpdateDictionarySettingsEventImplCopyWithImpl<$Res>; + @useResult $Res call({Locale dictionary}); } /// @nodoc class __$$UpdateDictionarySettingsEventImplCopyWithImpl<$Res> - extends _$SettingsEventCopyWithImpl<$Res, - _$UpdateDictionarySettingsEventImpl> + extends _$SettingsEventCopyWithImpl<$Res, _$UpdateDictionarySettingsEventImpl> implements _$$UpdateDictionarySettingsEventImplCopyWith<$Res> { __$$UpdateDictionarySettingsEventImplCopyWithImpl( - _$UpdateDictionarySettingsEventImpl _value, - $Res Function(_$UpdateDictionarySettingsEventImpl) _then) + _$UpdateDictionarySettingsEventImpl _value, $Res Function(_$UpdateDictionarySettingsEventImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -758,8 +737,7 @@ class __$$UpdateDictionarySettingsEventImplCopyWithImpl<$Res> /// @nodoc -class _$UpdateDictionarySettingsEventImpl - implements _UpdateDictionarySettingsEvent { +class _$UpdateDictionarySettingsEventImpl implements _UpdateDictionarySettingsEvent { const _$UpdateDictionarySettingsEventImpl({required this.dictionary}); /// The new locale. @@ -776,8 +754,7 @@ class _$UpdateDictionarySettingsEventImpl return identical(this, other) || (other.runtimeType == runtimeType && other is _$UpdateDictionarySettingsEventImpl && - (identical(other.dictionary, dictionary) || - other.dictionary == dictionary)); + (identical(other.dictionary, dictionary) || other.dictionary == dictionary)); } @override @@ -786,17 +763,14 @@ class _$UpdateDictionarySettingsEventImpl @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$UpdateDictionarySettingsEventImplCopyWith< - _$UpdateDictionarySettingsEventImpl> - get copyWith => __$$UpdateDictionarySettingsEventImplCopyWithImpl< - _$UpdateDictionarySettingsEventImpl>(this, _$identity); + _$$UpdateDictionarySettingsEventImplCopyWith<_$UpdateDictionarySettingsEventImpl> get copyWith => + __$$UpdateDictionarySettingsEventImplCopyWithImpl<_$UpdateDictionarySettingsEventImpl>(this, _$identity); @override @optionalTypeArgs TResult map({ required TResult Function(_UpdateThemeSettingsEvent value) updateTheme, - required TResult Function(_UpdateDictionarySettingsEvent value) - updateDictionary, + required TResult Function(_UpdateDictionarySettingsEvent value) updateDictionary, required TResult Function(_UpdateLocaleSettingsEvent value) updateLocale, }) { return updateDictionary(this); @@ -828,23 +802,23 @@ class _$UpdateDictionarySettingsEventImpl } abstract class _UpdateDictionarySettingsEvent implements SettingsEvent { - const factory _UpdateDictionarySettingsEvent( - {required final Locale dictionary}) = _$UpdateDictionarySettingsEventImpl; + const factory _UpdateDictionarySettingsEvent({required final Locale dictionary}) = + _$UpdateDictionarySettingsEventImpl; /// The new locale. Locale get dictionary; + @JsonKey(ignore: true) - _$$UpdateDictionarySettingsEventImplCopyWith< - _$UpdateDictionarySettingsEventImpl> - get copyWith => throw _privateConstructorUsedError; + _$$UpdateDictionarySettingsEventImplCopyWith<_$UpdateDictionarySettingsEventImpl> get copyWith => + throw _privateConstructorUsedError; } /// @nodoc abstract class _$$UpdateLocaleSettingsEventImplCopyWith<$Res> { factory _$$UpdateLocaleSettingsEventImplCopyWith( - _$UpdateLocaleSettingsEventImpl value, - $Res Function(_$UpdateLocaleSettingsEventImpl) then) = + _$UpdateLocaleSettingsEventImpl value, $Res Function(_$UpdateLocaleSettingsEventImpl) then) = __$$UpdateLocaleSettingsEventImplCopyWithImpl<$Res>; + @useResult $Res call({Locale locale}); } @@ -854,8 +828,7 @@ class __$$UpdateLocaleSettingsEventImplCopyWithImpl<$Res> extends _$SettingsEventCopyWithImpl<$Res, _$UpdateLocaleSettingsEventImpl> implements _$$UpdateLocaleSettingsEventImplCopyWith<$Res> { __$$UpdateLocaleSettingsEventImplCopyWithImpl( - _$UpdateLocaleSettingsEventImpl _value, - $Res Function(_$UpdateLocaleSettingsEventImpl) _then) + _$UpdateLocaleSettingsEventImpl _value, $Res Function(_$UpdateLocaleSettingsEventImpl) _then) : super(_value, _then); @pragma('vm:prefer-inline') @@ -900,16 +873,14 @@ class _$UpdateLocaleSettingsEventImpl implements _UpdateLocaleSettingsEvent { @JsonKey(ignore: true) @override @pragma('vm:prefer-inline') - _$$UpdateLocaleSettingsEventImplCopyWith<_$UpdateLocaleSettingsEventImpl> - get copyWith => __$$UpdateLocaleSettingsEventImplCopyWithImpl< - _$UpdateLocaleSettingsEventImpl>(this, _$identity); + _$$UpdateLocaleSettingsEventImplCopyWith<_$UpdateLocaleSettingsEventImpl> get copyWith => + __$$UpdateLocaleSettingsEventImplCopyWithImpl<_$UpdateLocaleSettingsEventImpl>(this, _$identity); @override @optionalTypeArgs TResult map({ required TResult Function(_UpdateThemeSettingsEvent value) updateTheme, - required TResult Function(_UpdateDictionarySettingsEvent value) - updateDictionary, + required TResult Function(_UpdateDictionarySettingsEvent value) updateDictionary, required TResult Function(_UpdateLocaleSettingsEvent value) updateLocale, }) { return updateLocale(this); @@ -941,12 +912,12 @@ class _$UpdateLocaleSettingsEventImpl implements _UpdateLocaleSettingsEvent { } abstract class _UpdateLocaleSettingsEvent implements SettingsEvent { - const factory _UpdateLocaleSettingsEvent({required final Locale locale}) = - _$UpdateLocaleSettingsEventImpl; + const factory _UpdateLocaleSettingsEvent({required final Locale locale}) = _$UpdateLocaleSettingsEventImpl; /// The new locale. Locale get locale; + @JsonKey(ignore: true) - _$$UpdateLocaleSettingsEventImplCopyWith<_$UpdateLocaleSettingsEventImpl> - get copyWith => throw _privateConstructorUsedError; + _$$UpdateLocaleSettingsEventImplCopyWith<_$UpdateLocaleSettingsEventImpl> get copyWith => + throw _privateConstructorUsedError; } diff --git a/lib/src/feature/tutorial/widget/tutorial_page.dart b/lib/src/feature/tutorial/widget/tutorial_page.dart index bc0d69bd..c60ba3ed 100644 --- a/lib/src/feature/tutorial/widget/tutorial_page.dart +++ b/lib/src/feature/tutorial/widget/tutorial_page.dart @@ -32,40 +32,40 @@ class TutorialPage extends StatelessWidget { child: ListView( padding: EdgeInsets.only(bottom: MediaQuery.paddingOf(context).bottom + 16), children: [ - const Text( - 'Guess the WORD in 6 tries.', - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500), + Text( + context.r.tutorialTitle, + style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w500), ), const SizedBox(height: 16), - const Text.rich( + Text.rich( TextSpan( children: [ - TextSpan(text: '\u2022'), - WidgetSpan(child: SizedBox(width: 6)), - TextSpan(text: 'Each guess must be a valid 5 letter word. Hit the enter button to submit.'), + const TextSpan(text: '\u2022'), + const WidgetSpan(child: SizedBox(width: 6)), + TextSpan(text: context.r.tutorialDescription1), ], ), - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500), + style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w500), ), const SizedBox(height: 16), - const Text.rich( + Text.rich( TextSpan( children: [ - TextSpan(text: '\u2022'), - WidgetSpan(child: SizedBox(width: 6)), + const TextSpan(text: '\u2022'), + const WidgetSpan(child: SizedBox(width: 6)), TextSpan( - text: - 'After each guess, the color of the tiles will change to show how close your guess was to the word.'), + text: context.r.tutorialDescription2, + ), ], ), - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500), + style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w500), ), const SizedBox(height: 16), const Divider(color: AppColors.secondary), const SizedBox(height: 16), - const Text( - 'Examples', - style: TextStyle(fontSize: 24, fontWeight: FontWeight.w500), + Text( + context.r.examples, + style: const TextStyle(fontSize: 24, fontWeight: FontWeight.w500), ), const SizedBox(height: 16), ConstrainedBox( @@ -82,9 +82,9 @@ class TutorialPage extends StatelessWidget { ), ), const SizedBox(height: 16), - const Text( - 'The letter W is in the word and in the correct spot.', - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500), + Text( + context.r.tutorialWordCorrectSpot, + style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w500), ), const SizedBox(height: 16), ConstrainedBox( @@ -101,9 +101,9 @@ class TutorialPage extends StatelessWidget { ), ), const SizedBox(height: 16), - const Text( - 'The letter I is in the word but in the wrong spot.', - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500), + Text( + context.r.tutorialWordWrongSpot, + style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w500), ), const SizedBox(height: 16), ConstrainedBox( @@ -120,15 +120,15 @@ class TutorialPage extends StatelessWidget { ), ), const SizedBox(height: 16), - const Text( - 'The letter U is not in the word in any spot.', - style: TextStyle(fontSize: 16, fontWeight: FontWeight.w500), + Text( + context.r.tutorialNotInWordSpot, + style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w500), ), const SizedBox(height: 16), const Divider(color: AppColors.secondary), const SizedBox(height: 16), Text( - 'A new WORD will be available each day!'.toUpperCase(), + context.r.newWordAvailableEachDay.toUpperCase(), style: const TextStyle(fontSize: 16, fontWeight: FontWeight.w800), ), ], @@ -143,18 +143,18 @@ class TutorialPage extends StatelessWidget { switch (dictionary) { case const Locale('en'): return const [ - LetterInfo(letter: 'w', status: LetterStatus.correctSpot), - LetterInfo(letter: 'e'), + LetterInfo(letter: 'p', status: LetterStatus.correctSpot), LetterInfo(letter: 'a'), - LetterInfo(letter: 'r'), - LetterInfo(letter: 'y'), + LetterInfo(letter: 'u'), + LetterInfo(letter: 's'), + LetterInfo(letter: 'e'), ]; case const Locale('ru'): return const [ LetterInfo(letter: 'п', status: LetterStatus.correctSpot), LetterInfo(letter: 'а'), - LetterInfo(letter: 'у', status: LetterStatus.notInWord), - LetterInfo(letter: 'з', status: LetterStatus.wrongSpot), + LetterInfo(letter: 'у'), + LetterInfo(letter: 'з'), LetterInfo(letter: 'а'), ]; } @@ -165,18 +165,18 @@ class TutorialPage extends StatelessWidget { switch (dictionary) { case const Locale('en'): return const [ - LetterInfo(letter: 'p'), - LetterInfo(letter: 'i', status: LetterStatus.wrongSpot), - LetterInfo(letter: 'l'), - LetterInfo(letter: 'l'), - LetterInfo(letter: 's'), + LetterInfo(letter: 'c'), + LetterInfo(letter: 'r'), + LetterInfo(letter: 'a', status: LetterStatus.wrongSpot), + LetterInfo(letter: 'n'), + LetterInfo(letter: 'e'), ]; case const Locale('ru'): return const [ - LetterInfo(letter: 'п', status: LetterStatus.correctSpot), - LetterInfo(letter: 'а'), - LetterInfo(letter: 'у', status: LetterStatus.notInWord), - LetterInfo(letter: 'з', status: LetterStatus.wrongSpot), + LetterInfo(letter: 'ф'), + LetterInfo(letter: 'и'), + LetterInfo(letter: 'ш', status: LetterStatus.wrongSpot), + LetterInfo(letter: 'к'), LetterInfo(letter: 'а'), ]; } @@ -187,19 +187,19 @@ class TutorialPage extends StatelessWidget { switch (dictionary) { case const Locale('en'): return const [ - LetterInfo(letter: 'v'), - LetterInfo(letter: 'a'), - LetterInfo(letter: 'g'), - LetterInfo(letter: 'u', status: LetterStatus.notInWord), - LetterInfo(letter: 'e'), + LetterInfo(letter: 's'), + LetterInfo(letter: 'p'), + LetterInfo(letter: 'o'), + LetterInfo(letter: 'r'), + LetterInfo(letter: 'e', status: LetterStatus.notInWord), ]; case const Locale('ru'): return const [ - LetterInfo(letter: 'п', status: LetterStatus.correctSpot), - LetterInfo(letter: 'а'), - LetterInfo(letter: 'у', status: LetterStatus.notInWord), - LetterInfo(letter: 'з', status: LetterStatus.wrongSpot), - LetterInfo(letter: 'а'), + LetterInfo(letter: 'л'), + LetterInfo(letter: 'е'), + LetterInfo(letter: 'й'), + LetterInfo(letter: 'к'), + LetterInfo(letter: 'а', status: LetterStatus.notInWord), ]; } return [];