From 40733756ab3ad69e48bff2ffc6d22ea67fe18b04 Mon Sep 17 00:00:00 2001 From: Tommy Chow Date: Sun, 9 Aug 2026 13:17:14 -0700 Subject: [PATCH] build(deps): bump flutter pin to 3.44.9 and upgrade dependencies The pubspec pinned Flutter 3.44.5 while the toolchain had moved to 3.44.9, so `flutter pub upgrade` failed version solving outright and no dependency had been upgradable for a while. Bumping the pin unblocks resolution (CI reads the same field via flutter-version-file). Notable bumps: dio 5.9.2 -> 5.11.0, firebase_core 4.10 -> 4.13 (plus crashlytics/analytics/performance), app_links 7.2.1, flutter_markdown_plus 1.0.12, intl, path_provider, webview_flutter, flutter_cache_manager. dio 5.11 adds DioExceptionType.transformTimeout, which broke the exhaustive switch in BaseApiClient._handleError. Grouped it with the other timeout types and covered all four mappings with tests, which were previously untested. Raised the json_annotation floor to ^4.12.0 to silence a json_serializable build warning; the resolved version was already 4.12.0. flutter_secure_storage stays on v9 deliberately. v10.0.0 shipped in 5.0.0 and was reverted in 5.0.1 (ba28e09) while chasing the #484 startup freeze on low-end Android 14, and upstream #1084 (unrecoverable NPE in initialize() on Android 13) is still open. v9 pins win32 ^5, so device_info_plus, package_info_plus and wakelock_plus are held at their current majors too - their only breaking change was a win32 6.0.0 bump that affects Windows only. Co-Authored-By: Claude Opus 5 --- lib/apis/base_api_client.dart | 5 +- pubspec.lock | 190 +++++++++++++++------------- pubspec.yaml | 12 +- test/apis/base_api_client_test.dart | 35 +++++ 4 files changed, 148 insertions(+), 94 deletions(-) diff --git a/lib/apis/base_api_client.dart b/lib/apis/base_api_client.dart index d35e84fc..4fd3745c 100644 --- a/lib/apis/base_api_client.dart +++ b/lib/apis/base_api_client.dart @@ -161,7 +161,8 @@ abstract class BaseApiClient { final exception = switch (error.type) { DioExceptionType.connectionTimeout || DioExceptionType.sendTimeout || - DioExceptionType.receiveTimeout => + DioExceptionType.receiveTimeout || + DioExceptionType.transformTimeout => TimeoutException(_getTimeoutMessage(error.type)), DioExceptionType.connectionError => NetworkException( 'No internet connection. Please check your network.', @@ -202,6 +203,8 @@ abstract class BaseApiClient { return 'Upload timeout. Please try again.'; case DioExceptionType.receiveTimeout: return 'Server response timeout. Please try again.'; + case DioExceptionType.transformTimeout: + return 'Response processing timeout. Please try again.'; default: return 'Request timeout. Please try again.'; } diff --git a/pubspec.lock b/pubspec.lock index d8fdc23c..128e2ed0 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -13,10 +13,10 @@ packages: dependency: transitive description: name: _flutterfire_internals - sha256: "0d1f0adfabbab9f46a1a80ce84a4d8b852b6e4dbf53ce413b30e0cf7d3631b71" + sha256: "6727cf2ced9b104abca9daa278380be2eca2b98ce33d4b46f11708e387dc6b4d" url: "https://pub.dev" source: hosted - version: "1.3.72" + version: "1.3.76" advanced_in_app_review: dependency: "direct main" description: @@ -45,10 +45,10 @@ packages: dependency: "direct main" description: name: app_links - sha256: "4ec328cd9fd51fd0e7eb8870a9612c1fde0f091901932238c4f4e60b5f7f1315" + sha256: f8db46d2ea9ff6f3a37191a7fd5b7813da1253ace8c32c1b9eadace41d1188ea url: "https://pub.dev" source: hosted - version: "7.1.2" + version: "7.2.1" app_links_linux: dependency: transitive description: @@ -61,10 +61,10 @@ packages: dependency: transitive description: name: app_links_platform_interface - sha256: "78a18580eecac98108d1eef52a7db668bc317714f5205e616973363326efe333" + sha256: "7546f09a6e93f4a2df2fe2bd40a5c6c64310ac461b036d82b43033be7a59f809" url: "https://pub.dev" source: hosted - version: "2.0.3" + version: "2.0.4" app_links_web: dependency: transitive description: @@ -118,34 +118,34 @@ packages: dependency: transitive description: name: build - sha256: a156715e7cd728130c592f30552575908aae5b100005fbc1f0fb16b3c03a3d10 + sha256: "45d14a0fb23e018d8287c32fc98d726ce466b231928ed9b9200f29bd3ccd39ae" url: "https://pub.dev" source: hosted - version: "4.0.6" + version: "4.0.7" build_config: dependency: transitive description: name: build_config - sha256: "4070d2a59f8eec34c97c86ceb44403834899075f66e8a9d59706f8e7834f6f71" + sha256: "94eaf6708fe64408c632ef2689ca3777b112f9421306ccf4f8c84d7c5c9f83f8" url: "https://pub.dev" source: hosted - version: "1.3.0" + version: "1.3.2" build_daemon: dependency: transitive description: name: build_daemon - sha256: bf05f6e12cfea92d3c09308d7bcdab1906cd8a179b023269eed00c071004b957 + sha256: "79e05eaf15a48d7230b053a4363b8eaac0cc234bbd0134c3229455481f55cbc6" url: "https://pub.dev" source: hosted - version: "4.1.1" + version: "4.1.5" build_runner: dependency: "direct dev" description: name: build_runner - sha256: "1523ce62448ebac2c15a8ba5fbad8acac169788658a7dd2a1c2d9c2a9318b9a6" + sha256: "5367e521935b102bdf1e735d2aab461e36b2edca6517662d088dd04cc39f8d16" url: "https://pub.dev" source: hosted - version: "2.15.0" + version: "2.15.1" built_collection: dependency: transitive description: @@ -158,10 +158,10 @@ packages: dependency: transitive description: name: built_value - sha256: "34e4067d30ce212937df995f03b69992eea683539ceeac7f679a1f1eba055b56" + sha256: "31b24be6615ec7fcf70b3aa5a7469fe35826485e639a16dd7eb83ba30e4cc6a8" url: "https://pub.dev" source: hosted - version: "8.12.6" + version: "8.12.7" cached_network_image: dependency: "direct main" description: @@ -278,10 +278,10 @@ packages: dependency: transitive description: name: dbus - sha256: "792974a4007974fbc5c1b5433eb2330a9db3e368c3f906253af4c007d0f49a91" + sha256: "0ce9b0a839e6dee59a37a623d2fc26a35bbbe6404213e419b0d6411023d62645" url: "https://pub.dev" source: hosted - version: "0.7.13" + version: "0.7.14" device_info_plus: dependency: "direct main" description: @@ -302,18 +302,18 @@ packages: dependency: "direct main" description: name: dio - sha256: aff32c08f92787a557dd5c0145ac91536481831a01b4648136373cddb0e64f8c + sha256: "0df44ebba85e503958eb75d07eedd3c86275a58c1d3eda2f2ce8f0a2c3abbb3c" url: "https://pub.dev" source: hosted - version: "5.9.2" + version: "5.11.0" dio_web_adapter: dependency: transitive description: name: dio_web_adapter - sha256: "2f9e64323a7c3c7ef69567d5c800424a11f8337b8b228bad02524c9fb3c1f340" + sha256: "0786d0b7295a373de356fc0af4f6f1d0ab2844ed31b19dfc5e7556b70e24212c" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.2.1" dismissible_page: dependency: transitive description: @@ -367,90 +367,90 @@ packages: dependency: "direct main" description: name: firebase_analytics - sha256: "1f68d8a30265149035e9bb0b73962e43f3bf2debef4a7ae2d1d588361d5858a9" + sha256: a139dd0ada1c6e0ffd77bfdb877ac9061ffdec7c415e3e06113bdf8844db771f url: "https://pub.dev" source: hosted - version: "12.4.2" + version: "12.4.6" firebase_analytics_platform_interface: dependency: transitive description: name: firebase_analytics_platform_interface - sha256: "65f97fb923f036d487aa95be99eab90e0f8f636e4783c94deeb52c0e6f5dbae7" + sha256: "448c319ea895da002e43892c7d3f15dccbc3c4c3b81d3e307e37da885ea52bdf" url: "https://pub.dev" source: hosted - version: "6.0.2" + version: "6.0.6" firebase_analytics_web: dependency: transitive description: name: firebase_analytics_web - sha256: ec49a95c6abaadbd6a4327cc2680d911f86e62fdf6f2c96a3a326603410e2abf + sha256: "67f287a0df75f27eafdd4a66a41e44f232c3aba713ea4794a1159893665a8bf5" url: "https://pub.dev" source: hosted - version: "0.6.1+8" + version: "0.6.1+12" firebase_core: dependency: "direct main" description: name: firebase_core - sha256: ec46a100a560d3bd5f97f2d89ba7492cb09b6dd0a4a28753d1258f360d6bd9f9 + sha256: "9478ca6700c02d315c6aba37e206e612317f98bb4f335bb1cbd6e0ce67dcf764" url: "https://pub.dev" source: hosted - version: "4.10.0" + version: "4.13.0" firebase_core_platform_interface: dependency: transitive description: name: firebase_core_platform_interface - sha256: "4a120366dbf7d5a8ee9438978530b664b855728fb8dcc3a201017660817e555b" + sha256: e28f9afdcb5b0f0a8ea74ea3b322f5a7592c81cb45dd9d189913bdae08a2089a url: "https://pub.dev" source: hosted - version: "7.0.1" + version: "8.1.0" firebase_core_web: dependency: transitive description: name: firebase_core_web - sha256: "5ad1be848692ec148f2d6a8ad2a3838cb852ea5f3c9e6479a7afce479e1854f8" + sha256: f471a288b0101a45567548322ac4a5ad31e3ecbf87a576dcc0e424e6a11e04ea url: "https://pub.dev" source: hosted - version: "3.8.0" + version: "3.10.0" firebase_crashlytics: dependency: "direct main" description: name: firebase_crashlytics - sha256: "5d111db2b40426e76e2da95d133c19a9dbcf6500c4e9b3785c68da51fb3f6602" + sha256: "96c1d85de9eddc07061d3f7e2fb75596e75a45c9cec9c2e3a7cc9f97e6f3a748" url: "https://pub.dev" source: hosted - version: "5.2.3" + version: "5.2.7" firebase_crashlytics_platform_interface: dependency: transitive description: name: firebase_crashlytics_platform_interface - sha256: "5bf4a83a1b9e0a5218f6d6491227440dd659242a55b16c279de0b8839791539a" + sha256: "47d83b71fd39c580297c696a507a7c2652680ea2045e40c6c4e3c371b0ee7bc6" url: "https://pub.dev" source: hosted - version: "3.8.23" + version: "3.8.27" firebase_performance: dependency: "direct main" description: name: firebase_performance - sha256: a6b88d6933e02e4ba71f0641121dd7024f036b32a9929a01b638b3696a98e9ce + sha256: "570895b372791fca22080b369125fe13f3b6e1682ab0cbc204e2b46acd19b314" url: "https://pub.dev" source: hosted - version: "0.11.4+2" + version: "0.11.4+6" firebase_performance_platform_interface: dependency: transitive description: name: firebase_performance_platform_interface - sha256: "6b9912709d315f4f2e0c87ddada8fe4f4d1b06aa74df52a8ced19fed087f0591" + sha256: "2979eac652173512ac07c45b8ce2ea2e37f16a7f8e4a003a3331405917886d72" url: "https://pub.dev" source: hosted - version: "0.2.0+2" + version: "0.2.0+6" firebase_performance_web: dependency: transitive description: name: firebase_performance_web - sha256: "5ccf0a4511cd477406fe4c02ee2cabee5bd7d3c9e8cc5effdba5dcbd46b90064" + sha256: afb3b87ab2428fa86e4fb092c8069f1d860eb5be12ca5a57795648986093f23d url: "https://pub.dev" source: hosted - version: "0.1.8+8" + version: "0.1.8+12" fixnum: dependency: transitive description: @@ -476,10 +476,10 @@ packages: dependency: "direct main" description: name: flutter_cache_manager - sha256: "400b6592f16a4409a7f2bb929a9a7e38c72cceb8ffb99ee57bbf2cb2cecf8386" + sha256: "1de7849213b4c73c85aca7e0ac687a9a5d82ccdb594366b9dcc26cb6a2189cd2" url: "https://pub.dev" source: hosted - version: "3.4.1" + version: "3.4.2" flutter_colorpicker: dependency: "direct main" description: @@ -508,10 +508,10 @@ packages: dependency: "direct main" description: name: flutter_markdown_plus - sha256: "039177906850278e8fb1cd364115ee0a46281135932fa8ecea8455522166d2de" + sha256: fce641d6c2106cc495de1cd603f97a4f9d615a97a64011928ded380dbdade935 url: "https://pub.dev" source: hosted - version: "1.0.7" + version: "1.0.12" flutter_mobx: dependency: "direct main" description: @@ -670,10 +670,10 @@ packages: dependency: transitive description: name: image - sha256: "6300175e00616bbc832e2fc91bfa4d776af5402c81c7151bee6905bb08473c52" + sha256: f9881ff4998044947ec38d098bc7c8316ae1186fa786eddffdb867b9bc94dfce url: "https://pub.dev" source: hosted - version: "4.9.1" + version: "4.8.0" in_app_review: dependency: transitive description: @@ -694,10 +694,10 @@ packages: dependency: "direct main" description: name: intl - sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5" + sha256: "1ca20c894b1717686a2319b8548763d812bc0aabdac580420a44c5178c57a867" url: "https://pub.dev" source: hosted - version: "0.20.2" + version: "0.20.3" io: dependency: transitive description: @@ -710,18 +710,26 @@ packages: dependency: transitive description: name: jni - sha256: c2230682d5bc2362c1c9e8d3c7f406d9cbba23ab3f2e203a025dd47e0fb2e68f + sha256: f038e58b4dc2c9037f50e233175086337e0b305e356d28211bf55f21c504cbd3 url: "https://pub.dev" source: hosted - version: "1.0.0" + version: "1.0.3" jni_flutter: dependency: transitive description: name: jni_flutter - sha256: "8b59e590786050b1cd866677dddaf76b1ade5e7bc751abe04b86e84d379d3ba6" + sha256: "7b717011ea40d04fd47c2731d3d1d36eb99eba3435c2753d62489e8c3c9991d5" url: "https://pub.dev" source: hosted - version: "1.0.1" + version: "1.0.2" + jni_util: + dependency: transitive + description: + name: jni_util + sha256: "1ba86da04a5f2bf18fde2edb235587e70c5b0fc5bd4ba955f46b00942c3fc35f" + url: "https://pub.dev" + source: hosted + version: "1.0.0" js: dependency: transitive description: @@ -742,10 +750,10 @@ packages: dependency: "direct dev" description: name: json_serializable - sha256: ffcd10cde35a93b2abbbcc26bd9971f4ca93763e8abe78d855e3c4177797e501 + sha256: e45aefa0324f08c683caafbb94b72837aa6193c61822799c916e45f4a263113d url: "https://pub.dev" source: hosted - version: "6.14.0" + version: "6.14.1" leak_tracker: dependency: transitive description: @@ -878,10 +886,10 @@ packages: dependency: transitive description: name: objective_c - sha256: "6cb691c686fa2838c6deb34980d426145c2a5d537491cb83d463c33cdbc726ed" + sha256: b7fb95a6d9a4f009edd63dc5ac69f07420b23a16161c6dd8660290b59c602e8e url: "https://pub.dev" source: hosted - version: "9.4.1" + version: "9.5.0" octo_image: dependency: transitive description: @@ -934,10 +942,10 @@ packages: dependency: "direct main" description: name: path_provider - sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" + sha256: a7f4874f987173da295a61c181b8ee71dab59b332a486b391babf26a1b884825 url: "https://pub.dev" source: hosted - version: "2.1.5" + version: "2.1.6" path_provider_android: dependency: transitive description: @@ -958,18 +966,18 @@ packages: dependency: transitive description: name: path_provider_linux - sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 + sha256: "58c2005f147315b11e9b4a7bc889cd5203e250cba8e3f012dae259b4972b5c16" url: "https://pub.dev" source: hosted - version: "2.2.1" + version: "2.2.2" path_provider_platform_interface: dependency: transitive description: name: path_provider_platform_interface - sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" + sha256: "484838772624c3a4b94f1e44a3e19897fee738f2d5c4ce448443b0417f7c9dda" url: "https://pub.dev" source: hosted - version: "2.1.2" + version: "2.1.3" path_provider_windows: dependency: transitive description: @@ -1022,10 +1030,10 @@ packages: dependency: transitive description: name: posix - sha256: "185ef7606574f789b40f289c233efa52e96dead518aed988e040a10737febb07" + sha256: bc1bad54ad2b735816e31f8d4600cfde6c7839975085ddfbca48b6c9f7c4044e url: "https://pub.dev" source: hosted - version: "6.5.0" + version: "6.5.2" provider: dependency: "direct main" description: @@ -1078,10 +1086,10 @@ packages: dependency: transitive description: name: shared_preferences_android - sha256: "93ae5884a9df5d3bb696825bceb3a17590754548b5d740eba51500afc8d088f5" + sha256: "0634e64bd719f89c012f392938e173521f535d3ecaf66558fa94a056d22b5cc7" url: "https://pub.dev" source: hosted - version: "2.4.26" + version: "2.4.27" shared_preferences_foundation: dependency: transitive description: @@ -1164,18 +1172,18 @@ packages: dependency: transitive description: name: source_gen - sha256: ec37cc0e6694374cbef59ed79685572c870a54ede6fa30a3e420feb3adffea02 + sha256: a603f1fb984a7391ae5978d1b92bfaaa08b350dca5c825256f925818f7943bf5 url: "https://pub.dev" source: hosted - version: "4.2.3" + version: "4.2.4" source_helper: dependency: transitive description: name: source_helper - sha256: "4227d54ceefd0bb8ca4c8fcb96e1719dc53f1ee1b6e2ca9d7a6069da160e4eae" + sha256: "5e6f216fdf6376c9f3852381ae037499797a3385377d388b011dac98d303c67c" url: "https://pub.dev" source: hosted - version: "1.3.12" + version: "1.3.13" source_span: dependency: transitive description: @@ -1212,10 +1220,10 @@ packages: dependency: transitive description: name: sqflite_darwin - sha256: "164a5d73ab87a134566057219988bafde837029a64264e61f1f04376ef3cfcd2" + sha256: c86ca18b8f666bbf903924687fe21cc16fc385d086005067e26619ca530bef9f url: "https://pub.dev" source: hosted - version: "2.4.3" + version: "2.4.3+1" sqflite_platform_interface: dependency: transitive description: @@ -1260,10 +1268,10 @@ packages: dependency: transitive description: name: synchronized - sha256: "93b153dcb6a26dcddee6ca087dd634b53e38c10b5aa163e8e49501a776456153" + sha256: "61894a1956de6b4fc1aefd0892e109514a1a706cbece3ac59decd90ff5a7a423" url: "https://pub.dev" source: hosted - version: "3.4.1" + version: "3.4.1+1" term_glyph: dependency: transitive description: @@ -1364,18 +1372,18 @@ packages: dependency: transitive description: name: uuid - sha256: "1fef9e8e11e2991bb773070d4656b7bd5d850967a2456cfc83cf47925ba79489" + sha256: "9b129329f58692f6e6578329498a8fe9fbe98f090beb764ffbb8ee2eadd01dcd" url: "https://pub.dev" source: hosted - version: "4.5.3" + version: "4.6.0" vector_graphics: dependency: transitive description: name: vector_graphics - sha256: "2306c03da2ba81724afeb589c351ebbc0aa7d86005925be8f8735856dbe5e42d" + sha256: "9d0e3b9cb16542ad660daee871e726a10d13a93b7b5391677c3160e8f5e83935" url: "https://pub.dev" source: hosted - version: "1.2.2" + version: "1.2.3" vector_graphics_codec: dependency: transitive description: @@ -1388,10 +1396,10 @@ packages: dependency: transitive description: name: vector_graphics_compiler - sha256: "7ee12e6dffe0fc8e755179d6d91b3b34f5924223fc104d85572ef9180d73d172" + sha256: "4dca4feb77dc3ec7f6e27e49c53241eb8217f55e4f9b12599a27f8903bca5682" url: "https://pub.dev" source: hosted - version: "1.2.5" + version: "1.3.0" vector_math: dependency: transitive description: @@ -1420,10 +1428,10 @@ packages: dependency: transitive description: name: wakelock_plus_platform_interface - sha256: b13f99e992e7ae6a152e16c5559d3c07ff445b13330192662494e614ca3e7d7b + sha256: "0618d1799f0b28bcf98255b4ee8313e6fc4d38589dc4ee5fe5840d57d1aff6da" url: "https://pub.dev" source: hosted - version: "1.5.1" + version: "1.6.0" watcher: dependency: transitive description: @@ -1460,10 +1468,10 @@ packages: dependency: "direct main" description: name: webview_flutter - sha256: e4d3474277c5043f5f3100ed27d94ad693abfd5c602b0221c719a4497e4ba1e4 + sha256: d53e1ccf5516f25017e3c9d44c39034db352d20fa34fe200674270242c2c5111 url: "https://pub.dev" source: hosted - version: "4.14.0" + version: "4.14.1" webview_flutter_android: dependency: "direct main" description: @@ -1516,10 +1524,10 @@ packages: dependency: transitive description: name: xml - sha256: "67f0aff7be013d107995e9b75bf4e7f2c3ef2dfdb2c8e68024bba0a7fd5756a4" + sha256: "971043b3a0d3da28727e40ed3e0b5d18b742fa5a68665cca88e74b7876d5e025" url: "https://pub.dev" source: hosted - version: "7.0.1" + version: "6.6.1" yaml: dependency: transitive description: @@ -1530,4 +1538,4 @@ packages: version: "3.1.3" sdks: dart: ">=3.12.0 <4.0.0" - flutter: "3.44.5" + flutter: "3.44.9" diff --git a/pubspec.yaml b/pubspec.yaml index 3bc63b18..a2ec9777 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -23,7 +23,7 @@ environment: sdk: ^3.9.0 # Exact Flutter pin, enforced by `flutter pub get` locally and read by CI via # `flutter-version-file: pubspec.yaml`. Single source of truth: bump here. - flutter: 3.44.5 + flutter: 3.44.9 # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions @@ -34,12 +34,18 @@ environment: dependencies: flutter: sdk: flutter - json_annotation: ^4.6.0 + json_annotation: ^4.12.0 # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.2 web_socket_channel: ^3.0.0 + # Pinned to v9 deliberately. v10.0.0 was shipped in 5.0.0 and reverted in + # 5.0.1 (ba28e09) while chasing the #484 startup freeze on low-end Android + # 14; that commit also made deleteAll() non-blocking, so which change fixed + # it was never established. v10 rewrote the Android ciphers, and v11 drops + # the legacy ones entirely, so a 9 -> 11 jump would also strand existing + # tokens. Move to v10 on its own, with low-end Android testing. flutter_secure_storage: ^9.2.2 intl: ^0.20.1 cached_network_image: ^3.1.0 @@ -50,6 +56,8 @@ dependencies: shared_preferences: ^2.0.8 flutter_svg: ^2.0.5 url_launcher: ^6.0.17 + # Held at v9/v12: the v10/v13 majors are just a win32 6.0.0 bump (Windows + # only), which conflicts with flutter_secure_storage v9's win32 ^5. package_info_plus: ^9.0.0 collection: ^1.16.0 flutter_cache_manager: ^3.3.0 diff --git a/test/apis/base_api_client_test.dart b/test/apis/base_api_client_test.dart index 258d68dd..f0170b7d 100644 --- a/test/apis/base_api_client_test.dart +++ b/test/apis/base_api_client_test.dart @@ -331,6 +331,41 @@ void main() { ), ); }); + + const timeoutCases = { + DioExceptionType.connectionTimeout: 'Connection timeout', + DioExceptionType.sendTimeout: 'Upload timeout', + DioExceptionType.receiveTimeout: 'Server response timeout', + DioExceptionType.transformTimeout: 'Response processing timeout', + }; + + timeoutCases.forEach((type, expectedMessage) { + test('${type.name} throws TimeoutException', () async { + final path = '/${type.name}'; + + dioAdapter.onGet( + 'https://api.test.com$path', + (server) => server.throws( + 0, + DioException( + requestOptions: RequestOptions(path: path), + type: type, + ), + ), + ); + + expect( + () => client.testGet(path), + throwsA( + isA().having( + (e) => e.message, + 'message', + contains(expectedMessage), + ), + ), + ); + }); + }); }); group('successful get()', () {