From c100804c61700e9dd4c6330edbb54f63fe8ac391 Mon Sep 17 00:00:00 2001 From: Bruno Mendes Date: Sat, 23 Sep 2023 14:16:42 +0100 Subject: [PATCH 1/8] Stage pubspec lock file --- .gitignore | 1 - uni/.gitignore | 1 - uni/pubspec.lock | 1360 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 1360 insertions(+), 2 deletions(-) create mode 100644 uni/pubspec.lock diff --git a/.gitignore b/.gitignore index aa2b7a871..04c23541d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,6 @@ .pub/ build/ *.bin -uni/pubspec.lock .flutter-plugins* # IDE files diff --git a/uni/.gitignore b/uni/.gitignore index a0cabb6dc..a20521678 100644 --- a/uni/.gitignore +++ b/uni/.gitignore @@ -1,6 +1,5 @@ # Miscellaneous *.class -*.lock *.log *.pyc *.swp diff --git a/uni/pubspec.lock b/uni/pubspec.lock new file mode 100644 index 000000000..e336b67cc --- /dev/null +++ b/uni/pubspec.lock @@ -0,0 +1,1360 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: ae92f5d747aee634b87f89d9946000c2de774be1d6ac3e58268224348cd0101a + url: "https://pub.dev" + source: hosted + version: "61.0.0" + add_2_calendar: + dependency: "direct main" + description: + name: add_2_calendar + sha256: "01a5b15a9385eff803cd84da3d7cda71de7ad807b6c88e44a8ad4acbd80f3b7e" + url: "https://pub.dev" + source: hosted + version: "2.2.3" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: ea3d8652bda62982addfd92fdc2d0214e5f82e43325104990d4f4c4a2a313562 + url: "https://pub.dev" + source: hosted + version: "5.13.0" + animated_stack_widget: + dependency: transitive + description: + name: animated_stack_widget + sha256: ce4788dd158768c9d4388354b6fb72600b78e041a37afc4c279c63ecafcb9408 + url: "https://pub.dev" + source: hosted + version: "0.0.4" + archive: + dependency: transitive + description: + name: archive + sha256: "0c8368c9b3f0abbc193b9d6133649a614204b528982bebc7026372d61677ce3a" + url: "https://pub.dev" + source: hosted + version: "3.3.7" + args: + dependency: transitive + description: + name: args + sha256: eef6c46b622e0494a36c5a12d10d77fb4e855501a91c1b9ef9339326e58f0596 + url: "https://pub.dev" + source: hosted + version: "2.4.2" + asn1lib: + dependency: transitive + description: + name: asn1lib + sha256: "21afe4333076c02877d14f4a89df111e658a6d466cbfc802eb705eb91bd5adfd" + url: "https://pub.dev" + source: hosted + version: "1.5.0" + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + build: + dependency: transitive + description: + name: build + sha256: "80184af8b6cb3e5c1c4ec6d8544d27711700bc3e6d2efad04238c7b5290889f0" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + build_config: + dependency: transitive + description: + name: build_config + sha256: bf80fcfb46a29945b423bd9aad884590fb1dc69b330a4d4700cac476af1708d1 + url: "https://pub.dev" + source: hosted + version: "1.1.1" + build_daemon: + dependency: transitive + description: + name: build_daemon + sha256: "5f02d73eb2ba16483e693f80bee4f088563a820e47d1027d4cdfe62b5bb43e65" + url: "https://pub.dev" + source: hosted + version: "4.0.0" + build_resolvers: + dependency: transitive + description: + name: build_resolvers + sha256: d912852cce27c9e80a93603db721c267716894462e7033165178b91138587972 + url: "https://pub.dev" + source: hosted + version: "2.3.2" + build_runner: + dependency: "direct dev" + description: + name: build_runner + sha256: "10c6bcdbf9d049a0b666702cf1cee4ddfdc38f02a19d35ae392863b47519848b" + url: "https://pub.dev" + source: hosted + version: "2.4.6" + build_runner_core: + dependency: transitive + description: + name: build_runner_core + sha256: "6d6ee4276b1c5f34f21fdf39425202712d2be82019983d52f351c94aafbc2c41" + url: "https://pub.dev" + source: hosted + version: "7.2.10" + built_collection: + dependency: transitive + description: + name: built_collection + sha256: "376e3dd27b51ea877c28d525560790aee2e6fbb5f20e2f85d5081027d94e2100" + url: "https://pub.dev" + source: hosted + version: "5.1.1" + built_value: + dependency: transitive + description: + name: built_value + sha256: "598a2a682e2a7a90f08ba39c0aaa9374c5112340f0a2e275f61b59389543d166" + url: "https://pub.dev" + source: hosted + version: "8.6.1" + cached_network_image: + dependency: "direct main" + description: + name: cached_network_image + sha256: fd3d0dc1d451f9a252b32d95d3f0c3c487bc41a75eba2e6097cb0b9c71491b15 + url: "https://pub.dev" + source: hosted + version: "3.2.3" + cached_network_image_platform_interface: + dependency: transitive + description: + name: cached_network_image_platform_interface + sha256: bb2b8403b4ccdc60ef5f25c70dead1f3d32d24b9d6117cfc087f496b178594a7 + url: "https://pub.dev" + source: hosted + version: "2.0.0" + cached_network_image_web: + dependency: transitive + description: + name: cached_network_image_web + sha256: b8eb814ebfcb4dea049680f8c1ffb2df399e4d03bf7a352c775e26fa06e02fa0 + url: "https://pub.dev" + source: hosted + version: "1.0.2" + characters: + dependency: transitive + description: + name: characters + sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.dev" + source: hosted + version: "2.0.3" + cli_util: + dependency: transitive + description: + name: cli_util + sha256: b8db3080e59b2503ca9e7922c3df2072cf13992354d5e944074ffa836fba43b7 + url: "https://pub.dev" + source: hosted + version: "0.4.0" + clock: + dependency: transitive + description: + name: clock + sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf + url: "https://pub.dev" + source: hosted + version: "1.1.1" + code_builder: + dependency: transitive + description: + name: code_builder + sha256: "4ad01d6e56db961d29661561effde45e519939fdaeb46c351275b182eac70189" + url: "https://pub.dev" + source: hosted + version: "4.5.0" + collection: + dependency: "direct main" + description: + name: collection + sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c" + url: "https://pub.dev" + source: hosted + version: "1.17.1" + connectivity_plus: + dependency: "direct main" + description: + name: connectivity_plus + sha256: "77a180d6938f78ca7d2382d2240eb626c0f6a735d0bfdce227d8ffb80f95c48b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + connectivity_plus_platform_interface: + dependency: transitive + description: + name: connectivity_plus_platform_interface + sha256: cf1d1c28f4416f8c654d7dc3cd638ec586076255d407cef3ddbdaf178272a71a + url: "https://pub.dev" + source: hosted + version: "1.2.4" + convert: + dependency: transitive + description: + name: convert + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" + source: hosted + version: "3.1.1" + coverage: + dependency: transitive + description: + name: coverage + sha256: "2fb815080e44a09b85e0f2ca8a820b15053982b2e714b59267719e8a9ff17097" + url: "https://pub.dev" + source: hosted + version: "1.6.3" + crypto: + dependency: "direct main" + description: + name: crypto + sha256: ff625774173754681d66daaf4a448684fb04b78f902da9cb3d308c19cc5e8bab + url: "https://pub.dev" + source: hosted + version: "3.0.3" + csslib: + dependency: transitive + description: + name: csslib + sha256: "706b5707578e0c1b4b7550f64078f0a0f19dec3f50a178ffae7006b0a9ca58fb" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + cupertino_icons: + dependency: "direct main" + description: + name: cupertino_icons + sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be + url: "https://pub.dev" + source: hosted + version: "1.0.5" + currency_text_input_formatter: + dependency: "direct main" + description: + name: currency_text_input_formatter + sha256: "5d8db755ccde76817f6f5fb33e65304d7b1db442e1ccff079fe235584c6b7d5a" + url: "https://pub.dev" + source: hosted + version: "2.1.10" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "1efa911ca7086affd35f463ca2fc1799584fb6aa89883cf0af8e3664d6a02d55" + url: "https://pub.dev" + source: hosted + version: "2.3.2" + dbus: + dependency: transitive + description: + name: dbus + sha256: "6f07cba3f7b3448d42d015bfd3d53fe12e5b36da2423f23838efc1d5fb31a263" + url: "https://pub.dev" + source: hosted + version: "0.7.8" + email_validator: + dependency: "direct main" + description: + name: email_validator + sha256: e9a90f27ab2b915a27d7f9c2a7ddda5dd752d6942616ee83529b686fc086221b + url: "https://pub.dev" + source: hosted + version: "2.1.17" + encrypt: + dependency: "direct main" + description: + name: encrypt + sha256: "62d9aa4670cc2a8798bab89b39fc71b6dfbacf615de6cf5001fb39f7e4a996a2" + url: "https://pub.dev" + source: hosted + version: "5.0.3" + expansion_tile_card: + dependency: "direct main" + description: + name: expansion_tile_card + sha256: "27ce4cb518f00e21d0f2309aaa6462b26b148e93cee2029a73088cecf42b1eb0" + url: "https://pub.dev" + source: hosted + version: "3.0.0" + fake_async: + dependency: transitive + description: + name: fake_async + sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" + url: "https://pub.dev" + source: hosted + version: "1.3.1" + ffi: + dependency: transitive + description: + name: ffi + sha256: ed5337a5660c506388a9f012be0288fb38b49020ce2b45fe1f8b8323fe429f99 + url: "https://pub.dev" + source: hosted + version: "2.0.2" + file: + dependency: transitive + description: + name: file + sha256: "1b92bec4fc2a72f59a8e15af5f52cd441e4a7860b49499d69dfa817af20e925d" + url: "https://pub.dev" + source: hosted + version: "6.1.4" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + flutter: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_blurhash: + dependency: transitive + description: + name: flutter_blurhash + sha256: "05001537bd3fac7644fa6558b09ec8c0a3f2eba78c0765f88912882b1331a5c6" + url: "https://pub.dev" + source: hosted + version: "0.7.0" + flutter_cache_manager: + dependency: transitive + description: + name: flutter_cache_manager + sha256: "8207f27539deb83732fdda03e259349046a39a4c767269285f449ade355d54ba" + url: "https://pub.dev" + source: hosted + version: "3.3.1" + flutter_dotenv: + dependency: "direct main" + description: + name: flutter_dotenv + sha256: "9357883bdd153ab78cbf9ffa07656e336b8bbb2b5a3ca596b0b27e119f7c7d77" + url: "https://pub.dev" + source: hosted + version: "5.1.0" + flutter_launcher_icons: + dependency: "direct dev" + description: + name: flutter_launcher_icons + sha256: "526faf84284b86a4cb36d20a5e45147747b7563d921373d4ee0559c54fcdbcea" + url: "https://pub.dev" + source: hosted + version: "0.13.1" + flutter_local_notifications: + dependency: "direct main" + description: + name: flutter_local_notifications + sha256: "3002092e5b8ce2f86c3361422e52e6db6776c23ee21e0b2f71b892bf4259ef04" + url: "https://pub.dev" + source: hosted + version: "15.1.1" + flutter_local_notifications_linux: + dependency: transitive + description: + name: flutter_local_notifications_linux + sha256: "33f741ef47b5f63cc7f78fe75eeeac7e19f171ff3c3df054d84c1e38bedb6a03" + url: "https://pub.dev" + source: hosted + version: "4.0.0+1" + flutter_local_notifications_platform_interface: + dependency: transitive + description: + name: flutter_local_notifications_platform_interface + sha256: "7cf643d6d5022f3baed0be777b0662cce5919c0a7b86e700299f22dc4ae660ef" + url: "https://pub.dev" + source: hosted + version: "7.0.0+1" + flutter_localizations: + dependency: "direct main" + description: flutter + source: sdk + version: "0.0.0" + flutter_map: + dependency: "direct main" + description: + name: flutter_map + sha256: "52c65a977daae42f9aae6748418dd1535eaf27186e9bac9bf431843082bc75a3" + url: "https://pub.dev" + source: hosted + version: "4.0.0" + flutter_map_marker_popup: + dependency: "direct main" + description: + name: flutter_map_marker_popup + sha256: d4e22a00dd46f95a6f54c60b92950bd6f41021ca36629b1cf3fa0bf4fd39f421 + url: "https://pub.dev" + source: hosted + version: "5.0.0" + flutter_markdown: + dependency: "direct main" + description: + name: flutter_markdown + sha256: dc6d5258653f6857135b32896ccda7f7af0c54dcec832495ad6835154c6c77c0 + url: "https://pub.dev" + source: hosted + version: "0.6.15" + flutter_svg: + dependency: "direct main" + description: + name: flutter_svg + sha256: f991fdb1533c3caeee0cdc14b04f50f0c3916f0dbcbc05237ccbe4e3c6b93f3f + url: "https://pub.dev" + source: hosted + version: "2.0.5" + flutter_test: + dependency: "direct dev" + description: flutter + source: sdk + version: "0.0.0" + flutter_web_plugins: + dependency: transitive + description: flutter + source: sdk + version: "0.0.0" + flutter_widget_from_html_core: + dependency: "direct main" + description: + name: flutter_widget_from_html_core + sha256: "719da7fba82343efb9ad3be528a768dec4a4d8f3b37ebd9eef8d93e891a1d58f" + url: "https://pub.dev" + source: hosted + version: "0.10.4" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + sha256: "408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612" + url: "https://pub.dev" + source: hosted + version: "3.2.0" + glob: + dependency: transitive + description: + name: glob + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + graphs: + dependency: transitive + description: + name: graphs + sha256: aedc5a15e78fc65a6e23bcd927f24c64dd995062bcd1ca6eda65a3cff92a4d19 + url: "https://pub.dev" + source: hosted + version: "2.3.1" + html: + dependency: "direct main" + description: + name: html + sha256: "3a7812d5bcd2894edf53dfaf8cd640876cf6cef50a8f238745c8b8120ea74d3a" + url: "https://pub.dev" + source: hosted + version: "0.15.4" + http: + dependency: "direct main" + description: + name: http + sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2" + url: "https://pub.dev" + source: hosted + version: "0.13.6" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + sha256: "97486f20f9c2f7be8f514851703d0119c3596d14ea63227af6f7a481ef2b2f8b" + url: "https://pub.dev" + source: hosted + version: "3.2.1" + http_parser: + dependency: transitive + description: + name: http_parser + sha256: "2aa08ce0341cc9b354a498388e30986515406668dbcc4f7c950c3e715496693b" + url: "https://pub.dev" + source: hosted + version: "4.0.2" + image: + dependency: "direct main" + description: + name: image + sha256: a72242c9a0ffb65d03de1b7113bc4e189686fc07c7147b8b41811d0dd0e0d9bf + url: "https://pub.dev" + source: hosted + version: "4.0.17" + intl: + dependency: "direct main" + description: + name: intl + sha256: a3715e3bc90294e971cb7dc063fbf3cd9ee0ebf8604ffeafabd9e6f16abbdbe6 + url: "https://pub.dev" + source: hosted + version: "0.18.0" + io: + dependency: transitive + description: + name: io + sha256: "2ec25704aba361659e10e3e5f5d672068d332fc8ac516421d483a11e5cbd061e" + url: "https://pub.dev" + source: hosted + version: "1.0.4" + js: + dependency: transitive + description: + name: js + sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + url: "https://pub.dev" + source: hosted + version: "0.6.7" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: b10a7b2ff83d83c777edba3c6a0f97045ddadd56c944e1a23a3fdf43a1bf4467 + url: "https://pub.dev" + source: hosted + version: "4.8.1" + latlong2: + dependency: "direct main" + description: + name: latlong2 + sha256: "08ef7282ba9f76e8495e49e2dc4d653015ac929dce5f92b375a415d30b407ea0" + url: "https://pub.dev" + source: hosted + version: "0.8.2" + lists: + dependency: transitive + description: + name: lists + sha256: "4ca5c19ae4350de036a7e996cdd1ee39c93ac0a2b840f4915459b7d0a7d4ab27" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + logger: + dependency: "direct main" + description: + name: logger + sha256: "7ad7215c15420a102ec687bb320a7312afd449bac63bfb1c60d9787c27b9767f" + url: "https://pub.dev" + source: hosted + version: "1.4.0" + logging: + dependency: transitive + description: + name: logging + sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + markdown: + dependency: transitive + description: + name: markdown + sha256: acf35edccc0463a9d7384e437c015a3535772e09714cf60e07eeef3a15870dcd + url: "https://pub.dev" + source: hosted + version: "7.1.1" + matcher: + dependency: transitive + description: + name: matcher + sha256: "6501fbd55da300384b768785b83e5ce66991266cec21af89ab9ae7f5ce1c4cbb" + url: "https://pub.dev" + source: hosted + version: "0.12.15" + material_color_utilities: + dependency: transitive + description: + name: material_color_utilities + sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724 + url: "https://pub.dev" + source: hosted + version: "0.2.0" + material_design_icons_flutter: + dependency: "direct main" + description: + name: material_design_icons_flutter + sha256: "6f986b7a51f3ad4c00e33c5c84e8de1bdd140489bbcdc8b66fc1283dad4dea5a" + url: "https://pub.dev" + source: hosted + version: "7.0.7296" + meta: + dependency: transitive + description: + name: meta + sha256: "3c74dbf8763d36539f114c799d8a2d87343b5067e9d796ca22b5eb8437090ee3" + url: "https://pub.dev" + source: hosted + version: "1.9.1" + mgrs_dart: + dependency: transitive + description: + name: mgrs_dart + sha256: fb89ae62f05fa0bb90f70c31fc870bcbcfd516c843fb554452ab3396f78586f7 + url: "https://pub.dev" + source: hosted + version: "2.0.0" + mime: + dependency: transitive + description: + name: mime + sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e + url: "https://pub.dev" + source: hosted + version: "1.0.4" + mockito: + dependency: "direct dev" + description: + path: "." + ref: e54a006 + resolved-ref: e54a00667cbe9a27de08e4c0ea355bacbe8c98d0 + url: "https://github.com/dart-lang/mockito.git" + source: git + version: "5.4.3-wip" + nested: + dependency: transitive + description: + name: nested + sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" + url: "https://pub.dev" + source: hosted + version: "1.0.0" + nm: + dependency: transitive + description: + name: nm + sha256: "2c9aae4127bdc8993206464fcc063611e0e36e72018696cd9631023a31b24254" + url: "https://pub.dev" + source: hosted + version: "0.5.0" + node_preamble: + dependency: transitive + description: + name: node_preamble + sha256: "6e7eac89047ab8a8d26cf16127b5ed26de65209847630400f9aefd7cd5c730db" + url: "https://pub.dev" + source: hosted + version: "2.0.2" + octo_image: + dependency: transitive + description: + name: octo_image + sha256: "107f3ed1330006a3bea63615e81cf637433f5135a52466c7caa0e7152bca9143" + url: "https://pub.dev" + source: hosted + version: "1.0.2" + package_config: + dependency: transitive + description: + name: package_config + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + package_info_plus: + dependency: transitive + description: + name: package_info_plus + sha256: "10259b111176fba5c505b102e3a5b022b51dd97e30522e906d6922c745584745" + url: "https://pub.dev" + source: hosted + version: "3.1.2" + package_info_plus_platform_interface: + dependency: transitive + description: + name: package_info_plus_platform_interface + sha256: "9bc8ba46813a4cc42c66ab781470711781940780fd8beddd0c3da62506d3a6c6" + url: "https://pub.dev" + source: hosted + version: "2.0.1" + path: + dependency: "direct main" + description: + name: path + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + url: "https://pub.dev" + source: hosted + version: "1.8.3" + path_parsing: + dependency: transitive + description: + name: path_parsing + sha256: e3e67b1629e6f7e8100b367d3db6ba6af4b1f0bb80f64db18ef1fbabd2fa9ccf + url: "https://pub.dev" + source: hosted + version: "1.0.1" + path_provider: + dependency: "direct main" + description: + name: path_provider + sha256: "3087813781ab814e4157b172f1a11c46be20179fcc9bea043e0fba36bc0acaa2" + url: "https://pub.dev" + source: hosted + version: "2.0.15" + path_provider_android: + dependency: transitive + description: + name: path_provider_android + sha256: "2cec049d282c7f13c594b4a73976b0b4f2d7a1838a6dd5aaf7bd9719196bee86" + url: "https://pub.dev" + source: hosted + version: "2.0.27" + path_provider_foundation: + dependency: transitive + description: + name: path_provider_foundation + sha256: "1995d88ec2948dac43edf8fe58eb434d35d22a2940ecee1a9fefcd62beee6eb3" + url: "https://pub.dev" + source: hosted + version: "2.2.3" + path_provider_linux: + dependency: transitive + description: + name: path_provider_linux + sha256: ffbb8cc9ed2c9ec0e4b7a541e56fd79b138e8f47d2fb86815f15358a349b3b57 + url: "https://pub.dev" + source: hosted + version: "2.1.11" + path_provider_platform_interface: + dependency: transitive + description: + name: path_provider_platform_interface + sha256: "57585299a729335f1298b43245842678cb9f43a6310351b18fb577d6e33165ec" + url: "https://pub.dev" + source: hosted + version: "2.0.6" + path_provider_windows: + dependency: transitive + description: + name: path_provider_windows + sha256: "1cb68ba4cd3a795033de62ba1b7b4564dace301f952de6bfb3cd91b202b6ee96" + url: "https://pub.dev" + source: hosted + version: "2.1.7" + percent_indicator: + dependency: "direct main" + description: + name: percent_indicator + sha256: c37099ad833a883c9d71782321cb65c3a848c21b6939b6185f0ff6640d05814c + url: "https://pub.dev" + source: hosted + version: "4.2.3" + petitparser: + dependency: transitive + description: + name: petitparser + sha256: "49392a45ced973e8d94a85fdb21293fbb40ba805fc49f2965101ae748a3683b4" + url: "https://pub.dev" + source: hosted + version: "5.1.0" + platform: + dependency: transitive + description: + name: platform + sha256: "4a451831508d7d6ca779f7ac6e212b4023dd5a7d08a27a63da33756410e32b76" + url: "https://pub.dev" + source: hosted + version: "3.1.0" + plugin_platform_interface: + dependency: transitive + description: + name: plugin_platform_interface + sha256: "6a2128648c854906c53fa8e33986fc0247a1116122f9534dd20e3ab9e16a32bc" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + pointycastle: + dependency: transitive + description: + name: pointycastle + sha256: "7c1e5f0d23c9016c5bbd8b1473d0d3fb3fc851b876046039509e18e0c7485f2c" + url: "https://pub.dev" + source: hosted + version: "3.7.3" + polylabel: + dependency: transitive + description: + name: polylabel + sha256: "41b9099afb2aa6c1730bdd8a0fab1400d287694ec7615dd8516935fa3144214b" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + pool: + dependency: transitive + description: + name: pool + sha256: "20fe868b6314b322ea036ba325e6fc0711a22948856475e2c2b6306e8ab39c2a" + url: "https://pub.dev" + source: hosted + version: "1.5.1" + process: + dependency: transitive + description: + name: process + sha256: "53fd8db9cec1d37b0574e12f07520d582019cb6c44abf5479a01505099a34a09" + url: "https://pub.dev" + source: hosted + version: "4.2.4" + proj4dart: + dependency: transitive + description: + name: proj4dart + sha256: c8a659ac9b6864aa47c171e78d41bbe6f5e1d7bd790a5814249e6b68bc44324e + url: "https://pub.dev" + source: hosted + version: "2.1.0" + provider: + dependency: "direct main" + description: + name: provider + sha256: cdbe7530b12ecd9eb455bdaa2fcb8d4dad22e80b8afb4798b41479d5ce26847f + url: "https://pub.dev" + source: hosted + version: "6.0.5" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + sha256: c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367 + url: "https://pub.dev" + source: hosted + version: "1.2.3" + rxdart: + dependency: transitive + description: + name: rxdart + sha256: "0c7c0cedd93788d996e33041ffecda924cc54389199cde4e6a34b440f50044cb" + url: "https://pub.dev" + source: hosted + version: "0.27.7" + sentry: + dependency: transitive + description: + name: sentry + sha256: "39c23342fc96105da449914f7774139a17a0ca8a4e70d9ad5200171f7e47d6ba" + url: "https://pub.dev" + source: hosted + version: "7.9.0" + sentry_flutter: + dependency: "direct main" + description: + name: sentry_flutter + sha256: ff68ab31918690da004a42e20204242a3ad9ad57da7e2712da8487060ac9767f + url: "https://pub.dev" + source: hosted + version: "7.9.0" + shared_preferences: + dependency: "direct main" + description: + name: shared_preferences + sha256: "0344316c947ffeb3a529eac929e1978fcd37c26be4e8468628bac399365a3ca1" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + shared_preferences_android: + dependency: transitive + description: + name: shared_preferences_android + sha256: fe8401ec5b6dcd739a0fe9588802069e608c3fdbfd3c3c93e546cf2f90438076 + url: "https://pub.dev" + source: hosted + version: "2.2.0" + shared_preferences_foundation: + dependency: transitive + description: + name: shared_preferences_foundation + sha256: b046999bf0ff58f04c364491bb803dcfa8f42e47b19c75478f53d323684a8cc1 + url: "https://pub.dev" + source: hosted + version: "2.3.1" + shared_preferences_linux: + dependency: transitive + description: + name: shared_preferences_linux + sha256: "71d6806d1449b0a9d4e85e0c7a917771e672a3d5dc61149cc9fac871115018e1" + url: "https://pub.dev" + source: hosted + version: "2.3.0" + shared_preferences_platform_interface: + dependency: transitive + description: + name: shared_preferences_platform_interface + sha256: "23b052f17a25b90ff2b61aad4cc962154da76fb62848a9ce088efe30d7c50ab1" + url: "https://pub.dev" + source: hosted + version: "2.3.0" + shared_preferences_web: + dependency: transitive + description: + name: shared_preferences_web + sha256: "7347b194fb0bbeb4058e6a4e87ee70350b6b2b90f8ac5f8bd5b3a01548f6d33a" + url: "https://pub.dev" + source: hosted + version: "2.2.0" + shared_preferences_windows: + dependency: transitive + description: + name: shared_preferences_windows + sha256: f95e6a43162bce43c9c3405f3eb6f39e5b5d11f65fab19196cf8225e2777624d + url: "https://pub.dev" + source: hosted + version: "2.3.0" + shelf: + dependency: transitive + description: + name: shelf + sha256: ad29c505aee705f41a4d8963641f91ac4cee3c8fad5947e033390a7bd8180fa4 + url: "https://pub.dev" + source: hosted + version: "1.4.1" + shelf_packages_handler: + dependency: transitive + description: + name: shelf_packages_handler + sha256: "89f967eca29607c933ba9571d838be31d67f53f6e4ee15147d5dc2934fee1b1e" + url: "https://pub.dev" + source: hosted + version: "3.0.2" + shelf_static: + dependency: transitive + description: + name: shelf_static + sha256: a41d3f53c4adf0f57480578c1d61d90342cd617de7fc8077b1304643c2d85c1e + url: "https://pub.dev" + source: hosted + version: "1.1.2" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + sha256: "9ca081be41c60190ebcb4766b2486a7d50261db7bd0f5d9615f2d653637a84c1" + url: "https://pub.dev" + source: hosted + version: "1.0.4" + shimmer: + dependency: "direct main" + description: + name: shimmer + sha256: "5f88c883a22e9f9f299e5ba0e4f7e6054857224976a5d9f839d4ebdc94a14ac9" + url: "https://pub.dev" + source: hosted + version: "3.0.0" + sky_engine: + dependency: transitive + description: flutter + source: sdk + version: "0.0.99" + source_gen: + dependency: transitive + description: + name: source_gen + sha256: "373f96cf5a8744bc9816c1ff41cf5391bbdbe3d7a96fe98c622b6738a8a7bd33" + url: "https://pub.dev" + source: hosted + version: "1.3.2" + source_map_stack_trace: + dependency: transitive + description: + name: source_map_stack_trace + sha256: "84cf769ad83aa6bb61e0aa5a18e53aea683395f196a6f39c4c881fb90ed4f7ae" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + source_maps: + dependency: transitive + description: + name: source_maps + sha256: "708b3f6b97248e5781f493b765c3337db11c5d2c81c3094f10904bfa8004c703" + url: "https://pub.dev" + source: hosted + version: "0.10.12" + source_span: + dependency: transitive + description: + name: source_span + sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250 + url: "https://pub.dev" + source: hosted + version: "1.9.1" + sqflite: + dependency: "direct main" + description: + name: sqflite + sha256: b4d6710e1200e96845747e37338ea8a819a12b51689a3bcf31eff0003b37a0b9 + url: "https://pub.dev" + source: hosted + version: "2.2.8+4" + sqflite_common: + dependency: transitive + description: + name: sqflite_common + sha256: "8f7603f3f8f126740bc55c4ca2d1027aab4b74a1267a3e31ce51fe40e3b65b8f" + url: "https://pub.dev" + source: hosted + version: "2.4.5+1" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5 + url: "https://pub.dev" + source: hosted + version: "1.11.0" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + stream_transform: + dependency: transitive + description: + name: stream_transform + sha256: "14a00e794c7c11aa145a170587321aedce29769c08d7f58b1d141da75e3b1c6f" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + synchronized: + dependency: "direct main" + description: + name: synchronized + sha256: "5fcbd27688af6082f5abd611af56ee575342c30e87541d0245f7ff99faa02c60" + url: "https://pub.dev" + source: hosted + version: "3.1.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test: + dependency: "direct dev" + description: + name: test + sha256: "3dac9aecf2c3991d09b9cdde4f98ded7b30804a88a0d7e4e7e1678e78d6b97f4" + url: "https://pub.dev" + source: hosted + version: "1.24.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: eb6ac1540b26de412b3403a163d919ba86f6a973fe6cc50ae3541b80092fdcfb + url: "https://pub.dev" + source: hosted + version: "0.5.1" + test_core: + dependency: transitive + description: + name: test_core + sha256: "5138dbffb77b2289ecb12b81c11ba46036590b72a64a7a90d6ffb880f1a29e93" + url: "https://pub.dev" + source: hosted + version: "0.5.1" + timelines: + dependency: "direct main" + description: + name: timelines + sha256: "40214f5ab772ff45459cb8c15e5f60505a6828af0c0eb1eec6f29ed911a4c1c5" + url: "https://pub.dev" + source: hosted + version: "0.1.0" + timezone: + dependency: transitive + description: + name: timezone + sha256: "1cfd8ddc2d1cfd836bc93e67b9be88c3adaeca6f40a00ca999104c30693cdca0" + url: "https://pub.dev" + source: hosted + version: "0.9.2" + timing: + dependency: transitive + description: + name: timing + sha256: "70a3b636575d4163c477e6de42f247a23b315ae20e86442bebe32d3cabf61c32" + url: "https://pub.dev" + source: hosted + version: "1.0.1" + tuple: + dependency: "direct main" + description: + name: tuple + sha256: a97ce2013f240b2f3807bcbaf218765b6f301c3eff91092bcfa23a039e7dd151 + url: "https://pub.dev" + source: hosted + version: "2.0.2" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" + source: hosted + version: "1.3.2" + unicode: + dependency: transitive + description: + name: unicode + sha256: "0f69e46593d65245774d4f17125c6084d2c20b4e473a983f6e21b7d7762218f1" + url: "https://pub.dev" + source: hosted + version: "0.3.1" + url_launcher: + dependency: "direct main" + description: + name: url_launcher + sha256: eb1e00ab44303d50dd487aab67ebc575456c146c6af44422f9c13889984c00f3 + url: "https://pub.dev" + source: hosted + version: "6.1.11" + url_launcher_android: + dependency: transitive + description: + name: url_launcher_android + sha256: "15f5acbf0dce90146a0f5a2c4a002b1814a6303c4c5c075aa2623b2d16156f03" + url: "https://pub.dev" + source: hosted + version: "6.0.36" + url_launcher_ios: + dependency: transitive + description: + name: url_launcher_ios + sha256: "9af7ea73259886b92199f9e42c116072f05ff9bea2dcb339ab935dfc957392c2" + url: "https://pub.dev" + source: hosted + version: "6.1.4" + url_launcher_linux: + dependency: transitive + description: + name: url_launcher_linux + sha256: "207f4ddda99b95b4d4868320a352d374b0b7e05eefad95a4a26f57da413443f5" + url: "https://pub.dev" + source: hosted + version: "3.0.5" + url_launcher_macos: + dependency: transitive + description: + name: url_launcher_macos + sha256: "91ee3e75ea9dadf38036200c5d3743518f4a5eb77a8d13fda1ee5764373f185e" + url: "https://pub.dev" + source: hosted + version: "3.0.5" + url_launcher_platform_interface: + dependency: transitive + description: + name: url_launcher_platform_interface + sha256: bfdfa402f1f3298637d71ca8ecfe840b4696698213d5346e9d12d4ab647ee2ea + url: "https://pub.dev" + source: hosted + version: "2.1.3" + url_launcher_web: + dependency: transitive + description: + name: url_launcher_web + sha256: cc26720eefe98c1b71d85f9dc7ef0cada5132617046369d9dc296b3ecaa5cbb4 + url: "https://pub.dev" + source: hosted + version: "2.0.18" + url_launcher_windows: + dependency: transitive + description: + name: url_launcher_windows + sha256: "7967065dd2b5fccc18c653b97958fdf839c5478c28e767c61ee879f4e7882422" + url: "https://pub.dev" + source: hosted + version: "3.0.7" + uuid: + dependency: transitive + description: + name: uuid + sha256: "648e103079f7c64a36dc7d39369cabb358d377078a051d6ae2ad3aa539519313" + url: "https://pub.dev" + source: hosted + version: "3.0.7" + vector_graphics: + dependency: transitive + description: + name: vector_graphics + sha256: ea8d3fc7b2e0f35de38a7465063ecfcf03d8217f7962aa2a6717132cb5d43a79 + url: "https://pub.dev" + source: hosted + version: "1.1.5" + vector_graphics_codec: + dependency: transitive + description: + name: vector_graphics_codec + sha256: a5eaa5d19e123ad4f61c3718ca1ed921c4e6254238d9145f82aa214955d9aced + url: "https://pub.dev" + source: hosted + version: "1.1.5" + vector_graphics_compiler: + dependency: transitive + description: + name: vector_graphics_compiler + sha256: "15edc42f7eaa478ce854eaf1fbb9062a899c0e4e56e775dd73b7f4709c97c4ca" + url: "https://pub.dev" + source: hosted + version: "1.1.5" + vector_math: + dependency: transitive + description: + name: vector_math + sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + very_good_analysis: + dependency: "direct dev" + description: + name: very_good_analysis + sha256: "9ae7f3a3bd5764fb021b335ca28a34f040cd0ab6eec00a1b213b445dae58a4b8" + url: "https://pub.dev" + source: hosted + version: "5.1.0" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: e7fb6c2282f7631712b69c19d1bff82f3767eea33a2321c14fa59ad67ea391c7 + url: "https://pub.dev" + source: hosted + version: "9.4.0" + watcher: + dependency: transitive + description: + name: watcher + sha256: "6a7f46926b01ce81bfc339da6a7f20afbe7733eff9846f6d6a5466aa4c6667c0" + url: "https://pub.dev" + source: hosted + version: "1.0.2" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + sha256: d88238e5eac9a42bb43ca4e721edba3c08c6354d4a53063afaa568516217621b + url: "https://pub.dev" + source: hosted + version: "2.4.0" + webkit_inspection_protocol: + dependency: transitive + description: + name: webkit_inspection_protocol + sha256: "67d3a8b6c79e1987d19d848b0892e582dbb0c66c57cc1fef58a177dd2aa2823d" + url: "https://pub.dev" + source: hosted + version: "1.2.0" + win32: + dependency: transitive + description: + name: win32 + sha256: "5a751eddf9db89b3e5f9d50c20ab8612296e4e8db69009788d6c8b060a84191c" + url: "https://pub.dev" + source: hosted + version: "4.1.4" + wkt_parser: + dependency: transitive + description: + name: wkt_parser + sha256: "8a555fc60de3116c00aad67891bcab20f81a958e4219cc106e3c037aa3937f13" + url: "https://pub.dev" + source: hosted + version: "2.0.0" + workmanager: + dependency: "direct main" + description: + name: workmanager + sha256: e0be7e35d644643f164ee45d2ce14414f0e0fdde19456aa66065f35a0b1d2ea1 + url: "https://pub.dev" + source: hosted + version: "0.5.1" + xdg_directories: + dependency: transitive + description: + name: xdg_directories + sha256: ee1505df1426458f7f60aac270645098d318a8b4766d85fde75f76f2e21807d1 + url: "https://pub.dev" + source: hosted + version: "1.0.0" + xml: + dependency: transitive + description: + name: xml + sha256: "979ee37d622dec6365e2efa4d906c37470995871fe9ae080d967e192d88286b5" + url: "https://pub.dev" + source: hosted + version: "6.2.2" + yaml: + dependency: transitive + description: + name: yaml + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" + source: hosted + version: "3.1.2" +sdks: + dart: ">=3.0.0 <4.0.0" + flutter: ">=3.10.6" From aeb926fc577264452a79dad1e2c959df02e63486 Mon Sep 17 00:00:00 2001 From: Bruno Mendes Date: Mon, 2 Oct 2023 12:11:08 +0100 Subject: [PATCH 2/8] Bump packages, bump courses db version, further remove try/catch, fix forced logout --- .../background_callback.dart | 8 +- .../all_course_units_fetcher.dart | 18 ++--- .../controller/fetchers/profile_fetcher.dart | 35 ++++----- .../load_static/terms_and_conditions.dart | 24 ++---- .../local_storage/app_courses_database.dart | 2 +- .../local_storage/app_database.dart | 28 ++++--- .../local_storage/app_exams_database.dart | 2 +- .../controller/networking/network_router.dart | 73 ++++++++++--------- .../parsers/parser_course_units.dart | 2 +- uni/lib/main.dart | 25 ++++--- uni/lib/model/entities/course.dart | 4 +- uni/lib/model/entities/exam.dart | 6 -- uni/lib/model/entities/trip.dart | 7 -- .../providers/state_provider_notifier.dart | 59 +++++++++------ uni/lib/view/bug_report/widgets/form.dart | 16 ++-- .../view/common_widgets/page_transition.dart | 2 +- .../view/locations/widgets/faculty_map.dart | 6 +- uni/lib/view/login/login.dart | 6 +- uni/lib/view/navigation_service.dart | 19 ++--- uni/pubspec.yaml | 8 +- 20 files changed, 178 insertions(+), 172 deletions(-) diff --git a/uni/lib/controller/background_workers/background_callback.dart b/uni/lib/controller/background_workers/background_callback.dart index 9c9f45536..bf89d1e07 100644 --- a/uni/lib/controller/background_workers/background_callback.dart +++ b/uni/lib/controller/background_workers/background_callback.dart @@ -35,8 +35,12 @@ Future workerStartCallback() async { //try to keep the usage of this function BELOW +-30 seconds //to not be punished by the scheduler in future runs. await taskMap[taskName]!.item1(); - } catch (err, stackstrace) { - Logger().e('Error while running $taskName job:', err, stackstrace); + } catch (err, stackTrace) { + Logger().e( + 'Error while running $taskName job:', + error: err, + stackTrace: stackTrace, + ); return false; } return true; diff --git a/uni/lib/controller/fetchers/course_units_fetcher/all_course_units_fetcher.dart b/uni/lib/controller/fetchers/course_units_fetcher/all_course_units_fetcher.dart index f0d87293b..c84932de1 100644 --- a/uni/lib/controller/fetchers/course_units_fetcher/all_course_units_fetcher.dart +++ b/uni/lib/controller/fetchers/course_units_fetcher/all_course_units_fetcher.dart @@ -1,4 +1,3 @@ -import 'package:logger/logger.dart'; import 'package:uni/controller/networking/network_router.dart'; import 'package:uni/controller/parsers/parser_course_units.dart'; import 'package:uni/model/entities/course.dart'; @@ -14,17 +13,12 @@ class AllCourseUnitsFetcher { final allCourseUnits = []; for (final course in courses) { - try { - final courseUnits = await _getAllCourseUnitsAndCourseAveragesFromCourse( - course, - session, - currentCourseUnits: currentCourseUnits, - ); - allCourseUnits.addAll(courseUnits.where((c) => c.enrollmentIsValid())); - } catch (e) { - Logger().e('Failed to fetch course units for ${course.name}', e); - return null; - } + final courseUnits = await _getAllCourseUnitsAndCourseAveragesFromCourse( + course, + session, + currentCourseUnits: currentCourseUnits, + ); + allCourseUnits.addAll(courseUnits.where((c) => c.enrollmentIsValid())); } return allCourseUnits; diff --git a/uni/lib/controller/fetchers/profile_fetcher.dart b/uni/lib/controller/fetchers/profile_fetcher.dart index 56a239d64..17028f34c 100644 --- a/uni/lib/controller/fetchers/profile_fetcher.dart +++ b/uni/lib/controller/fetchers/profile_fetcher.dart @@ -1,4 +1,3 @@ -import 'package:logger/logger.dart'; import 'package:uni/controller/fetchers/courses_fetcher.dart'; import 'package:uni/controller/fetchers/session_dependant_fetcher.dart'; import 'package:uni/controller/networking/network_router.dart'; @@ -30,27 +29,23 @@ class ProfileFetcher implements SessionDependantFetcher { } final profile = Profile.fromResponse(response); - try { - final coursesResponses = await Future.wait( - CoursesFetcher().getCoursesListResponses(session), - ); - final courses = parseMultipleCourses(coursesResponses); - for (final course in courses) { - if (profile.courses - .map((c) => c.festId) - .toList() - .contains(course.festId)) { - profile.courses - .where((c) => c.festId == course.festId) - .first - .state ??= course.state; - continue; - } - profile.courses.add(course); + final coursesResponses = await Future.wait( + CoursesFetcher().getCoursesListResponses(session), + ); + final courses = parseMultipleCourses(coursesResponses); + + for (final course in courses) { + if (profile.courses + .map((c) => c.festId) + .toList() + .contains(course.festId)) { + profile.courses.where((c) => c.festId == course.festId).first.state ??= + course.state; + continue; } - } catch (e) { - Logger().e('Failed to get user courses via scrapping: $e'); + profile.courses.add(course); } + return profile; } } diff --git a/uni/lib/controller/load_static/terms_and_conditions.dart b/uni/lib/controller/load_static/terms_and_conditions.dart index ba6945175..e5e5fc5da 100644 --- a/uni/lib/controller/load_static/terms_and_conditions.dart +++ b/uni/lib/controller/load_static/terms_and_conditions.dart @@ -4,7 +4,6 @@ import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:crypto/crypto.dart'; import 'package:flutter/services.dart' show rootBundle; import 'package:http/http.dart' as http; -import 'package:logger/logger.dart'; import 'package:uni/controller/local_storage/app_shared_preferences.dart'; /// Returns the content of the Terms and Conditions remote file, @@ -13,25 +12,14 @@ import 'package:uni/controller/local_storage/app_shared_preferences.dart'; /// If this operation is unsuccessful, an error message is returned. Future fetchTermsAndConditions() async { if (await Connectivity().checkConnectivity() != ConnectivityResult.none) { - try { - const url = - 'https://raw.githubusercontent.com/NIAEFEUP/project-schrodinger/develop/uni/assets/text/TermsAndConditions.md'; - final response = await http.get(Uri.parse(url)); - if (response.statusCode == 200) { - return response.body; - } - } catch (e) { - Logger().e('Failed to fetch Terms and Conditions: $e'); + const url = + 'https://raw.githubusercontent.com/NIAEFEUP/project-schrodinger/develop/uni/assets/text/TermsAndConditions.md'; + final response = await http.get(Uri.parse(url)); + if (response.statusCode == 200) { + return response.body; } } - - try { - return await rootBundle.loadString('assets/text/TermsAndConditions.md'); - } catch (e) { - Logger().e('Failed to read Terms and Conditions: $e'); - return 'Não foi possível carregar os Termos e Condições. ' - 'Por favor tente mais tarde.'; - } + return rootBundle.loadString('assets/text/TermsAndConditions.md'); } /// Checks if the current Terms and Conditions have been accepted by the user, diff --git a/uni/lib/controller/local_storage/app_courses_database.dart b/uni/lib/controller/local_storage/app_courses_database.dart index f9130e050..db7d9ac6a 100644 --- a/uni/lib/controller/local_storage/app_courses_database.dart +++ b/uni/lib/controller/local_storage/app_courses_database.dart @@ -10,7 +10,7 @@ import 'package:uni/model/entities/course.dart'; /// See the [Course] class to see what data is stored in this database. class AppCoursesDatabase extends AppDatabase { AppCoursesDatabase() - : super('courses.db', [createScript], onUpgrade: migrate, version: 2); + : super('courses.db', [createScript], onUpgrade: migrate, version: 3); static const String createScript = '''CREATE TABLE courses(id INTEGER, fest_id INTEGER, name TEXT, ''' '''abbreviation TEXT, currYear TEXT, firstEnrollment INTEGER, state TEXT, ''' diff --git a/uni/lib/controller/local_storage/app_database.dart b/uni/lib/controller/local_storage/app_database.dart index c24800d5a..885cba9f3 100644 --- a/uni/lib/controller/local_storage/app_database.dart +++ b/uni/lib/controller/local_storage/app_database.dart @@ -20,7 +20,10 @@ class AppDatabase { /// A list of commands to be executed on database creation. List commands; - // A lock that synchronizes all database insertions. + /// The lock timeout for database operations. + static const Duration lockTimeout = Duration(seconds: 10); + + /// A lock that synchronizes all database insertions. static Lock lock = Lock(); /// A function that is called when the [version] changes. @@ -42,16 +45,19 @@ class AppDatabase { String? nullColumnHack, ConflictAlgorithm? conflictAlgorithm, }) async { - await lock.synchronized(() async { - final db = await getDatabase(); - - await db.insert( - table, - values, - nullColumnHack: nullColumnHack, - conflictAlgorithm: conflictAlgorithm, - ); - }); + await lock.synchronized( + () async { + final db = await getDatabase(); + + await db.insert( + table, + values, + nullColumnHack: nullColumnHack, + conflictAlgorithm: conflictAlgorithm, + ); + }, + timeout: lockTimeout, + ); } /// Initializes this database. diff --git a/uni/lib/controller/local_storage/app_exams_database.dart b/uni/lib/controller/local_storage/app_exams_database.dart index f56ae0a0a..36264e347 100644 --- a/uni/lib/controller/local_storage/app_exams_database.dart +++ b/uni/lib/controller/local_storage/app_exams_database.dart @@ -10,7 +10,7 @@ import 'package:uni/model/entities/exam.dart'; /// See the [Exam] class to see what data is stored in this database. class AppExamsDatabase extends AppDatabase { AppExamsDatabase() - : super('exams.db', [_createScript], onUpgrade: migrate, version: 4); + : super('exams.db', [_createScript], onUpgrade: migrate, version: 5); Map months = { 'Janeiro': '01', 'Fevereiro': '02', diff --git a/uni/lib/controller/networking/network_router.dart b/uni/lib/controller/networking/network_router.dart index f05d88d54..d84ff6c95 100644 --- a/uni/lib/controller/networking/network_router.dart +++ b/uni/lib/controller/networking/network_router.dart @@ -44,44 +44,47 @@ class NetworkRouter { List faculties, { required bool persistentSession, }) async { - return _loginLock.synchronized(() async { - if (_lastLoginTime != null && - DateTime.now().difference(_lastLoginTime!) < - const Duration(minutes: 1) && - _cachedSession != null) { - Logger().d('Login request ignored due to recent login'); - return _cachedSession; - } + return _loginLock.synchronized( + () async { + if (_lastLoginTime != null && + DateTime.now().difference(_lastLoginTime!) < + const Duration(minutes: 1) && + _cachedSession != null) { + Logger().d('Login request ignored due to recent login'); + return _cachedSession; + } - final url = - '${NetworkRouter.getBaseUrls(faculties)[0]}mob_val_geral.autentica'; - final response = await http.post( - url.toUri(), - body: {'pv_login': username, 'pv_password': password}, - ).timeout(_requestTimeout); + final url = + '${NetworkRouter.getBaseUrls(faculties)[0]}mob_val_geral.autentica'; + final response = await http.post( + url.toUri(), + body: {'pv_login': username, 'pv_password': password}, + ).timeout(_requestTimeout); - if (response.statusCode != 200) { - Logger().e('Login failed with status code ${response.statusCode}'); - return null; - } + if (response.statusCode != 200) { + Logger().e('Login failed with status code ${response.statusCode}'); + return null; + } - final session = Session.fromLogin( - response, - faculties, - persistentSession: persistentSession, - ); + final session = Session.fromLogin( + response, + faculties, + persistentSession: persistentSession, + ); - if (session == null) { - Logger().e('Login failed: user not authenticated'); - return null; - } + if (session == null) { + Logger().e('Login failed: user not authenticated'); + return null; + } - Logger().i('Login successful'); - _lastLoginTime = DateTime.now(); - _cachedSession = session; + Logger().i('Login successful'); + _lastLoginTime = DateTime.now(); + _cachedSession = session; - return session; - }); + return session; + }, + timeout: _requestTimeout, + ); } /// Re-authenticates the user via the Sigarra API @@ -182,8 +185,10 @@ class NetworkRouter { final newSession = await reLoginFromSession(session); if (newSession == null) { - NavigationService.logoutAndPopHistory(null); - return Future.error('Login failed'); + NavigationService.logoutAndPopHistory(); + return Future.error( + 'Re-login failed; user might have changed password', + ); } session diff --git a/uni/lib/controller/parsers/parser_course_units.dart b/uni/lib/controller/parsers/parser_course_units.dart index c57764d2a..f9a1d7949 100644 --- a/uni/lib/controller/parsers/parser_course_units.dart +++ b/uni/lib/controller/parsers/parser_course_units.dart @@ -82,7 +82,7 @@ List parseCourseUnitsAndCourseAverage( codeName, // FIXME: this is not the abbreviation status: status, grade: grade, - ects: double.parse(ects), + ects: double.tryParse(ects), name: name, curricularYear: int.parse(year), semesterCode: semester, diff --git a/uni/lib/main.dart b/uni/lib/main.dart index 407d18030..01fac7edd 100644 --- a/uni/lib/main.dart +++ b/uni/lib/main.dart @@ -89,7 +89,12 @@ Future main() async { await dotenv .load(fileName: 'assets/env/.env', isOptional: true) .onError((error, stackTrace) { - Logger().e('Error loading .env file: $error', error, stackTrace); + Sentry.captureException(error, stackTrace: stackTrace); + Logger().e( + 'Error loading .env file: $error', + error: error, + stackTrace: stackTrace, + ); }); final savedTheme = await AppSharedPreferences.getThemeMode(); @@ -148,28 +153,29 @@ Future main() async { create: (_) => ThemeNotifier(savedTheme), ), ], - child: MyApp(route), + child: Application(route), ), ); }, ); } -/// Manages the state of the app -/// +/// Manages the state of the app. /// This class is necessary to track the app's state for -/// the current execution -class MyApp extends StatefulWidget { - const MyApp(this.initialRoute, {super.key}); +/// the current execution. +class Application extends StatefulWidget { + const Application(this.initialRoute, {super.key}); final String initialRoute; + static GlobalKey navigatorKey = GlobalKey(); + @override - State createState() => MyAppState(); + State createState() => ApplicationState(); } /// Manages the app depending on its current state -class MyAppState extends State { +class ApplicationState extends State { @override Widget build(BuildContext context) { SystemChrome.setPreferredOrientations([ @@ -178,6 +184,7 @@ class MyAppState extends State { return Consumer2( builder: (context, themeNotifier, localeNotifier, _) => MaterialApp( title: 'uni', + navigatorKey: Application.navigatorKey, theme: applicationLightTheme, darkTheme: applicationDarkTheme, themeMode: themeNotifier.getTheme(), diff --git a/uni/lib/model/entities/course.dart b/uni/lib/model/entities/course.dart index 1c739fb42..645aa7cef 100644 --- a/uni/lib/model/entities/course.dart +++ b/uni/lib/model/entities/course.dart @@ -23,8 +23,8 @@ class Course { /// Creates a new instance from a JSON object. Course.fromJson(Map data) - : id = data['cur_id'] as int, - festId = data['fest_id'] as int, + : id = (data['cur_id'] ?? 0) as int, + festId = (data['fest_id'] ?? 0) as int, name = data['cur_nome'] as String?, currYear = data['ano_curricular'] as String?, firstEnrollment = data['fest_a_lect_1_insc'] as int, diff --git a/uni/lib/model/entities/exam.dart b/uni/lib/model/entities/exam.dart index fb29f704a..1bfe20d0f 100644 --- a/uni/lib/model/entities/exam.dart +++ b/uni/lib/model/entities/exam.dart @@ -1,5 +1,4 @@ import 'package:intl/intl.dart'; -import 'package:logger/logger.dart'; import 'package:uni/model/entities/app_locale.dart'; /// Manages a generic Exam. @@ -87,11 +86,6 @@ class Exam { return '''$id - $subject - ${begin.year} - $month - ${begin.day} - $beginTime-$endTime - $type - $rooms - $weekDay'''; } - /// Prints the data in this exam to the [Logger] with an INFO level. - void printExam() { - Logger().i(toString()); - } - @override bool operator ==(Object other) => identical(this, other) || other is Exam && id == other.id; diff --git a/uni/lib/model/entities/trip.dart b/uni/lib/model/entities/trip.dart index 73b4ce6b4..616ce1c62 100644 --- a/uni/lib/model/entities/trip.dart +++ b/uni/lib/model/entities/trip.dart @@ -1,5 +1,3 @@ -import 'package:logger/logger.dart'; - /// Stores information about a bus trip. class Trip { Trip({ @@ -20,11 +18,6 @@ class Trip { }; } - /// Prints the data in this trip to the [Logger] with an INFO level. - void printTrip() { - Logger().i('$line ($destination) - $timeRemaining'); - } - /// Compares the remaining time of two trips. int compare(Trip other) { return timeRemaining.compareTo(other.timeRemaining); diff --git a/uni/lib/model/providers/state_provider_notifier.dart b/uni/lib/model/providers/state_provider_notifier.dart index 81543fd8b..6f4bbd9a7 100644 --- a/uni/lib/model/providers/state_provider_notifier.dart +++ b/uni/lib/model/providers/state_provider_notifier.dart @@ -22,6 +22,7 @@ abstract class StateProviderNotifier extends ChangeNotifier { _initializedFromStorage = !initialize, _initializedFromRemote = !initialize; + static const lockTimeout = Duration(seconds: 10); final Lock _lock = Lock(); final RequestStatus _initialStatus; RequestStatus _status; @@ -124,12 +125,18 @@ abstract class StateProviderNotifier extends ChangeNotifier { } Future forceRefresh(BuildContext context) async { - await _lock.synchronized(() async { - final session = context.read().session; - final profile = context.read().profile; - _updateStatus(RequestStatus.busy); - await _loadFromRemote(session, profile, force: true); - }); + await _lock.synchronized( + () async { + if (!context.mounted) { + return; + } + final session = context.read().session; + final profile = context.read().profile; + _updateStatus(RequestStatus.busy); + await _loadFromRemote(session, profile, force: true); + }, + timeout: lockTimeout, + ); } Future ensureInitialized(BuildContext context) async { @@ -141,32 +148,38 @@ abstract class StateProviderNotifier extends ChangeNotifier { } Future ensureInitializedFromRemote(BuildContext context) async { - await _lock.synchronized(() async { - if (_initializedFromRemote) { - return; - } + await _lock.synchronized( + () async { + if (_initializedFromRemote || !context.mounted) { + return; + } - _initializedFromRemote = true; + final session = context.read().session; + final profile = context.read().profile; - final session = context.read().session; - final profile = context.read().profile; + _initializedFromRemote = true; - await _loadFromRemote(session, profile); - }); + await _loadFromRemote(session, profile); + }, + timeout: lockTimeout, + ); } /// Loads data from storage into the provider. /// This will run once when the provider is first initialized. /// If the data is not available in storage, this method should do nothing. Future ensureInitializedFromStorage() async { - await _lock.synchronized(() async { - if (_initializedFromStorage) { - return; - } - - _initializedFromStorage = true; - await _loadFromStorage(); - }); + await _lock.synchronized( + () async { + if (_initializedFromStorage) { + return; + } + + _initializedFromStorage = true; + await _loadFromStorage(); + }, + timeout: lockTimeout, + ); } Future loadFromStorage(); diff --git a/uni/lib/view/bug_report/widgets/form.dart b/uni/lib/view/bug_report/widgets/form.dart index c94af32b6..1b8321ad8 100644 --- a/uni/lib/view/bug_report/widgets/form.dart +++ b/uni/lib/view/bug_report/widgets/form.dart @@ -246,7 +246,7 @@ class BugReportFormState extends State { child: Text( S.of(context).send, style: const TextStyle( - /*color: Colors.white*/ fontSize: 20, + fontSize: 20, ), ), ); @@ -276,7 +276,8 @@ class BugReportFormState extends State { Logger().i('Successfully submitted bug report.'); if (context.mounted) toastMsg = S.of(context).success; status = true; - } catch (e) { + } catch (e, stackTrace) { + await Sentry.captureException(e, stackTrace: stackTrace); Logger().e('Error while posting bug report:$e'); if (context.mounted) toastMsg = S.of(context).sent_error; status = false; @@ -284,14 +285,17 @@ class BugReportFormState extends State { clearForm(); - if (mounted) { + if (context.mounted) { FocusScope.of(context).requestFocus(FocusNode()); status ? await ToastMessage.success(context, toastMsg) : await ToastMessage.error(context, toastMsg); - setState(() { - _isButtonTapped = false; - }); + + if (context.mounted) { + setState(() { + _isButtonTapped = false; + }); + } } } diff --git a/uni/lib/view/common_widgets/page_transition.dart b/uni/lib/view/common_widgets/page_transition.dart index 2f3581a0d..da1273089 100644 --- a/uni/lib/view/common_widgets/page_transition.dart +++ b/uni/lib/view/common_widgets/page_transition.dart @@ -56,7 +56,7 @@ class PageTransition { case TermsAndConditionsState.accepted: return; case TermsAndConditionsState.rejected: - NavigationService.logoutAndPopHistory(null); + NavigationService.logoutAndPopHistory(); } } } diff --git a/uni/lib/view/locations/widgets/faculty_map.dart b/uni/lib/view/locations/widgets/faculty_map.dart index 6b3203302..1e2354e54 100644 --- a/uni/lib/view/locations/widgets/faculty_map.dart +++ b/uni/lib/view/locations/widgets/faculty_map.dart @@ -13,9 +13,9 @@ class FacultyMap extends StatelessWidget { switch (faculty) { case 'FEUP': return LocationsMap( - northEastBoundary: LatLng(41.17986, -8.59298), - southWestBoundary: LatLng(41.17670, -8.59991), - center: LatLng(41.17731, -8.59522), + northEastBoundary: const LatLng(41.17986, -8.59298), + southWestBoundary: const LatLng(41.17670, -8.59991), + center: const LatLng(41.17731, -8.59522), locations: locations, ); default: diff --git a/uni/lib/view/login/login.dart b/uni/lib/view/login/login.dart index a390331d3..476fa5af8 100644 --- a/uni/lib/view/login/login.dart +++ b/uni/lib/view/login/login.dart @@ -4,6 +4,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:logger/logger.dart'; import 'package:provider/provider.dart'; +import 'package:sentry_flutter/sentry_flutter.dart'; import 'package:uni/generated/l10n.dart'; import 'package:uni/model/entities/login_exceptions.dart'; import 'package:uni/model/providers/startup/session_provider.dart'; @@ -68,7 +69,7 @@ class LoginPageViewState extends State { _loggingIn = false; }); } - } catch (error) { + } catch (error, stackTrace) { setState(() { _loggingIn = false; }); @@ -79,7 +80,8 @@ class LoginPageViewState extends State { } else if (error is WrongCredentialsException) { unawaited(ToastMessage.error(context, error.message)); } else { - Logger().e(error); + Logger().e(error, stackTrace: stackTrace); + unawaited(Sentry.captureException(error, stackTrace: stackTrace)); unawaited(ToastMessage.error(context, S.of(context).failed_login)); } } diff --git a/uni/lib/view/navigation_service.dart b/uni/lib/view/navigation_service.dart index 9e8c336b6..903f5410e 100644 --- a/uni/lib/view/navigation_service.dart +++ b/uni/lib/view/navigation_service.dart @@ -1,21 +1,22 @@ +import 'dart:async'; + import 'package:flutter/material.dart'; import 'package:uni/controller/cleanup.dart'; +import 'package:uni/main.dart'; import 'package:uni/utils/drawer_items.dart'; import 'package:uni/view/login/login.dart'; /// Manages the navigation logic class NavigationService { - static final GlobalKey navigatorKey = - GlobalKey(); + static void logoutAndPopHistory() { + final context = Application.navigatorKey.currentContext!; - static void logoutAndPopHistory(BuildContext? dataContext) { - if (dataContext != null) { - cleanupStoredData(dataContext); - } + unawaited(cleanupStoredData(context)); - navigatorKey.currentState?.pushNamedAndRemoveUntil( - '/${DrawerItem.navLogOut.title}', - (_) => false, + Navigator.pushNamedAndRemoveUntil( + context, + '/${DrawerItem.navLogIn.title}', + (route) => false, ); } diff --git a/uni/pubspec.yaml b/uni/pubspec.yaml index 356067f04..52cdb9fcd 100644 --- a/uni/pubspec.yaml +++ b/uni/pubspec.yaml @@ -30,17 +30,17 @@ dependencies: flutter_local_notifications: ^15.1.0+1 flutter_localizations: sdk: flutter - flutter_map: ^4.0.0 + flutter_map: ^5.0.0 flutter_map_marker_popup: ^5.0.0 flutter_markdown: ^0.6.0 flutter_svg: ^2.0.0+1 flutter_widget_from_html_core: ^0.10.3 html: ^0.15.0 - http: ^0.13.0 + http: ^1.1.0 image: ^4.0.13 intl: ^0.18.0 - latlong2: ^0.8.1 - logger: ^1.1.0 + latlong2: ^0.9.0 + logger: ^2.0.2+1 material_design_icons_flutter: ^7.0.7296 path: ^1.8.0 path_provider: ^2.0.0 From 09a505f21789a84289ce5fb05de1b5d814cf015d Mon Sep 17 00:00:00 2001 From: Bruno Mendes Date: Wed, 4 Oct 2023 17:32:24 +0100 Subject: [PATCH 3/8] Bump lock timeout durations --- .../local_storage/app_database.dart | 2 +- .../controller/networking/network_router.dart | 2 +- .../providers/state_provider_notifier.dart | 2 +- uni/pubspec.lock | 24 +++++++++---------- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/uni/lib/controller/local_storage/app_database.dart b/uni/lib/controller/local_storage/app_database.dart index 885cba9f3..bcb3b56c5 100644 --- a/uni/lib/controller/local_storage/app_database.dart +++ b/uni/lib/controller/local_storage/app_database.dart @@ -21,7 +21,7 @@ class AppDatabase { List commands; /// The lock timeout for database operations. - static const Duration lockTimeout = Duration(seconds: 10); + static const Duration lockTimeout = Duration(seconds: 5); /// A lock that synchronizes all database insertions. static Lock lock = Lock(); diff --git a/uni/lib/controller/networking/network_router.dart b/uni/lib/controller/networking/network_router.dart index d84ff6c95..6b2ee56d3 100644 --- a/uni/lib/controller/networking/network_router.dart +++ b/uni/lib/controller/networking/network_router.dart @@ -22,7 +22,7 @@ class NetworkRouter { static http.Client? httpClient; /// The timeout for Sigarra login requests. - static const Duration _requestTimeout = Duration(seconds: 10); + static const Duration _requestTimeout = Duration(seconds: 30); /// The mutual exclusion primitive for login requests. static final Lock _loginLock = Lock(); diff --git a/uni/lib/model/providers/state_provider_notifier.dart b/uni/lib/model/providers/state_provider_notifier.dart index 6f4bbd9a7..cc248712e 100644 --- a/uni/lib/model/providers/state_provider_notifier.dart +++ b/uni/lib/model/providers/state_provider_notifier.dart @@ -22,7 +22,7 @@ abstract class StateProviderNotifier extends ChangeNotifier { _initializedFromStorage = !initialize, _initializedFromRemote = !initialize; - static const lockTimeout = Duration(seconds: 10); + static const lockTimeout = Duration(seconds: 30); final Lock _lock = Lock(); final RequestStatus _initialStatus; RequestStatus _status; diff --git a/uni/pubspec.lock b/uni/pubspec.lock index e336b67cc..c2e1870fb 100644 --- a/uni/pubspec.lock +++ b/uni/pubspec.lock @@ -415,18 +415,18 @@ packages: dependency: "direct main" description: name: flutter_map - sha256: "52c65a977daae42f9aae6748418dd1535eaf27186e9bac9bf431843082bc75a3" + sha256: "5286f72f87deb132daa1489442d6cc46e986fc105cb727d9ae1b602b35b1d1f3" url: "https://pub.dev" source: hosted - version: "4.0.0" + version: "5.0.0" flutter_map_marker_popup: dependency: "direct main" description: name: flutter_map_marker_popup - sha256: d4e22a00dd46f95a6f54c60b92950bd6f41021ca36629b1cf3fa0bf4fd39f421 + sha256: be209c68b19d4c10d9a2f5911e45f7c579624c43a353adb9bf0f2fec0cf30b8c url: "https://pub.dev" source: hosted - version: "5.0.0" + version: "5.2.0" flutter_markdown: dependency: "direct main" description: @@ -497,10 +497,10 @@ packages: dependency: "direct main" description: name: http - sha256: "5895291c13fa8a3bd82e76d5627f69e0d85ca6a30dcac95c4ea19a5d555879c2" + sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525" url: "https://pub.dev" source: hosted - version: "0.13.6" + version: "1.1.0" http_multi_server: dependency: transitive description: @@ -561,10 +561,10 @@ packages: dependency: "direct main" description: name: latlong2 - sha256: "08ef7282ba9f76e8495e49e2dc4d653015ac929dce5f92b375a415d30b407ea0" + sha256: "18712164760cee655bc790122b0fd8f3d5b3c36da2cb7bf94b68a197fbb0811b" url: "https://pub.dev" source: hosted - version: "0.8.2" + version: "0.9.0" lists: dependency: transitive description: @@ -577,10 +577,10 @@ packages: dependency: "direct main" description: name: logger - sha256: "7ad7215c15420a102ec687bb320a7312afd449bac63bfb1c60d9787c27b9767f" + sha256: "6bbb9d6f7056729537a4309bda2e74e18e5d9f14302489cc1e93f33b3fe32cac" url: "https://pub.dev" source: hosted - version: "1.4.0" + version: "2.0.2+1" logging: dependency: transitive description: @@ -698,10 +698,10 @@ packages: dependency: transitive description: name: package_info_plus - sha256: "10259b111176fba5c505b102e3a5b022b51dd97e30522e906d6922c745584745" + sha256: "6ff267fcd9d48cb61c8df74a82680e8b82e940231bb5f68356672fde0397334a" url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "4.1.0" package_info_plus_platform_interface: dependency: transitive description: From d15ebc15def489b88546f2413201f8e8e84de763 Mon Sep 17 00:00:00 2001 From: Bruno Mendes Date: Wed, 4 Oct 2023 17:44:30 +0100 Subject: [PATCH 4/8] Fix empty course parsing --- uni/lib/generated/intl/messages_en.dart | 2 +- uni/lib/generated/intl/messages_pt_PT.dart | 2 +- uni/lib/generated/l10n.dart | 4 +-- uni/lib/l10n/intl_en.arb | 2 +- uni/lib/l10n/intl_pt_PT.arb | 2 +- uni/lib/model/entities/course.dart | 26 ++++++++++++-------- uni/lib/model/entities/profile.dart | 5 +++- uni/lib/view/home/widgets/schedule_card.dart | 2 -- 8 files changed, 26 insertions(+), 19 deletions(-) diff --git a/uni/lib/generated/intl/messages_en.dart b/uni/lib/generated/intl/messages_en.dart index 7c9d65e6c..112516f05 100644 --- a/uni/lib/generated/intl/messages_en.dart +++ b/uni/lib/generated/intl/messages_en.dart @@ -107,7 +107,7 @@ class MessageLookup extends MessageLookupByLibrary { "D. Beatriz\'s stationery store"), "dona_bia_building": MessageLookupByLibrary.simpleMessage( "Floor -1 of building B (B-142)"), - "ects": MessageLookupByLibrary.simpleMessage("ECTs performed: "), + "ects": MessageLookupByLibrary.simpleMessage("ECTS performed: "), "edit_off": MessageLookupByLibrary.simpleMessage("Edit"), "edit_on": MessageLookupByLibrary.simpleMessage("Finish editing"), "empty_text": diff --git a/uni/lib/generated/intl/messages_pt_PT.dart b/uni/lib/generated/intl/messages_pt_PT.dart index c86c90267..68a173ffe 100644 --- a/uni/lib/generated/intl/messages_pt_PT.dart +++ b/uni/lib/generated/intl/messages_pt_PT.dart @@ -106,7 +106,7 @@ class MessageLookup extends MessageLookupByLibrary { MessageLookupByLibrary.simpleMessage("Papelaria D. Beatriz"), "dona_bia_building": MessageLookupByLibrary.simpleMessage( "Piso -1 do edifício B (B-142)"), - "ects": MessageLookupByLibrary.simpleMessage("ECTs realizados: "), + "ects": MessageLookupByLibrary.simpleMessage("ECTS realizados: "), "edit_off": MessageLookupByLibrary.simpleMessage("Editar\n"), "edit_on": MessageLookupByLibrary.simpleMessage("Concluir edição"), "empty_text": MessageLookupByLibrary.simpleMessage( diff --git a/uni/lib/generated/l10n.dart b/uni/lib/generated/l10n.dart index 804bd1400..936259b3e 100644 --- a/uni/lib/generated/l10n.dart +++ b/uni/lib/generated/l10n.dart @@ -480,10 +480,10 @@ class S { ); } - /// `ECTs performed: ` + /// `ECTS performed: ` String get ects { return Intl.message( - 'ECTs performed: ', + 'ECTS performed: ', name: 'ects', desc: '', args: [], diff --git a/uni/lib/l10n/intl_en.arb b/uni/lib/l10n/intl_en.arb index acc5d7b7c..b1d6be897 100644 --- a/uni/lib/l10n/intl_en.arb +++ b/uni/lib/l10n/intl_en.arb @@ -86,7 +86,7 @@ "@dona_bia": {}, "dona_bia_building": "Floor -1 of building B (B-142)", "@dona_bia_building": {}, - "ects": "ECTs performed: ", + "ects": "ECTS performed: ", "@ects": {}, "edit_off": "Edit", "@edit_off": {}, diff --git a/uni/lib/l10n/intl_pt_PT.arb b/uni/lib/l10n/intl_pt_PT.arb index 7552ae5c3..4315ac0af 100644 --- a/uni/lib/l10n/intl_pt_PT.arb +++ b/uni/lib/l10n/intl_pt_PT.arb @@ -86,7 +86,7 @@ "@dona_bia": {}, "dona_bia_building": "Piso -1 do edifício B (B-142)", "@dona_bia_building": {}, - "ects": "ECTs realizados: ", + "ects": "ECTS realizados: ", "@ects": {}, "edit_off": "Editar\n", "@edit_off": {}, diff --git a/uni/lib/model/entities/course.dart b/uni/lib/model/entities/course.dart index 645aa7cef..ef861730f 100644 --- a/uni/lib/model/entities/course.dart +++ b/uni/lib/model/entities/course.dart @@ -10,7 +10,7 @@ class Course { Course({ required this.id, - this.festId = 0, + this.festId, this.name, this.abbreviation, this.currYear, @@ -21,15 +21,21 @@ class Course { this.currentAverage, }); - /// Creates a new instance from a JSON object. - Course.fromJson(Map data) - : id = (data['cur_id'] ?? 0) as int, - festId = (data['fest_id'] ?? 0) as int, - name = data['cur_nome'] as String?, - currYear = data['ano_curricular'] as String?, - firstEnrollment = data['fest_a_lect_1_insc'] as int, - abbreviation = data['abbreviation'] as String?, - faculty = data['inst_sigla']?.toString().toLowerCase(); + static Course? fromJson(Map data) { + if (data['cur_id'] == null || data['fest_id'] == 0) { + return null; + } + + return Course( + id: data['cur_id'] as int, + festId: data['fest_id'] as int, + name: data['cur_nome'] as String?, + currYear: data['ano_curricular'] as String?, + firstEnrollment: data['fest_a_lect_1_insc'] as int?, + abbreviation: data['abbreviation'] as String?, + faculty: data['inst_sigla']?.toString().toLowerCase(), + ); + } final int id; final int? festId; diff --git a/uni/lib/model/entities/profile.dart b/uni/lib/model/entities/profile.dart index 59fecf190..0085f0955 100644 --- a/uni/lib/model/entities/profile.dart +++ b/uni/lib/model/entities/profile.dart @@ -23,7 +23,10 @@ class Profile { responseBody = responseBody as Map; final courses = []; for (final c in responseBody['cursos'] as List) { - courses.add(Course.fromJson(c as Map)); + final course = Course.fromJson(c as Map); + if (course != null) { + courses.add(course); + } } return Profile( diff --git a/uni/lib/view/home/widgets/schedule_card.dart b/uni/lib/view/home/widgets/schedule_card.dart index 039db9c19..f70d40b61 100644 --- a/uni/lib/view/home/widgets/schedule_card.dart +++ b/uni/lib/view/home/widgets/schedule_card.dart @@ -97,8 +97,6 @@ class ScheduleCard extends GenericCard { rows.add(createRowFromLecture(context, lecture)); } - rows.add(const Padding(padding: EdgeInsets.only(bottom: 10))); - if (lectures.length >= 2) { break; } From d8ff27021a0450acd39396b8a8d12d569e3247df Mon Sep 17 00:00:00 2001 From: Bruno Mendes Date: Wed, 4 Oct 2023 17:46:30 +0100 Subject: [PATCH 5/8] Bump app lectures database version to force migration --- uni/lib/controller/local_storage/app_lectures_database.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uni/lib/controller/local_storage/app_lectures_database.dart b/uni/lib/controller/local_storage/app_lectures_database.dart index a4e6b55c5..7430020e5 100644 --- a/uni/lib/controller/local_storage/app_lectures_database.dart +++ b/uni/lib/controller/local_storage/app_lectures_database.dart @@ -16,7 +16,7 @@ class AppLecturesDatabase extends AppDatabase { createScript, ], onUpgrade: migrate, - version: 6, + version: 7, ); static const createScript = ''' CREATE TABLE lectures(subject TEXT, typeClass TEXT, From 6225e1900a6c27bcfbf4f774eac3b171f9cb5ee3 Mon Sep 17 00:00:00 2001 From: Bruno Mendes Date: Wed, 4 Oct 2023 17:51:13 +0100 Subject: [PATCH 6/8] Do not set general page state if disposed --- .../common_widgets/pages_layouts/general/general.dart | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/uni/lib/view/common_widgets/pages_layouts/general/general.dart b/uni/lib/view/common_widgets/pages_layouts/general/general.dart index 116f830be..dd8ad236d 100644 --- a/uni/lib/view/common_widgets/pages_layouts/general/general.dart +++ b/uni/lib/view/common_widgets/pages_layouts/general/general.dart @@ -25,7 +25,7 @@ abstract class GeneralPageViewState extends State { @override Widget build(BuildContext context) { WidgetsBinding.instance.addPostFrameCallback((_) async { - if (_loadedOnce) { + if (_loadedOnce || !mounted) { return; } _loadedOnce = true; @@ -40,9 +40,11 @@ abstract class GeneralPageViewState extends State { await Sentry.captureException(e, stackTrace: stackTrace); } - setState(() { - _loading = false; - }); + if (mounted) { + setState(() { + _loading = false; + }); + } }); return getScaffold( From aabb1454d9b49feee6627f533d1f2f2b4b860b0a Mon Sep 17 00:00:00 2001 From: Bruno Mendes Date: Wed, 4 Oct 2023 18:01:50 +0100 Subject: [PATCH 7/8] Fix bus user stops page not updating after insertion --- uni/lib/model/providers/lazy/bus_stop_provider.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/uni/lib/model/providers/lazy/bus_stop_provider.dart b/uni/lib/model/providers/lazy/bus_stop_provider.dart index b739dd8d0..2b9f7c36b 100644 --- a/uni/lib/model/providers/lazy/bus_stop_provider.dart +++ b/uni/lib/model/providers/lazy/bus_stop_provider.dart @@ -51,7 +51,9 @@ class BusStopProvider extends StateProviderNotifier { _configuredBusStops[stopCode] = stopData; } + notifyListeners(); await fetchUserBusTrips(); + notifyListeners(); final db = AppBusStopDatabase(); await db.setBusStops(configuredBusStops); @@ -61,9 +63,10 @@ class BusStopProvider extends StateProviderNotifier { String stopCode, ) async { _configuredBusStops.remove(stopCode); - notifyListeners(); + notifyListeners(); await fetchUserBusTrips(); + notifyListeners(); final db = AppBusStopDatabase(); await db.setBusStops(_configuredBusStops); @@ -75,9 +78,10 @@ class BusStopProvider extends StateProviderNotifier { ) async { _configuredBusStops[stopCode]!.favorited = !_configuredBusStops[stopCode]!.favorited; - notifyListeners(); + notifyListeners(); await fetchUserBusTrips(); + notifyListeners(); final db = AppBusStopDatabase(); await db.updateFavoriteBusStop(stopCode); From 59558fc1a4b0a1d65581055657c389f937225ad8 Mon Sep 17 00:00:00 2001 From: Bruno Mendes Date: Wed, 4 Oct 2023 18:52:30 +0100 Subject: [PATCH 8/8] Do not wait for trips before dismissing bus dialog --- .../view/bus_stop_selection/widgets/bus_stop_search.dart | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/uni/lib/view/bus_stop_selection/widgets/bus_stop_search.dart b/uni/lib/view/bus_stop_selection/widgets/bus_stop_search.dart index be55fc3b8..5155dde2d 100644 --- a/uni/lib/view/bus_stop_selection/widgets/bus_stop_search.dart +++ b/uni/lib/view/bus_stop_selection/widgets/bus_stop_search.dart @@ -112,9 +112,11 @@ class BusStopSearch extends SearchDelegate { child: Text(S.of(context).confirm), onPressed: () async { if (stopData!.configuredBuses.isNotEmpty) { - await Provider.of(context, listen: false) - .addUserBusStop(stopCode!, stopData!); - if (context.mounted) Navigator.pop(context); + unawaited( + Provider.of(context, listen: false) + .addUserBusStop(stopCode!, stopData!), + ); + Navigator.pop(context); } }, )