From 8839e589509e01ec22c1c565f27771507173e3ec Mon Sep 17 00:00:00 2001 From: Jaime Sanchez Date: Tue, 21 May 2024 15:40:38 +0200 Subject: [PATCH 1/9] chore: update web initialization logic --- lib/main_development.dart | 11 +++--- packages/api_client/pubspec.yaml | 3 ++ pubspec.lock | 68 ++++++++++++++++---------------- pubspec.yaml | 8 ++-- web/flutter_bootstrap.js | 43 ++++++++++++++++++++ web/index.html | 62 +---------------------------- 6 files changed, 91 insertions(+), 104 deletions(-) create mode 100644 web/flutter_bootstrap.js diff --git a/lib/main_development.dart b/lib/main_development.dart index 99524012d..03ca5c79b 100644 --- a/lib/main_development.dart +++ b/lib/main_development.dart @@ -1,7 +1,6 @@ -// ignore_for_file: avoid_web_libraries_in_flutter - import 'dart:async'; -import 'dart:js' as js; +import 'dart:js_interop' as js; +import 'dart:js_interop_unsafe'; import 'package:api_client/api_client.dart'; import 'package:authentication_repository/authentication_repository.dart'; @@ -18,8 +17,10 @@ import 'package:leaderboard_repository/leaderboard_repository.dart'; void main() async { if (kDebugMode) { - js.context['FIREBASE_APPCHECK_DEBUG_TOKEN'] = - const String.fromEnvironment('APPCHECK_DEBUG_TOKEN'); + js.globalContext.setProperty( + 'FIREBASE_APPCHECK_DEBUG_TOKEN'.toJS, + const String.fromEnvironment('APPCHECK_DEBUG_TOKEN').toJS, + ); } WidgetsFlutterBinding.ensureInitialized(); diff --git a/packages/api_client/pubspec.yaml b/packages/api_client/pubspec.yaml index ff260f385..ceadcefb1 100644 --- a/packages/api_client/pubspec.yaml +++ b/packages/api_client/pubspec.yaml @@ -17,3 +17,6 @@ dependencies: game_domain: path: ../../api/packages/game_domain http: ^1.2.1 + +dependency_overrides: + pointycastle: ^3.9.1 \ No newline at end of file diff --git a/pubspec.lock b/pubspec.lock index f6219ec57..8090fae80 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -13,10 +13,10 @@ packages: dependency: transitive description: name: _flutterfire_internals - sha256: "3dee3db3468c5f4640a4e8aa9c1e22561c298976d8c39ed2fdd456a9a3db26e1" + sha256: "2350805d7afefb0efe7acd325cb19d3ae8ba4039b906eade3807ffb69938a01f" url: "https://pub.dev" source: hosted - version: "1.3.32" + version: "1.3.33" analyzer: dependency: transitive description: @@ -385,26 +385,26 @@ packages: dependency: "direct main" description: name: firebase_app_check - sha256: "8f8c54d00bd26e94b507c78f575f86c5f441d72b5f39b67ac743d9271e89bfaa" + sha256: f66b67027de548b6f8b61c7aa752a24804104e7f463723d202ae9c6d9520fa6b url: "https://pub.dev" source: hosted - version: "0.2.2" + version: "0.2.2+5" firebase_app_check_platform_interface: dependency: transitive description: name: firebase_app_check_platform_interface - sha256: "4eb67ee2ecc597c6b1421fcfd1e721aff35928e70cc471aa7fca9c79c15292bf" + sha256: c06fcb2381ff2566f4ebe1a1df2e1798de3d0fad531f673e8539368f33cf6b34 url: "https://pub.dev" source: hosted - version: "0.1.0+22" + version: "0.1.0+27" firebase_app_check_web: dependency: transitive description: name: firebase_app_check_web - sha256: "57cb0d2c41fe31d45a37d62b9d91d93ed192f0d85b36ed28107493332f9d9ebe" + sha256: "88c8d792d429a43767461312f29baa5d3b76cd0453cf48dd008f8f94393221c1" url: "https://pub.dev" source: hosted - version: "0.1.2" + version: "0.1.2+5" firebase_auth: dependency: "direct main" description: @@ -433,10 +433,10 @@ packages: dependency: "direct main" description: name: firebase_core - sha256: "4aef2a23d0f3265545807d68fbc2f76a6b994ca3c778d88453b99325abd63284" + sha256: "372d94ced114b9c40cb85e18c50ac94a7e998c8eec630c50d7aec047847d27bf" url: "https://pub.dev" source: hosted - version: "2.30.1" + version: "2.31.0" firebase_core_platform_interface: dependency: transitive description: @@ -449,10 +449,10 @@ packages: dependency: transitive description: name: firebase_core_web - sha256: "67f2fcc600fc78c2f731c370a3a5e6c87ee862e3a2fba6f951eca6d5dafe5c29" + sha256: "43d9e951ac52b87ae9cc38ecdcca1e8fa7b52a1dd26a96085ba41ce5108db8e9" url: "https://pub.dev" source: hosted - version: "2.16.0" + version: "2.17.0" fixnum: dependency: transitive description: @@ -588,10 +588,10 @@ packages: dependency: "direct main" description: name: intl - sha256: "3bc132a9dbce73a7e4a21a17d06e1878839ffbf975568bc875c60537824b0c4d" + sha256: d6f56758b7d3014a48af9701c085700aac781a92a87a62b1333b46d8879661cf url: "https://pub.dev" source: hosted - version: "0.18.1" + version: "0.19.0" io: dependency: transitive description: @@ -634,26 +634,26 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" + sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" url: "https://pub.dev" source: hosted - version: "10.0.0" + version: "10.0.4" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 + sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.0.3" leak_tracker_testing: dependency: transitive description: name: leak_tracker_testing - sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 + sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" url: "https://pub.dev" source: hosted - version: "2.0.1" + version: "3.0.1" logging: dependency: transitive description: @@ -682,10 +682,10 @@ packages: dependency: transitive description: name: meta - sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 + sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.12.0" mime: dependency: transitive description: @@ -834,10 +834,10 @@ packages: dependency: transitive description: name: pointycastle - sha256: "43ac87de6e10afabc85c445745a7b799e04de84cebaa4fd7bf55a5e1e9604d29" + sha256: "4be0097fcf3fd3e8449e53730c631200ebc7b88016acecab2b0da2f0149222fe" url: "https://pub.dev" source: hosted - version: "3.7.4" + version: "3.9.1" pool: dependency: transitive description: @@ -999,26 +999,26 @@ packages: dependency: transitive description: name: test - sha256: a1f7595805820fcc05e5c52e3a231aedd0b72972cb333e8c738a8b1239448b6f + sha256: "7ee446762c2c50b3bd4ea96fe13ffac69919352bd3b4b17bac3f3465edc58073" url: "https://pub.dev" source: hosted - version: "1.24.9" + version: "1.25.2" test_api: dependency: transitive description: name: test_api - sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b" + sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" url: "https://pub.dev" source: hosted - version: "0.6.1" + version: "0.7.0" test_core: dependency: transitive description: name: test_core - sha256: a757b14fc47507060a162cc2530d9a4a2f92f5100a952c7443b5cad5ef5b106a + sha256: "2bc4b4ecddd75309300d8096f781c0e3280ca1ef85beda558d33fcbedc2eead4" url: "https://pub.dev" source: hosted - version: "0.5.9" + version: "0.6.0" time: dependency: transitive description: @@ -1159,10 +1159,10 @@ packages: dependency: transitive description: name: vm_service - sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 + sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" url: "https://pub.dev" source: hosted - version: "13.0.0" + version: "14.2.1" watcher: dependency: transitive description: @@ -1228,5 +1228,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.3.0 <4.0.0" - flutter: ">=3.19.0" + dart: ">=3.4.0 <4.0.0" + flutter: ">=3.22.0" diff --git a/pubspec.yaml b/pubspec.yaml index 604602d9c..776cc5deb 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -4,8 +4,8 @@ version: 0.0.1+1 publish_to: none environment: - sdk: ">=3.2.0 <4.0.0" - flutter: ">=3.19.0" + sdk: ">=3.4.0 <4.0.0" + flutter: ">=3.22.0" dependencies: api_client: @@ -21,7 +21,7 @@ dependencies: crossword_repository: path: packages/crossword_repository equatable: ^2.0.5 - firebase_app_check: ^0.2.2 + firebase_app_check: ^0.2.2+5 firebase_auth: ^4.19.4 firebase_core: ^2.30.1 flame: ^1.17.0 @@ -35,7 +35,7 @@ dependencies: game_domain: path: api/packages/game_domain http: ^1.2.1 - intl: ^0.18.1 + intl: ^0.19.0 io_crossword_ui: path: packages/io_crossword_ui leaderboard_repository: diff --git a/web/flutter_bootstrap.js b/web/flutter_bootstrap.js new file mode 100644 index 000000000..41ec8d978 --- /dev/null +++ b/web/flutter_bootstrap.js @@ -0,0 +1,43 @@ +/// Keep in mind that this file is not a real javascript file, it is a template +/// that will be processed by the build system to generate the final javascript +/// file. Therefore, we use the mustache syntax, like {{variable}}, to inject +/// values and you might see some linter errors in this file. + +{{flutter_js}} +{{flutter_build_config}} + +const cookieBar = document.querySelector("#cookie-bar"); +const cookieBarButton = document.querySelector("#confirm-cookies"); +const splashCopy = document.querySelector("#splash_copy"); + +const additionalScripts = []; + +let cookiesAcceptanceCompleter; +let hasUserAcceptedCookies = new Promise((resolve) => { + cookiesAcceptanceCompleter = resolve; +}); + +cookieBarButton.addEventListener("click", () => { + console.log("cookieBarButton clicked"); + cookieBar.remove(); + cookiesAcceptanceCompleter(); +}); + +window.addEventListener("load", (event) => { + _flutter.loader.load({ + serviceWorkerSettings: { + serviceWorkerVersion: {{flutter_service_worker_version}}, + }, + onEntrypointLoaded: async function (engineInitializer) { + const appRunner = await engineInitializer.initializeEngine(); + await hasUserAcceptedCookies; + + window.addEventListener("flutter-first-frame", function () { + splashCopy.remove(); + document.body.classList.remove("loading-mode"); + }); + + await appRunner.runApp(); + }, + }); +}); diff --git a/web/index.html b/web/index.html index 2aa245e92..88f85cd7b 100644 --- a/web/index.html +++ b/web/index.html @@ -188,11 +188,6 @@ } - - @@ -213,62 +208,7 @@ From 9e97e55950854af7235ae54dbb0dbfa5192bf193 Mon Sep 17 00:00:00 2001 From: Jaime Sanchez Date: Tue, 21 May 2024 16:00:01 +0200 Subject: [PATCH 2/9] chore: update deploy workflows to use wasm --- .github/workflows/deploy_app_dev.yaml | 3 +-- .github/workflows/deploy_app_prod.yaml | 2 +- .github/workflows/deploy_app_staging.yaml | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy_app_dev.yaml b/.github/workflows/deploy_app_dev.yaml index 5b31dd91c..3f3241b46 100644 --- a/.github/workflows/deploy_app_dev.yaml +++ b/.github/workflows/deploy_app_dev.yaml @@ -14,9 +14,8 @@ jobs: - uses: subosito/flutter-action@v2 with: channel: "stable" - flutter-version: 3.19.6 - run: flutter packages get - - run: flutter build web --web-renderer canvaskit -t lib/main_development.dart --dart-define RECAPTCHA_KEY=${{ secrets.RECAPTCHA_KEY }} + - run: flutter build web -t lib/main_development.dart --dart-define RECAPTCHA_KEY=${{ secrets.RECAPTCHA_KEY }} --wasm - uses: FirebaseExtended/action-hosting-deploy@v0 diff --git a/.github/workflows/deploy_app_prod.yaml b/.github/workflows/deploy_app_prod.yaml index 071dbd192..f8c063d4c 100644 --- a/.github/workflows/deploy_app_prod.yaml +++ b/.github/workflows/deploy_app_prod.yaml @@ -12,7 +12,7 @@ jobs: with: channel: "stable" - run: flutter packages get - - run: flutter build web --web-renderer canvaskit -t lib/main_production.dart --dart-define RECAPTCHA_KEY=${{ secrets.RECAPTCHA_KEY_PROD }} + - run: flutter build web -t lib/main_production.dart --dart-define RECAPTCHA_KEY=${{ secrets.RECAPTCHA_KEY_PROD }} --wasm - uses: FirebaseExtended/action-hosting-deploy@v0 diff --git a/.github/workflows/deploy_app_staging.yaml b/.github/workflows/deploy_app_staging.yaml index ae2b358e6..8bad0f30c 100644 --- a/.github/workflows/deploy_app_staging.yaml +++ b/.github/workflows/deploy_app_staging.yaml @@ -11,9 +11,8 @@ jobs: - uses: subosito/flutter-action@v2 with: channel: "stable" - flutter-version: 3.19.6 - run: flutter packages get - - run: flutter build web --web-renderer canvaskit -t lib/main_staging.dart --dart-define RECAPTCHA_KEY=${{ secrets.RECAPTCHA_KEY }} + - run: flutter build web -t lib/main_staging.dart --dart-define RECAPTCHA_KEY=${{ secrets.RECAPTCHA_KEY }} --wasm - uses: FirebaseExtended/action-hosting-deploy@v0 From 47bfc56c3faf02f82f5b2f903f177f4929ceff4d Mon Sep 17 00:00:00 2001 From: Jaime Sanchez Date: Tue, 21 May 2024 16:30:58 +0200 Subject: [PATCH 3/9] docs: update flutter bootstrap documentation --- web/flutter_bootstrap.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/web/flutter_bootstrap.js b/web/flutter_bootstrap.js index 41ec8d978..3a3d87c7c 100644 --- a/web/flutter_bootstrap.js +++ b/web/flutter_bootstrap.js @@ -1,7 +1,8 @@ -/// Keep in mind that this file is not a real javascript file, it is a template -/// that will be processed by the build system to generate the final javascript -/// file. Therefore, we use the mustache syntax, like {{variable}}, to inject -/// values and you might see some linter errors in this file. +/** Keep in mind that this file is not a real javascript file, it is a template + * that will be processed by the build system to generate the final javascript + * file. Therefore, we use the {@link https://mustache.github.io/mustache.5.html mustache syntax} to inject + * values and you might see some linter errors in this file. + */ {{flutter_js}} {{flutter_build_config}} From a760f2b9ef2e56235ced52254f3b40cfc0750f15 Mon Sep 17 00:00:00 2001 From: Jaime Sanchez Date: Tue, 21 May 2024 16:46:14 +0200 Subject: [PATCH 4/9] chore: update flutter version in workflows --- .github/workflows/io_crossword_ui.yaml | 2 +- .github/workflows/main.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/io_crossword_ui.yaml b/.github/workflows/io_crossword_ui.yaml index 906906b24..7fc33b2f3 100644 --- a/.github/workflows/io_crossword_ui.yaml +++ b/.github/workflows/io_crossword_ui.yaml @@ -16,6 +16,6 @@ jobs: build: uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1 with: - flutter_version: 3.19.6 + flutter_channel: stable working_directory: packages/io_crossword_ui coverage_excludes: "**/*.g.dart" diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 6948fe9e3..a0548de45 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -19,7 +19,7 @@ jobs: build: uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1 with: - flutter_version: 3.19.6 + flutter_channel: stable coverage_excludes: "*.gen.dart" spell-check: From 3a440be03d5811a3140fa43ce2e5c0ae8ff56322 Mon Sep 17 00:00:00 2001 From: Jaime Sanchez Date: Tue, 21 May 2024 17:48:42 +0200 Subject: [PATCH 5/9] chore: update backend admin dependencies --- api/backend_admin/pubspec.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/backend_admin/pubspec.yaml b/api/backend_admin/pubspec.yaml index eff318137..0131d18a9 100644 --- a/api/backend_admin/pubspec.yaml +++ b/api/backend_admin/pubspec.yaml @@ -4,7 +4,8 @@ version: 1.0.0+1 publish_to: none environment: - sdk: "^3.3.0" + sdk: ">=3.4.0 <4.0.0" + flutter: ">=3.22.0" dependencies: bloc: ^8.1.3 @@ -21,7 +22,7 @@ dependencies: game_domain: path: ../packages/game_domain http: ^1.2.1 - intl: ^0.18.1 + intl: ^0.19.0 dev_dependencies: bloc_test: ^9.1.6 From 222e6b2ed4740ea660f5651acf61ede45654805d Mon Sep 17 00:00:00 2001 From: Jaime Sanchez Date: Tue, 21 May 2024 18:26:18 +0200 Subject: [PATCH 6/9] fix: flutter upgrade deprecations --- .../lib/src/theme/io_crossword_theme.dart | 51 +++++++++---------- .../border/gradient_stadium_border_test.dart | 2 +- .../extension/io_icon_button_theme_test.dart | 12 ++--- .../io_outline_button_theme_test.dart | 4 +- .../src/theme/io_crossword_theme_test.dart | 34 ++++++------- .../theme/teams/io_android_theme_test.dart | 8 +-- .../src/theme/teams/io_chrome_theme_test.dart | 8 +-- .../theme/teams/io_firebase_theme_test.dart | 8 +-- .../theme/teams/io_flutter_theme_test.dart | 8 +-- .../src/widgets/io_crossword_card_test.dart | 2 +- .../src/widgets/io_crossword_letter_test.dart | 2 +- .../io_linear_progress_indicator_test.dart | 2 +- .../src/widgets/io_physical_model_test.dart | 2 +- .../test/src/widgets/io_word_input_test.dart | 2 +- .../test/src/widgets/io_word_test.dart | 2 +- 15 files changed, 73 insertions(+), 74 deletions(-) diff --git a/packages/io_crossword_ui/lib/src/theme/io_crossword_theme.dart b/packages/io_crossword_ui/lib/src/theme/io_crossword_theme.dart index 0ee9f9e9a..77f0f575d 100644 --- a/packages/io_crossword_ui/lib/src/theme/io_crossword_theme.dart +++ b/packages/io_crossword_ui/lib/src/theme/io_crossword_theme.dart @@ -194,7 +194,7 @@ class IoCrosswordTheme { color: IoCrosswordColors.mediumGray, ), ).copyWith( - iconColor: MaterialStatePropertyAll( + iconColor: WidgetStatePropertyAll( colorScheme.primary, ), ), @@ -269,9 +269,9 @@ class IoCrosswordTheme { padding: const EdgeInsets.symmetric(horizontal: 24), textStyle: _textTheme.body2, ).copyWith( - shape: MaterialStateProperty.resolveWith( + shape: WidgetStateProperty.resolveWith( (states) { - if (states.contains(MaterialState.disabled)) { + if (states.contains(WidgetState.disabled)) { return const StadiumBorder(side: BorderSide(width: 2)); } return GradientStadiumBorder( @@ -293,9 +293,9 @@ class IoCrosswordTheme { horizontal: 18, ), ).copyWith( - shape: MaterialStateProperty.resolveWith( + shape: WidgetStateProperty.resolveWith( (states) { - if (states.contains(MaterialState.disabled)) { + if (states.contains(WidgetState.disabled)) { return const StadiumBorder( side: BorderSide( width: 2, @@ -322,9 +322,9 @@ class IoCrosswordTheme { horizontal: 18, ), ).copyWith( - shape: MaterialStateProperty.resolveWith( + shape: WidgetStateProperty.resolveWith( (states) { - if (states.contains(MaterialState.disabled)) { + if (states.contains(WidgetState.disabled)) { return const StadiumBorder(side: BorderSide(width: 2)); } @@ -378,41 +378,41 @@ class IoCrosswordTheme { IoIconButtonTheme get _iconButtonTheme { return IoIconButtonTheme( flat: ButtonStyle( - iconSize: const MaterialStatePropertyAll(20), - side: const MaterialStatePropertyAll(BorderSide.none), - iconColor: MaterialStateColor.resolveWith((states) { - if (states.contains(MaterialState.disabled)) { + iconSize: const WidgetStatePropertyAll(20), + side: const WidgetStatePropertyAll(BorderSide.none), + iconColor: WidgetStateColor.resolveWith((states) { + if (states.contains(WidgetState.disabled)) { return IoCrosswordColors.mediumGray; } return IoCrosswordColors.seedWhite; }), backgroundColor: - const MaterialStatePropertyAll(Colors.transparent), + const WidgetStatePropertyAll(Colors.transparent), ), outlined: ButtonStyle( - iconSize: const MaterialStatePropertyAll(20), - shape: const MaterialStatePropertyAll( + iconSize: const WidgetStatePropertyAll(20), + shape: const WidgetStatePropertyAll( CircleBorder(side: BorderSide(color: IoCrosswordColors.mediumGray)), ), - iconColor: MaterialStateColor.resolveWith((states) { - if (states.contains(MaterialState.disabled)) { + iconColor: WidgetStateColor.resolveWith((states) { + if (states.contains(WidgetState.disabled)) { return IoCrosswordColors.mediumGray; } return IoCrosswordColors.seedWhite; }), backgroundColor: - const MaterialStatePropertyAll(Colors.transparent), + const WidgetStatePropertyAll(Colors.transparent), ), filled: ButtonStyle( - iconSize: const MaterialStatePropertyAll(20), - iconColor: MaterialStateColor.resolveWith((states) { - if (states.contains(MaterialState.disabled)) { + iconSize: const WidgetStatePropertyAll(20), + iconColor: WidgetStateColor.resolveWith((states) { + if (states.contains(WidgetState.disabled)) { return IoCrosswordColors.mediumGray; } return IoCrosswordColors.seedWhite; }), backgroundColor: - const MaterialStatePropertyAll(IoCrosswordColors.mediumGray), + const WidgetStatePropertyAll(IoCrosswordColors.mediumGray), ), ); } @@ -421,9 +421,9 @@ class IoCrosswordTheme { final textTheme = _textTheme; final colorScheme = this.colorScheme; - final border = Border.all(color: colorScheme.background); + final border = Border.all(color: colorScheme.surface); final textStyle = textTheme.h2.copyWith( - color: colorScheme.background, + color: colorScheme.surface, height: 1.1, ); @@ -481,9 +481,9 @@ class IoCrosswordTheme { static TabBarTheme get _tabBarTheme { return TabBarTheme( indicatorSize: TabBarIndicatorSize.tab, - labelColor: MaterialStateColor.resolveWith( + labelColor: WidgetStateColor.resolveWith( (states) { - if (states.contains(MaterialState.selected)) { + if (states.contains(WidgetState.selected)) { return const Color(0xFF2E3233); } @@ -499,7 +499,6 @@ class IoCrosswordTheme { return ColorScheme.fromSeed( brightness: Brightness.dark, seedColor: IoCrosswordColors.seedBlue, - background: IoCrosswordColors.seedBlack, surface: IoCrosswordColors.darkGray, onSurface: IoCrosswordColors.seedWhite, surfaceTint: IoCrosswordColors.seedWhite, diff --git a/packages/io_crossword_ui/test/src/border/gradient_stadium_border_test.dart b/packages/io_crossword_ui/test/src/border/gradient_stadium_border_test.dart index f0ca487a6..e09f7a970 100644 --- a/packages/io_crossword_ui/test/src/border/gradient_stadium_border_test.dart +++ b/packages/io_crossword_ui/test/src/border/gradient_stadium_border_test.dart @@ -166,7 +166,7 @@ class _GoldenSubject extends StatelessWidget { data: themeData, child: Material( child: ColoredBox( - color: themeData.colorScheme.background, + color: themeData.colorScheme.surface, child: Center(child: child), ), ), diff --git a/packages/io_crossword_ui/test/src/theme/extension/io_icon_button_theme_test.dart b/packages/io_crossword_ui/test/src/theme/extension/io_icon_button_theme_test.dart index 66f74d443..8ee3af813 100644 --- a/packages/io_crossword_ui/test/src/theme/extension/io_icon_button_theme_test.dart +++ b/packages/io_crossword_ui/test/src/theme/extension/io_icon_button_theme_test.dart @@ -7,24 +7,24 @@ void main() { test('lerps', () { final from = IoIconButtonTheme( flat: ButtonStyle( - backgroundColor: MaterialStateProperty.all(const Color(0xff00ff00)), + backgroundColor: WidgetStateProperty.all(const Color(0xff00ff00)), ), outlined: ButtonStyle( - backgroundColor: MaterialStateProperty.all(const Color(0xff00ff00)), + backgroundColor: WidgetStateProperty.all(const Color(0xff00ff00)), ), filled: ButtonStyle( - backgroundColor: MaterialStateProperty.all(const Color(0xff00ff00)), + backgroundColor: WidgetStateProperty.all(const Color(0xff00ff00)), ), ); final to = IoIconButtonTheme( flat: ButtonStyle( - backgroundColor: MaterialStateProperty.all(const Color(0xff00ff00)), + backgroundColor: WidgetStateProperty.all(const Color(0xff00ff00)), ), outlined: ButtonStyle( - backgroundColor: MaterialStateProperty.all(const Color(0xff0000ff)), + backgroundColor: WidgetStateProperty.all(const Color(0xff0000ff)), ), filled: ButtonStyle( - backgroundColor: MaterialStateProperty.all(const Color(0xff0000ff)), + backgroundColor: WidgetStateProperty.all(const Color(0xff0000ff)), ), ); diff --git a/packages/io_crossword_ui/test/src/theme/extension/io_outline_button_theme_test.dart b/packages/io_crossword_ui/test/src/theme/extension/io_outline_button_theme_test.dart index feca8b4a0..053d5dd73 100644 --- a/packages/io_crossword_ui/test/src/theme/extension/io_outline_button_theme_test.dart +++ b/packages/io_crossword_ui/test/src/theme/extension/io_outline_button_theme_test.dart @@ -7,12 +7,12 @@ void main() { test('lerps', () { final from = IoOutlineButtonTheme( simpleBorder: ButtonStyle( - backgroundColor: MaterialStateProperty.all(const Color(0xff00ff00)), + backgroundColor: WidgetStateProperty.all(const Color(0xff00ff00)), ), ); final to = IoOutlineButtonTheme( simpleBorder: ButtonStyle( - backgroundColor: MaterialStateProperty.all(const Color(0xff0000ff)), + backgroundColor: WidgetStateProperty.all(const Color(0xff0000ff)), ), ); diff --git a/packages/io_crossword_ui/test/src/theme/io_crossword_theme_test.dart b/packages/io_crossword_ui/test/src/theme/io_crossword_theme_test.dart index a949c011b..e31fa520a 100644 --- a/packages/io_crossword_ui/test/src/theme/io_crossword_theme_test.dart +++ b/packages/io_crossword_ui/test/src/theme/io_crossword_theme_test.dart @@ -19,9 +19,9 @@ void main() { final outlinedBorder = IoCrosswordTheme().themeData.outlinedButtonTheme.style!.shape!; - test('displays StadiumBorder with ${MaterialState.disabled}', () { + test('displays StadiumBorder with ${WidgetState.disabled}', () { expect( - outlinedBorder.resolve({MaterialState.disabled}), + outlinedBorder.resolve({WidgetState.disabled}), equals(isA()), ); }); @@ -39,8 +39,8 @@ void main() { ); }); - for (final state in MaterialState.values.toList() - ..remove(MaterialState.disabled)) { + for (final state in WidgetState.values.toList() + ..remove(WidgetState.disabled)) { test('displays GradientOutlinedBorder with $state', () { expect( outlinedBorder.resolve({state}), @@ -64,9 +64,9 @@ void main() { .simpleBorder .shape!; - test('displays StadiumBorder with ${MaterialState.disabled}', () { + test('displays StadiumBorder with ${WidgetState.disabled}', () { expect( - outlinedBorder.resolve({MaterialState.disabled}), + outlinedBorder.resolve({WidgetState.disabled}), equals(isA()), ); }); @@ -84,8 +84,8 @@ void main() { ); }); - for (final state in MaterialState.values.toList() - ..remove(MaterialState.disabled)) { + for (final state in WidgetState.values.toList() + ..remove(WidgetState.disabled)) { test('displays mediumGray color with $state', () { expect( outlinedBorder.resolve({state}), @@ -105,9 +105,9 @@ void main() { final outlinedBorder = IoCrosswordTheme.geminiOutlinedButtonThemeData.style!.shape!; - test('displays StadiumBorder with ${MaterialState.disabled}', () { + test('displays StadiumBorder with ${WidgetState.disabled}', () { expect( - outlinedBorder.resolve({MaterialState.disabled}), + outlinedBorder.resolve({WidgetState.disabled}), equals(isA()), ); }); @@ -125,8 +125,8 @@ void main() { ); }); - for (final state in MaterialState.values.toList() - ..remove(MaterialState.disabled)) { + for (final state in WidgetState.values.toList() + ..remove(WidgetState.disabled)) { test('displays GradientOutlinedBorder with $state', () { expect( outlinedBorder.resolve({state}), @@ -159,7 +159,7 @@ void main() { test('background color is IoCrosswordColors.seedBlack', () { expect( - IoCrosswordTheme().themeData.colorScheme.background, + IoCrosswordTheme().themeData.colorScheme.surface, IoCrosswordColors.seedBlack, ); }); @@ -351,18 +351,18 @@ void main() { group('iconButton', () { group('iconColor', () { - test('is mediumGray when ${MaterialState.disabled}', () { + test('is mediumGray when ${WidgetState.disabled}', () { final iconButtonTheme = IoCrosswordTheme().themeData.iconButtonTheme; final property = iconButtonTheme.style!.iconColor!; expect( - property.resolve({MaterialState.disabled}), + property.resolve({WidgetState.disabled}), IoCrosswordColors.mediumGray, ); }); - for (final state in MaterialState.values.toSet() - ..remove(MaterialState.disabled)) { + for (final state in WidgetState.values.toSet() + ..remove(WidgetState.disabled)) { test('is seedWhite when $state', () { final iconButtonTheme = IoCrosswordTheme().themeData.iconButtonTheme; diff --git a/packages/io_crossword_ui/test/src/theme/teams/io_android_theme_test.dart b/packages/io_crossword_ui/test/src/theme/teams/io_android_theme_test.dart index e9edf2fea..1ff7419fc 100644 --- a/packages/io_crossword_ui/test/src/theme/teams/io_android_theme_test.dart +++ b/packages/io_crossword_ui/test/src/theme/teams/io_android_theme_test.dart @@ -12,9 +12,9 @@ void main() { final outlinedBorder = IoAndroidTheme().themeData.outlinedButtonTheme.style!.shape!; - test('displays StadiumBorder with ${MaterialState.disabled}', () { + test('displays StadiumBorder with ${WidgetState.disabled}', () { expect( - outlinedBorder.resolve({MaterialState.disabled}), + outlinedBorder.resolve({WidgetState.disabled}), equals(isA()), ); }); @@ -32,8 +32,8 @@ void main() { ); }); - for (final state in MaterialState.values.toList() - ..remove(MaterialState.disabled)) { + for (final state in WidgetState.values.toList() + ..remove(WidgetState.disabled)) { test('displays GradientOutlinedBorder with $state', () { expect( outlinedBorder.resolve({state}), diff --git a/packages/io_crossword_ui/test/src/theme/teams/io_chrome_theme_test.dart b/packages/io_crossword_ui/test/src/theme/teams/io_chrome_theme_test.dart index e081462f1..a95fa029d 100644 --- a/packages/io_crossword_ui/test/src/theme/teams/io_chrome_theme_test.dart +++ b/packages/io_crossword_ui/test/src/theme/teams/io_chrome_theme_test.dart @@ -12,9 +12,9 @@ void main() { final outlinedBorder = IoChromeTheme().themeData.outlinedButtonTheme.style!.shape!; - test('displays StadiumBorder with ${MaterialState.disabled}', () { + test('displays StadiumBorder with ${WidgetState.disabled}', () { expect( - outlinedBorder.resolve({MaterialState.disabled}), + outlinedBorder.resolve({WidgetState.disabled}), equals(isA()), ); }); @@ -32,8 +32,8 @@ void main() { ); }); - for (final state in MaterialState.values.toList() - ..remove(MaterialState.disabled)) { + for (final state in WidgetState.values.toList() + ..remove(WidgetState.disabled)) { test('displays GradientOutlinedBorder with $state', () { expect( outlinedBorder.resolve({state}), diff --git a/packages/io_crossword_ui/test/src/theme/teams/io_firebase_theme_test.dart b/packages/io_crossword_ui/test/src/theme/teams/io_firebase_theme_test.dart index 7d519dd67..8c5117e4b 100644 --- a/packages/io_crossword_ui/test/src/theme/teams/io_firebase_theme_test.dart +++ b/packages/io_crossword_ui/test/src/theme/teams/io_firebase_theme_test.dart @@ -12,9 +12,9 @@ void main() { final outlinedBorder = IoFirebaseTheme().themeData.outlinedButtonTheme.style!.shape!; - test('displays StadiumBorder with ${MaterialState.disabled}', () { + test('displays StadiumBorder with ${WidgetState.disabled}', () { expect( - outlinedBorder.resolve({MaterialState.disabled}), + outlinedBorder.resolve({WidgetState.disabled}), equals(isA()), ); }); @@ -32,8 +32,8 @@ void main() { ); }); - for (final state in MaterialState.values.toList() - ..remove(MaterialState.disabled)) { + for (final state in WidgetState.values.toList() + ..remove(WidgetState.disabled)) { test('displays GradientOutlinedBorder with $state', () { expect( outlinedBorder.resolve({state}), diff --git a/packages/io_crossword_ui/test/src/theme/teams/io_flutter_theme_test.dart b/packages/io_crossword_ui/test/src/theme/teams/io_flutter_theme_test.dart index 163bd50d3..3995b4cec 100644 --- a/packages/io_crossword_ui/test/src/theme/teams/io_flutter_theme_test.dart +++ b/packages/io_crossword_ui/test/src/theme/teams/io_flutter_theme_test.dart @@ -12,9 +12,9 @@ void main() { final outlinedBorder = IoFlutterTheme().themeData.outlinedButtonTheme.style!.shape!; - test('displays StadiumBorder with ${MaterialState.disabled}', () { + test('displays StadiumBorder with ${WidgetState.disabled}', () { expect( - outlinedBorder.resolve({MaterialState.disabled}), + outlinedBorder.resolve({WidgetState.disabled}), equals(isA()), ); }); @@ -32,8 +32,8 @@ void main() { ); }); - for (final state in MaterialState.values.toList() - ..remove(MaterialState.disabled)) { + for (final state in WidgetState.values.toList() + ..remove(WidgetState.disabled)) { test('displays GradientOutlinedBorder with $state', () { expect( outlinedBorder.resolve({state}), diff --git a/packages/io_crossword_ui/test/src/widgets/io_crossword_card_test.dart b/packages/io_crossword_ui/test/src/widgets/io_crossword_card_test.dart index 4d9889264..d59d7e8a4 100644 --- a/packages/io_crossword_ui/test/src/widgets/io_crossword_card_test.dart +++ b/packages/io_crossword_ui/test/src/widgets/io_crossword_card_test.dart @@ -73,7 +73,7 @@ class _GoldenSubject extends StatelessWidget { return Theme( data: themeData, child: ColoredBox( - color: themeData.colorScheme.background, + color: themeData.colorScheme.surface, child: Center(child: child), ), ); diff --git a/packages/io_crossword_ui/test/src/widgets/io_crossword_letter_test.dart b/packages/io_crossword_ui/test/src/widgets/io_crossword_letter_test.dart index 4d0f55e1a..9ec6cb46c 100644 --- a/packages/io_crossword_ui/test/src/widgets/io_crossword_letter_test.dart +++ b/packages/io_crossword_ui/test/src/widgets/io_crossword_letter_test.dart @@ -290,7 +290,7 @@ class _GoldenSubject extends StatelessWidget { child: Directionality( textDirection: TextDirection.ltr, child: ColoredBox( - color: themeData.colorScheme.background, + color: themeData.colorScheme.surface, child: Center( child: SizedBox.square(dimension: 50, child: child), ), diff --git a/packages/io_crossword_ui/test/src/widgets/io_linear_progress_indicator_test.dart b/packages/io_crossword_ui/test/src/widgets/io_linear_progress_indicator_test.dart index 594859985..16bc882e4 100644 --- a/packages/io_crossword_ui/test/src/widgets/io_linear_progress_indicator_test.dart +++ b/packages/io_crossword_ui/test/src/widgets/io_linear_progress_indicator_test.dart @@ -111,7 +111,7 @@ class _GoldenSubject extends StatelessWidget { return Theme( data: themeData, child: ColoredBox( - color: themeData.colorScheme.background, + color: themeData.colorScheme.surface, child: Center(child: child), ), ); diff --git a/packages/io_crossword_ui/test/src/widgets/io_physical_model_test.dart b/packages/io_crossword_ui/test/src/widgets/io_physical_model_test.dart index 39a99d1ac..ef6b5748c 100644 --- a/packages/io_crossword_ui/test/src/widgets/io_physical_model_test.dart +++ b/packages/io_crossword_ui/test/src/widgets/io_physical_model_test.dart @@ -225,7 +225,7 @@ class _GoldenSubject extends StatelessWidget { child: Directionality( textDirection: TextDirection.ltr, child: ColoredBox( - color: themeData.colorScheme.background, + color: themeData.colorScheme.surface, child: Center(child: child), ), ), diff --git a/packages/io_crossword_ui/test/src/widgets/io_word_input_test.dart b/packages/io_crossword_ui/test/src/widgets/io_word_input_test.dart index 3c9e6c11b..1713c692b 100644 --- a/packages/io_crossword_ui/test/src/widgets/io_word_input_test.dart +++ b/packages/io_crossword_ui/test/src/widgets/io_word_input_test.dart @@ -598,7 +598,7 @@ class _GoldenSubject extends StatelessWidget { child: Directionality( textDirection: TextDirection.ltr, child: ColoredBox( - color: themeData.colorScheme.background, + color: themeData.colorScheme.surface, child: Center(child: child), ), ), diff --git a/packages/io_crossword_ui/test/src/widgets/io_word_test.dart b/packages/io_crossword_ui/test/src/widgets/io_word_test.dart index b96bbc02f..6ba15e654 100644 --- a/packages/io_crossword_ui/test/src/widgets/io_word_test.dart +++ b/packages/io_crossword_ui/test/src/widgets/io_word_test.dart @@ -302,7 +302,7 @@ class _GoldenSubject extends StatelessWidget { return Directionality( textDirection: TextDirection.ltr, child: ColoredBox( - color: themeData.colorScheme.background, + color: themeData.colorScheme.surface, child: Center(child: child), ), ); From da011e068291bbfe7b4b304d7c34b996730e0e3a Mon Sep 17 00:00:00 2001 From: Jaime Sanchez Date: Tue, 21 May 2024 18:54:44 +0200 Subject: [PATCH 7/9] docs: format correctly --- web/flutter_bootstrap.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/flutter_bootstrap.js b/web/flutter_bootstrap.js index 3a3d87c7c..161e28a52 100644 --- a/web/flutter_bootstrap.js +++ b/web/flutter_bootstrap.js @@ -1,4 +1,5 @@ -/** Keep in mind that this file is not a real javascript file, it is a template +/** + * Keep in mind that this file is not a real javascript file, it is a template * that will be processed by the build system to generate the final javascript * file. Therefore, we use the {@link https://mustache.github.io/mustache.5.html mustache syntax} to inject * values and you might see some linter errors in this file. From 32e22c86f1c2e88cd74702b715e0a2bb8b27be6d Mon Sep 17 00:00:00 2001 From: Jaime Sanchez Date: Tue, 21 May 2024 20:02:02 +0200 Subject: [PATCH 8/9] chore: update dependencies --- packages/api_client/pubspec.yaml | 3 --- pubspec.lock | 24 ------------------------ 2 files changed, 27 deletions(-) diff --git a/packages/api_client/pubspec.yaml b/packages/api_client/pubspec.yaml index 5d813d5bd..09b3652cf 100644 --- a/packages/api_client/pubspec.yaml +++ b/packages/api_client/pubspec.yaml @@ -16,6 +16,3 @@ dependencies: game_domain: path: ../../api/packages/game_domain http: ^1.2.1 - -dependency_overrides: - pointycastle: ^3.9.1 \ No newline at end of file diff --git a/pubspec.lock b/pubspec.lock index 8090fae80..ac43db0c4 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -40,14 +40,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.4.2" - asn1lib: - dependency: transitive - description: - name: asn1lib - sha256: c9c85fedbe2188b95133cbe960e16f5f448860f7133330e272edbbca5893ddc6 - url: "https://pub.dev" - source: hosted - version: "1.5.2" async: dependency: transitive description: @@ -341,14 +333,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.4.1" - encrypt: - dependency: transitive - description: - name: encrypt - sha256: "62d9aa4670cc2a8798bab89b39fc71b6dfbacf615de6cf5001fb39f7e4a996a2" - url: "https://pub.dev" - source: hosted - version: "5.0.3" equatable: dependency: "direct main" description: @@ -830,14 +814,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.8" - pointycastle: - dependency: transitive - description: - name: pointycastle - sha256: "4be0097fcf3fd3e8449e53730c631200ebc7b88016acecab2b0da2f0149222fe" - url: "https://pub.dev" - source: hosted - version: "3.9.1" pool: dependency: transitive description: From ea0f66074330cb4331f705c3595465986fde9988 Mon Sep 17 00:00:00 2001 From: Jaime Sanchez Date: Tue, 21 May 2024 20:21:05 +0200 Subject: [PATCH 9/9] fix: set scaffold and dialog background colors --- packages/io_crossword_ui/lib/src/theme/io_crossword_theme.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/io_crossword_ui/lib/src/theme/io_crossword_theme.dart b/packages/io_crossword_ui/lib/src/theme/io_crossword_theme.dart index 77f0f575d..6ea3b1464 100644 --- a/packages/io_crossword_ui/lib/src/theme/io_crossword_theme.dart +++ b/packages/io_crossword_ui/lib/src/theme/io_crossword_theme.dart @@ -27,6 +27,8 @@ class IoCrosswordTheme { return ThemeData( useMaterial3: true, colorScheme: colorScheme, + scaffoldBackgroundColor: colorScheme.surface, + dialogBackgroundColor: colorScheme.surface, textTheme: _textTheme.textTheme, tabBarTheme: _tabBarTheme, cardColor: _cardTheme.plain.color,