From 4a5e2d7c847d9e22b36a0fdc78c31ac085acd8c9 Mon Sep 17 00:00:00 2001 From: lnd212 Date: Sat, 24 Sep 2022 10:13:10 +0400 Subject: [PATCH] Fix with utf8 --- app/lib/core/data/data_singleton.dart | 8 +++-- app/pubspec.lock | 46 +++++++++++++-------------- app/pubspec.yaml | 10 +++--- 3 files changed, 35 insertions(+), 29 deletions(-) diff --git a/app/lib/core/data/data_singleton.dart b/app/lib/core/data/data_singleton.dart index b4db387..081541a 100644 --- a/app/lib/core/data/data_singleton.dart +++ b/app/lib/core/data/data_singleton.dart @@ -1,3 +1,4 @@ +import 'dart:convert'; import 'dart:math'; import 'package:flutter/material.dart'; @@ -56,11 +57,14 @@ class DataSingleton { } if (currentWordIndex < 5) { if (gridData[currentWordIndex].length == 5) { - if (gridData[currentWordIndex] == secretWord) { + var input = utf8 + .decode(utf8.encode("${gridData[currentWordIndex]}\r").toList()) + .toString(); + if (input == secretWord) { nextWord(); return WinGameState(); } - if (allWords.contains(gridData[currentWordIndex])) { + if (allWords.contains(secretWord)) { nextWord(); return GridUpdateState(); } else { diff --git a/app/pubspec.lock b/app/pubspec.lock index 0453e39..0192b94 100644 --- a/app/pubspec.lock +++ b/app/pubspec.lock @@ -7,14 +7,14 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.8.2" + version: "2.9.0" bloc: - dependency: transitive + dependency: "direct main" description: name: bloc url: "https://pub.dartlang.org" source: hosted - version: "8.0.3" + version: "8.1.0" boolean_selector: dependency: transitive description: @@ -28,7 +28,7 @@ packages: name: characters url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.1" charcode: dependency: transitive description: @@ -42,14 +42,14 @@ packages: name: clock url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.1" collection: dependency: transitive description: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" crypto: dependency: transitive description: @@ -84,7 +84,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.1" ffi: dependency: transitive description: @@ -93,12 +93,12 @@ packages: source: hosted version: "1.1.2" file: - dependency: transitive + dependency: "direct main" description: name: file url: "https://pub.dartlang.org" source: hosted - version: "6.1.2" + version: "6.1.4" flutter: dependency: "direct main" description: flutter @@ -124,7 +124,7 @@ packages: name: flutter_lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.4" + version: "2.0.1" flutter_svg: dependency: transitive description: @@ -155,7 +155,7 @@ packages: name: google_fonts url: "https://pub.dartlang.org" source: hosted - version: "2.3.1" + version: "3.0.1" http: dependency: transitive description: @@ -190,28 +190,28 @@ packages: name: lints url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "2.0.0" matcher: dependency: transitive description: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.11" + version: "0.12.12" material_color_utilities: dependency: transitive description: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.4" + version: "0.2.0" meta: dependency: transitive description: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.7.0" + version: "1.8.0" nested: dependency: transitive description: @@ -225,7 +225,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" path_drawing: dependency: transitive description: @@ -391,7 +391,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.2" + version: "1.9.1" stack_trace: dependency: transitive description: @@ -412,28 +412,28 @@ packages: name: string_scanner url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.1" term_glyph: dependency: transitive description: name: term_glyph url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.2.1" test_api: dependency: transitive description: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.9" + version: "0.4.13" top_snackbar_flutter: dependency: "direct main" description: name: top_snackbar_flutter url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "2.1.1" twemoji: dependency: "direct main" description: @@ -454,7 +454,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.2" + version: "2.1.3" win32: dependency: transitive description: @@ -484,5 +484,5 @@ packages: source: hosted version: "3.1.0" sdks: - dart: ">=2.16.0-100.0.dev <3.0.0" + dart: ">=2.18.0-146.0.dev <3.0.0" flutter: ">=2.10.0-0" diff --git a/app/pubspec.yaml b/app/pubspec.yaml index 4f42514..637e65d 100644 --- a/app/pubspec.yaml +++ b/app/pubspec.yaml @@ -4,29 +4,31 @@ description: A new Flutter project. version: 1.0.0+1 environment: - sdk: ">=2.15.1 <3.0.0" + sdk: ">=2.15.1 <3.5.0" dependencies: flutter: sdk: flutter flutter_bloc: ^8.0.1 - top_snackbar_flutter: ^1.0.2 + top_snackbar_flutter: ^2.1.1 flutter_countdown_timer: ^4.1.0 shared_preferences: ^2.0.12 equatable: ^2.0.3 twemoji: ^0.4.2 cupertino_icons: ^1.0.2 - google_fonts: ^2.2.0 + google_fonts: ^3.0.1 shared_preferences_web: ^2.0.3 desktop_window: ^0.4.0 fullscreen: ^1.0.3 + file: ^6.1.4 + bloc: ^8.1.0 dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^1.0.0 + flutter_lints: ^2.0.1 flutter: uses-material-design: true