From f88510ddcad2d08ebb991901f6fd5c9a53f88800 Mon Sep 17 00:00:00 2001 From: Eli <88557639+lishaduck@users.noreply.github.com> Date: Fri, 20 Sep 2024 08:17:49 -0500 Subject: [PATCH] chore(deps): bump flutter, auto_route and appwrite Which requires bumping freezed and downgrading riverpod from the v3 alpha. It also requires regenerating the web files. --- .github/workflows/dart.yaml | 3 + lib/app/app.dart | 12 +- lib/app/app_router.dart | 13 +- .../presentation/auth_page/auth_page.dart | 2 +- .../wrapper_page/wrapper_page.dart | 2 +- .../pirate_coins/domain/coins_model.dart | 5 +- .../pirate_coins_page/pirate_coins_page.dart | 2 +- .../presentation/stats_page/stats_page.dart | 2 +- pubspec.lock | 185 +++++++++--------- pubspec.yaml | 24 +-- .../wrapper_page/wrapper_page_test.dart | 2 +- test/helpers/mocks.dart | 1 - test/helpers/pump_app.dart | 2 - test/helpers/riverpod.dart | 2 - web/flutter_bootstrap.js | 85 ++++++++ web/index.html | 164 +++------------- 16 files changed, 238 insertions(+), 268 deletions(-) create mode 100644 web/flutter_bootstrap.js diff --git a/.github/workflows/dart.yaml b/.github/workflows/dart.yaml index 0dc160b5..5bd228fe 100644 --- a/.github/workflows/dart.yaml +++ b/.github/workflows/dart.yaml @@ -201,6 +201,9 @@ jobs: dart run build_runner build -d - name: 🕵️ Analyze project source run: flutter analyze --fatal-infos + - name: Clean Flutter generated files + # Works around invertase/dart_custom_lint#271 + run: melos run clean - name: 🕵️ Run Custom Lint Rules run: dart run custom_lint --fatal-infos diff --git a/lib/app/app.dart b/lib/app/app.dart index cde4df28..aaae2756 100644 --- a/lib/app/app.dart +++ b/lib/app/app.dart @@ -6,6 +6,7 @@ import "package:hooks_riverpod/hooks_riverpod.dart"; import "../../l10n/l10n.dart"; import "../features/auth/application/auth_service.dart"; +import "../features/auth/domain/pirate_user_entity.dart"; import "../utils/design.dart"; import "../utils/router.dart"; import "boostrap.dart"; @@ -47,10 +48,13 @@ class _EagerInitialization extends ConsumerWidget { return ColoredBox( color: theme.colorScheme.surfaceContainerHighest, - child: switch (user) { - AsyncData() || AsyncError() => child, - AsyncLoading() => const Center(child: CircularProgressIndicator()), - }, + child: Center( + child: switch (user) { + AsyncData _ => child, + AsyncError(:final error) => Text("Error: $error"), + _ => const CircularProgressIndicator(), + }, + ), ); } } diff --git a/lib/app/app_router.dart b/lib/app/app_router.dart index 2d0b7595..ee2193f8 100644 --- a/lib/app/app_router.dart +++ b/lib/app/app_router.dart @@ -5,18 +5,11 @@ import "package:auto_route/auto_route.dart"; import "package:hooks_riverpod/hooks_riverpod.dart"; import "../features/auth/application/auth_service.dart"; -import "../features/auth/presentation/auth_page/auth_page.dart"; -import "../features/dashboard/presentation/dashboard_page/dashboard_page.dart"; -import "../features/dashboard/presentation/wrapper_page/wrapper_page.dart"; -import "../features/gpa_calculator/presentation/gpa_page/gpa_page.dart"; -import "../features/pirate_coins/presentation/pirate_coins_page/pirate_coins_page.dart"; -import "../features/pirate_coins/presentation/stats_page/stats_page.dart"; - -part "app_router.gr.dart"; +import "app_router.gr.dart"; /// The router for the application. -@AutoRouterConfig(replaceInRouteName: "Page,Route") -class AppRouter extends _$AppRouter { +@AutoRouterConfig(replaceInRouteName: "Page,Route", deferredLoading: true) +class AppRouter extends RootStackRouter { /// Create a new instance of [AppRouter]. AppRouter({required this.ref}); diff --git a/lib/features/auth/presentation/auth_page/auth_page.dart b/lib/features/auth/presentation/auth_page/auth_page.dart index c8ca28c3..94c75408 100644 --- a/lib/features/auth/presentation/auth_page/auth_page.dart +++ b/lib/features/auth/presentation/auth_page/auth_page.dart @@ -6,7 +6,7 @@ import "package:auto_size_text/auto_size_text.dart"; import "package:flutter/material.dart"; import "package:hooks_riverpod/hooks_riverpod.dart"; -import "../../../../app/app_router.dart"; +import "../../../../app/app_router.gr.dart"; import "../../../../l10n/l10n.dart"; import "../../application/auth_service.dart"; diff --git a/lib/features/dashboard/presentation/wrapper_page/wrapper_page.dart b/lib/features/dashboard/presentation/wrapper_page/wrapper_page.dart index 1e643888..9579283d 100644 --- a/lib/features/dashboard/presentation/wrapper_page/wrapper_page.dart +++ b/lib/features/dashboard/presentation/wrapper_page/wrapper_page.dart @@ -10,7 +10,7 @@ import "package:flutter_hooks/flutter_hooks.dart"; import "package:hooks_riverpod/hooks_riverpod.dart"; import "package:url_launcher/link.dart"; -import "../../../../app/app_router.dart"; +import "../../../../app/app_router.gr.dart"; import "../../../../gen/assets.gen.dart"; import "../../../../gen/fonts.gen.dart"; import "../../../../gen/version.gen.dart"; diff --git a/lib/features/pirate_coins/domain/coins_model.dart b/lib/features/pirate_coins/domain/coins_model.dart index 211c6d0e..b436f2ae 100644 --- a/lib/features/pirate_coins/domain/coins_model.dart +++ b/lib/features/pirate_coins/domain/coins_model.dart @@ -33,8 +33,5 @@ sealed class Stage with _$Stage { const factory Stage.pickStudent() = PickStudentStage; /// Represent the stage of the coins page where the teacher can view and add to a student's [CoinEntity]s. - - const factory Stage.viewCoins({ - required int student, - }) = ViewCoinsStage; + const factory Stage.viewCoins({required int student}) = ViewCoinsStage; } diff --git a/lib/features/pirate_coins/presentation/pirate_coins_page/pirate_coins_page.dart b/lib/features/pirate_coins/presentation/pirate_coins_page/pirate_coins_page.dart index f775af0e..6046649b 100644 --- a/lib/features/pirate_coins/presentation/pirate_coins_page/pirate_coins_page.dart +++ b/lib/features/pirate_coins/presentation/pirate_coins_page/pirate_coins_page.dart @@ -239,7 +239,7 @@ class _ViewCoins extends StatelessWidget { child: switch (data) { AsyncData(:final value) => BigCard("${value.coins.coins}"), AsyncError(:final error) => BigCard(l10n.error("$error")), - AsyncLoading() => Column( + _ => Column( children: [ const CircularProgressIndicator(), AutoSizeText(l10n.loading), diff --git a/lib/features/pirate_coins/presentation/stats_page/stats_page.dart b/lib/features/pirate_coins/presentation/stats_page/stats_page.dart index cfd2dec3..ef6ad053 100644 --- a/lib/features/pirate_coins/presentation/stats_page/stats_page.dart +++ b/lib/features/pirate_coins/presentation/stats_page/stats_page.dart @@ -32,7 +32,7 @@ class StatsPage extends ConsumerWidget { ? BigCard(l10n.howManyCoins(value.coins.coins)) : BigCard(l10n.emptyReport), AsyncError(:final error) => BigCard(l10n.error("$error")), - AsyncLoading() => Column( + _ => Column( children: [ const CircularProgressIndicator(), AutoSizeText(l10n.loading), diff --git a/pubspec.lock b/pubspec.lock index 9d2f5971..ff43f133 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,18 +5,23 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7" + sha256: f256b0c0ba6c7577c15e2e4e114755640a875e885099367bf6e012b19314c834 url: "https://pub.dev" source: hosted - version: "67.0.0" + version: "72.0.0" + _macros: + dependency: transitive + description: dart + source: sdk + version: "0.3.2" analyzer: dependency: transitive description: name: analyzer - sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d" + sha256: b652861553cd3990d8ed361f7979dc6d7053a9ac8843fa73820ab68ce5410139 url: "https://pub.dev" source: hosted - version: "6.4.1" + version: "6.7.0" analyzer_plugin: dependency: transitive description: @@ -37,10 +42,10 @@ packages: dependency: "direct main" description: name: appwrite - sha256: c717091605055873e0c8d282059e0c07405c54ece6af1e5ec03ebada1c3ea554 + sha256: "0d12a8aa778e4748de068bcdacda7adca181b888b14c698389b7b03364526a10" url: "https://pub.dev" source: hosted - version: "12.0.4" + version: "13.0.0" archive: dependency: transitive description: @@ -69,18 +74,18 @@ packages: dependency: "direct main" description: name: auto_route - sha256: a9001a90539ca3effc168f7e1029a5885c7326b9032c09ac895e303c1d137704 + sha256: b83e8ce46da7228cdd019b5a11205454847f0a971bca59a7529b98df9876889b url: "https://pub.dev" source: hosted - version: "8.3.0" + version: "9.2.2" auto_route_generator: dependency: "direct dev" description: name: auto_route_generator - sha256: a21d7a936c917488653c972f62d884d8adcf8c5d37acc7cd24da33cf784546c0 + sha256: c9086eb07271e51b44071ad5cff34e889f3156710b964a308c2ab590769e79e6 url: "https://pub.dev" source: hosted - version: "8.1.0" + version: "9.0.0" auto_size_text: dependency: "direct main" description: @@ -209,14 +214,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.0" - charcode: - dependency: transitive - description: - name: charcode - sha256: fb98c0f6d12c920a02ee2d998da788bca066ca5f148492b7085ee23372b12306 - url: "https://pub.dev" - source: hosted - version: "1.3.1" checked_yaml: dependency: transitive description: @@ -333,26 +330,26 @@ packages: dependency: "direct dev" description: name: custom_lint - sha256: "22bd87a362f433ba6aae127a7bac2838645270737f3721b180916d7c5946cb5d" + sha256: "6e1ec47427ca968f22bce734d00028ae7084361999b41673291138945c5baca0" url: "https://pub.dev" source: hosted - version: "0.5.11" + version: "0.6.7" custom_lint_builder: dependency: transitive description: name: custom_lint_builder - sha256: "0d48e002438950f9582e574ef806b2bea5719d8d14c0f9f754fbad729bcf3b19" + sha256: ba2f90fff4eff71d202d097eb14b14f87087eaaef742e956208c0eb9d3a40a21 url: "https://pub.dev" source: hosted - version: "0.5.14" + version: "0.6.7" custom_lint_core: dependency: transitive description: name: custom_lint_core - sha256: "2952837953022de610dacb464f045594854ced6506ac7f76af28d4a6490e189b" + sha256: "4ddbbdaa774265de44c97054dcec058a83d9081d071785ece601e348c18c267d" url: "https://pub.dev" source: hosted - version: "0.5.14" + version: "0.6.5" dart_style: dependency: transitive description: @@ -373,18 +370,18 @@ packages: dependency: transitive description: name: device_info_plus - sha256: eead12d1a1ed83d8283ab4c2f3fca23ac4082f29f25f29dff0f758f57d06ec91 + sha256: a7fd703482b391a87d60b6061d04dfdeab07826b96f9abd8f5ed98068acc0074 url: "https://pub.dev" source: hosted - version: "10.1.0" + version: "10.1.2" device_info_plus_platform_interface: dependency: transitive description: name: device_info_plus_platform_interface - sha256: d3b01d5868b50ae571cd1dc6e502fc94d956b665756180f7b16ead09e836fd64 + sha256: "282d3cf731045a2feb66abfe61bbc40870ae50a3ed10a4d3d217556c35c8c2ba" url: "https://pub.dev" source: hosted - version: "7.0.0" + version: "7.0.1" dhttpd: dependency: "direct dev" description: @@ -503,10 +500,10 @@ packages: dependency: transitive description: name: flutter_riverpod - sha256: "2fd9f58a39b7269cb3495b09245000fcd267243518157a7c2f832189fb64f013" + sha256: "0f1974eff5bbe774bf1d870e406fc6f29e3d6f1c46bd9c58e7172ff68a785d7d" url: "https://pub.dev" source: hosted - version: "3.0.0-dev.3" + version: "2.5.1" flutter_test: dependency: "direct dev" description: flutter @@ -537,10 +534,10 @@ packages: dependency: "direct dev" description: name: freezed - sha256: a434911f643466d78462625df76fd9eb13e57348ff43fe1f77bbe909522c67a1 + sha256: "44c19278dd9d89292cf46e97dc0c1e52ce03275f40a97c5a348e802a924bf40e" url: "https://pub.dev" source: hosted - version: "2.5.2" + version: "2.5.7" freezed_annotation: dependency: "direct main" description: @@ -553,10 +550,10 @@ packages: dependency: "direct dev" description: name: freezed_lint - sha256: f48f9c0f2c5f4a95b0e2b06efecea8accc3ef8213128dac9bb7005c64ad9ecff + sha256: "7b284ee7f10d8fed9e7e38bf3041a2735f3d69731b542164d1f17dfe7e0a7815" url: "https://pub.dev" source: hosted - version: "0.0.1-dev+1" + version: "0.0.5" frontend_server_client: dependency: transitive description: @@ -593,10 +590,10 @@ packages: dependency: "direct main" description: name: hooks_riverpod - sha256: "169d7bf1d61c749c065e09388841906b2ff963794b932867372ed4f423a8d877" + sha256: "97266a91c994951a06ef0ff3a1c7fb261e52ec7f74e87f0614ea0b7411b859b2" url: "https://pub.dev" source: hosted - version: "3.0.0-dev.3" + version: "2.5.2" hotreloader: dependency: transitive description: @@ -617,10 +614,10 @@ packages: dependency: transitive description: name: http - sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938" + sha256: b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010 url: "https://pub.dev" source: hosted - version: "1.2.1" + version: "1.2.2" http_multi_server: dependency: transitive description: @@ -705,18 +702,18 @@ packages: dependency: transitive description: name: leak_tracker - sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" + sha256: "3f87a60e8c63aecc975dda1ceedbc8f24de75f09e4856ea27daf8958f2f0ce05" url: "https://pub.dev" source: hosted - version: "10.0.4" + version: "10.0.5" leak_tracker_flutter_testing: dependency: transitive description: name: leak_tracker_flutter_testing - sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" + sha256: "932549fb305594d82d7183ecd9fa93463e9914e1b67cacc34bc40906594a1806" url: "https://pub.dev" source: hosted - version: "3.0.3" + version: "3.0.5" leak_tracker_testing: dependency: transitive description: @@ -741,6 +738,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.2.0" + macros: + dependency: transitive + description: + name: macros + sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536" + url: "https://pub.dev" + source: hosted + version: "0.1.2-main.4" markdown: dependency: transitive description: @@ -777,18 +782,18 @@ packages: dependency: transitive description: name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec url: "https://pub.dev" source: hosted - version: "0.8.0" + version: "0.11.1" meta: dependency: transitive description: name: meta - sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 url: "https://pub.dev" source: hosted - version: "1.12.0" + version: "1.15.0" mime: dependency: transitive description: @@ -841,18 +846,18 @@ packages: dependency: transitive description: name: package_info_plus - sha256: b93d8b4d624b4ea19b0a5a208b2d6eff06004bc3ce74c06040b120eeadd00ce0 + sha256: a75164ade98cb7d24cfd0a13c6408927c6b217fa60dee5a7ff5c116a58f28918 url: "https://pub.dev" source: hosted - version: "8.0.0" + version: "8.0.2" package_info_plus_platform_interface: dependency: transitive description: name: package_info_plus_platform_interface - sha256: f49918f3433a3146047372f9d4f1f847511f2acd5cd030e1f44fe5a50036b70e + sha256: ac1f4a4847f1ade8e6a87d1f39f5d7c67490738642e2542f559ec38c37489a66 url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "3.0.1" pana: dependency: transitive description: @@ -881,10 +886,10 @@ packages: dependency: transitive description: name: path_provider - sha256: c9e7d3a4cd1410877472158bee69963a4579f78b68c65a2b7d40d1a7a88bb161 + sha256: fec0d61223fba3154d87759e3cc27fe2c8dc498f6386c6d6fc80d1afdd1bf378 url: "https://pub.dev" source: hosted - version: "2.1.3" + version: "2.1.4" path_provider_android: dependency: transitive description: @@ -1017,50 +1022,50 @@ packages: dependency: transitive description: name: riverpod - sha256: "0f41a697a17609a7ac18e5fe0d5bdbe4c1ff7e7da6523baf46a203df0c44eaf2" + sha256: f21b32ffd26a36555e501b04f4a5dca43ed59e16343f1a30c13632b2351dfa4d url: "https://pub.dev" source: hosted - version: "3.0.0-dev.3" + version: "2.5.1" riverpod_analyzer_utils: dependency: transitive description: name: riverpod_analyzer_utils - sha256: b6e782db97522de3ad797210bd3babbdb0a67da899aaa6ffbb6572108bdbf48d + sha256: ac28d7bc678471ec986b42d88e5a0893513382ff7542c7ac9634463b044ac72c url: "https://pub.dev" source: hosted - version: "1.0.0-dev.1" + version: "0.5.4" riverpod_annotation: dependency: "direct main" description: name: riverpod_annotation - sha256: "79452c7ba2e8f48c7309c73be5aaa101eec5fe7948dfd26659b883fb276858b4" + sha256: e5e796c0eba4030c704e9dae1b834a6541814963292839dcf9638d53eba84f5c url: "https://pub.dev" source: hosted - version: "3.0.0-dev.3" + version: "2.3.5" riverpod_generator: dependency: "direct dev" description: name: riverpod_generator - sha256: "9f3cb7b43e9151fef1cc80031b3ad9fb5d0fe64577cc18e1627061d743823213" + sha256: "63311e361ffc578d655dfc31b48dfa4ed3bc76fd06f9be845e9bf97c5c11a429" url: "https://pub.dev" source: hosted - version: "3.0.0-dev.11" + version: "2.4.3" riverpod_lint: dependency: "direct dev" description: name: riverpod_lint - sha256: "8ddb6be92f0de4704d6109405aebc7436b15b847abf0d9f647039afe48dc0050" + sha256: a35a92f2c2a4b7a5d95671c96c5432b42c20f26bb3e985e83d0b186471b61a85 url: "https://pub.dev" source: hosted - version: "3.0.0-dev.4" + version: "2.3.13" rxdart: dependency: transitive description: name: rxdart - sha256: "0c7c0cedd93788d996e33041ffecda924cc54389199cde4e6a34b440f50044cb" + sha256: "5c3004a4a8dbb94bd4bf5412a4def4acdaa12e12f269737a5751369e12d1a962" url: "https://pub.dev" source: hosted - version: "0.27.7" + version: "0.28.0" safe_url_check: dependency: transitive description: @@ -1105,10 +1110,10 @@ packages: dependency: transitive description: name: shelf_web_socket - sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" + sha256: "073c147238594ecd0d193f3456a5fe91c4b0abbcc68bf5cd95b36c4e194ac611" url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "2.0.0" sky_engine: dependency: transitive description: flutter @@ -1222,26 +1227,26 @@ packages: dependency: transitive description: name: test - sha256: "7ee446762c2c50b3bd4ea96fe13ffac69919352bd3b4b17bac3f3465edc58073" + sha256: "7ee44229615f8f642b68120165ae4c2a75fe77ae2065b1e55ae4711f6cf0899e" url: "https://pub.dev" source: hosted - version: "1.25.2" + version: "1.25.7" test_api: dependency: transitive description: name: test_api - sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" + sha256: "5b8a98dafc4d5c4c9c72d8b31ab2b23fc13422348d2997120294d3bac86b4ddb" url: "https://pub.dev" source: hosted - version: "0.7.0" + version: "0.7.2" test_core: dependency: transitive description: name: test_core - sha256: "2bc4b4ecddd75309300d8096f781c0e3280ca1ef85beda558d33fcbedc2eead4" + sha256: "55ea5a652e38a1dfb32943a7973f3681a60f872f8c3a05a14664ad54ef9c6696" url: "https://pub.dev" source: hosted - version: "0.6.0" + version: "0.6.4" time: dependency: transitive description: @@ -1266,14 +1271,6 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.2" - universal_html: - dependency: transitive - description: - name: universal_html - sha256: "56536254004e24d9d8cfdb7dbbf09b74cf8df96729f38a2f5c238163e3d58971" - url: "https://pub.dev" - source: hosted - version: "2.2.4" universal_io: dependency: transitive description: @@ -1334,10 +1331,10 @@ packages: dependency: transitive description: name: url_launcher_web - sha256: "8d9e750d8c9338601e709cd0885f95825086bd8b642547f26bda435aade95d8a" + sha256: "772638d3b34c779ede05ba3d38af34657a05ac55b06279ea6edd409e323dca8e" url: "https://pub.dev" source: hosted - version: "2.3.1" + version: "2.3.3" url_launcher_windows: dependency: transitive description: @@ -1406,10 +1403,10 @@ packages: dependency: transitive description: name: vm_service - sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" + sha256: "5c5f338a667b4c644744b661f309fb8080bb94b18a7e91ef1dbd343bed00ed6d" url: "https://pub.dev" source: hosted - version: "14.2.1" + version: "14.2.5" watcher: dependency: transitive description: @@ -1422,18 +1419,26 @@ packages: dependency: transitive description: name: web - sha256: "97da13628db363c635202ad97068d47c5b8aa555808e7a9411963c533b449b27" + sha256: d43c1d6b787bf0afad444700ae7f4db8827f701bc61c255ac8d328c6f4d52062 + url: "https://pub.dev" + source: hosted + version: "1.0.0" + web_socket: + dependency: transitive + description: + name: web_socket + sha256: "3c12d96c0c9a4eec095246debcea7b86c0324f22df69893d538fcc6f1b8cce83" url: "https://pub.dev" source: hosted - version: "0.5.1" + version: "0.1.6" web_socket_channel: dependency: transitive description: name: web_socket_channel - sha256: "58c6666b342a38816b2e7e50ed0f1e261959630becd4c879c4f26bfa14aa5a42" + sha256: "9f187088ed104edd8662ca07af4b124465893caf063ba29758f97af57e61da8f" url: "https://pub.dev" source: hosted - version: "2.4.5" + version: "3.0.1" webkit_inspection_protocol: dependency: transitive description: @@ -1491,5 +1496,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.4.0 <3.6.0" - flutter: ">=3.22.1" + dart: ">=3.5.0 <3.6.0" + flutter: ">=3.24.3" diff --git a/pubspec.yaml b/pubspec.yaml index 779bf52c..4dfa6058 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -23,8 +23,8 @@ issue_tracker: https://github.com/PSDTools/app/issues repository: https://github.com/PSDTools/app.git environment: - sdk: ">=3.3.0 <4.0.0" - flutter: "3.22.1" + sdk: ">=3.5.0 <4.0.0" + flutter: "3.24.3" # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions @@ -33,8 +33,8 @@ environment: # the latest version available on pub.dev. To see which dependencies have newer # versions available, run `flutter pub outdated`. dependencies: - appwrite: ^12.0.4 - auto_route: ^8.3.0 + appwrite: ^13.0.0 + auto_route: ^9.2.2 auto_size_text: ^3.0.0 build_version: ^2.1.1 # The following adds the Cupertino Icons font to your application. @@ -49,18 +49,18 @@ dependencies: flutter_web_plugins: sdk: flutter freezed_annotation: ^2.4.4 - hooks_riverpod: ^3.0.0-dev.3 + hooks_riverpod: ^2.5.2 intl: ^0.19.0 json_annotation: ^4.9.0 os_detect: ^2.0.1 - riverpod_annotation: ^3.0.0-dev.3 + riverpod_annotation: ^2.3.5 url_launcher: ^6.3.0 dev_dependencies: - auto_route_generator: ^8.1.0 + auto_route_generator: ^9.0.0 build_runner: ^2.4.11 build_web_compilers: ^4.0.10 - custom_lint: ^0.5.11 + custom_lint: ^0.6.7 dhttpd: ^4.1.0 envied_generator: ^0.5.4+1 flutter_gen_runner: ^5.7.0 @@ -68,14 +68,14 @@ dev_dependencies: flutter_native_splash: ^2.4.1 flutter_test: # Required for a Flutter project that includes tests sdk: flutter - freezed: ^2.5.2 + freezed: ^2.5.7 # integration_test: # sdk: flutter - freezed_lint: ^0.0.1-dev+1 + freezed_lint: ^0.0.5 json_serializable: ^6.8.0 mocktail: ^1.0.4 - riverpod_generator: ^3.0.0-dev.11 - riverpod_lint: ^3.0.0-dev.4 + riverpod_generator: ^2.4.2 + riverpod_lint: ^2.3.13 very_good_analysis: ^6.0.0 very_good_cli: ^0.22.2 diff --git a/test/features/dashboard/presentation/wrapper_page/wrapper_page_test.dart b/test/features/dashboard/presentation/wrapper_page/wrapper_page_test.dart index 490a8b6b..69c5cbc9 100644 --- a/test/features/dashboard/presentation/wrapper_page/wrapper_page_test.dart +++ b/test/features/dashboard/presentation/wrapper_page/wrapper_page_test.dart @@ -2,7 +2,7 @@ import "package:flutter/material.dart"; import "package:flutter_test/flutter_test.dart"; import "package:hooks_riverpod/hooks_riverpod.dart"; import "package:pirate_code/app/app.dart"; -import "package:pirate_code/app/app_router.dart"; +import "package:pirate_code/app/app_router.gr.dart"; import "package:pirate_code/features/auth/application/auth_service.dart"; import "package:pirate_code/features/auth/data/auth_repository.dart"; import "package:pirate_code/features/dashboard/presentation/wrapper_page/wrapper_page.dart"; diff --git a/test/helpers/mocks.dart b/test/helpers/mocks.dart index 86c6b606..49a6aa32 100644 --- a/test/helpers/mocks.dart +++ b/test/helpers/mocks.dart @@ -6,7 +6,6 @@ import "riverpod.dart"; final Overrides mockOverrides = [ authProvider.overrideWithValue(MockAuthRepository()), - coinsDataProvider.overrideWith((_) => MockCoinsRepository()), ]; class MockAuthRepository extends Mock implements AuthRepository {} diff --git a/test/helpers/pump_app.dart b/test/helpers/pump_app.dart index 2cb3238d..0ae6c47f 100644 --- a/test/helpers/pump_app.dart +++ b/test/helpers/pump_app.dart @@ -17,14 +17,12 @@ extension PumpApp on WidgetTester { /// Pump a [Widget] in a [ProviderScope]. Future pumpApp( Widget widget, { - ProviderContainer? parent, Overrides overrides = const [], List? observers, }) async { return pumpWidget( ProviderScope( overrides: overrides, - parent: parent, observers: observers, child: _Widget( child: widget, diff --git a/test/helpers/riverpod.dart b/test/helpers/riverpod.dart index 2b53057a..79be4651 100644 --- a/test/helpers/riverpod.dart +++ b/test/helpers/riverpod.dart @@ -11,13 +11,11 @@ typedef Overrides = List; /// A testing utility which creates a [ProviderContainer] and automatically /// disposes it at the end of the test. ProviderContainer createContainer({ - ProviderContainer? parent, Overrides overrides = const [], List? observers, }) { // Create a ProviderContainer, and optionally allow specifying parameters. final container = ProviderContainer( - parent: parent, overrides: overrides, observers: observers, ); diff --git a/web/flutter_bootstrap.js b/web/flutter_bootstrap.js new file mode 100644 index 00000000..2d3bdab8 --- /dev/null +++ b/web/flutter_bootstrap.js @@ -0,0 +1,85 @@ +{{flutter_js}} +{{flutter_build_config}} + +const progressBar = document.querySelector("#progress-bar"); +const progressText = document.querySelector("#progress-text"); +const progressIndicator = document.querySelector("#progress-indicator"); + +async function readAssets() { + // NOTE: AssetManifest.json will be deprecated in favour of AssetManifest.bin: + // https://github.com/VeryGoodOpenSource/flutter_web_preloader/issues/28 + const response = await fetch("assets/AssetManifest.json"); + const manifest = await response.json(); + const assets = Object.values(manifest) + .map((list) => list.map((url) => "assets/" + url)) + .reduce((arr, curr) => [...arr, ...curr], []); + return assets; +} + +async function beginPreloading() { + const assets = await readAssets(); + + let totalAssets = assets.length; + if (totalAssets === 0) { + // No assets to load, so we can skip the loading process entirely. + return; + } + + let loadedAssets = 0; + const batchSize = 20; + + progressIndicator.style.width = "0%"; + progressText.textContent = `Loaded ${loadedAssets} of ${totalAssets} assets`; + + async function reportProgress() { + loadedAssets++; + + const value = Math.floor((loadedAssets / totalAssets) * 100) + "%"; + progressIndicator.style.width = value; + + progressText.textContent = `Loaded ${loadedAssets} of ${totalAssets} assets`; + } + + async function load(url) { + try { + const response = await fetch(url); + if (!response.ok) { + throw new Error( + `Failed to load: ${response.status} ${response.statusText}`, + ); + } + return await response.text(); + } catch (error) { + throw new Error("Network error"); + } + } + + async function loadBatch(urls) { + const loadPromises = urls.map(async (url) => { + await load(url); + await reportProgress(); + }); + try { + return await Promise.all(loadPromises); + } catch (error) { + console.error("Error loading one or more asset:", error); + } + } + + for (let i = 0; i < assets.length; i += batchSize) { + const batch = assets.slice(i, i + batchSize); + await loadBatch(batch); + } +} + +_flutter.loader.load({ + serviceWorkerSettings: { + serviceWorkerVersion: {{flutter_service_worker_version}}, + }, + onEntrypointLoaded: async function (engineInitializer) { + await Promise.all([ + beginPreloading(), + engineInitializer.initializeEngine(), + ]).then(([_, appRunner]) => appRunner.runApp()); + }, +}); diff --git a/web/index.html b/web/index.html index ffb3bab1..d9cfff89 100644 --- a/web/index.html +++ b/web/index.html @@ -33,29 +33,15 @@ + - - -