Fix 3 critical bugs: parallel API fetching, dart:io web breakage, festival URL sync - #209
Conversation
…tival URL sync - Parallelize beverage type fetching with Future.wait for ~7x faster load times - Remove dart:io import and SocketException handler that breaks web builds - Update URL via GoRouter when switching festivals in the selector https://claude.ai/code/session_01Vzxb1yS3rRonMVEXEdivwx
…dling - Use GoRouter.maybeOf instead of try/catch for null-safe router lookup - Capture router reference before Navigator.pop to avoid stale context - Replace SocketException with http.ClientException for cross-platform network error detection (works on web, Android, and iOS) - Restore specific "No internet connection" error message for users https://claude.ai/code/session_01Vzxb1yS3rRonMVEXEdivwx
LCOV of commit
|
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Pull request overview
Improves app startup/perceived performance and web compatibility by parallelizing festival beverage fetching, removing dart:io-based network exception handling that breaks web builds, and syncing the selected festival with the GoRouter URL when changed via the selector.
Changes:
- Fetch all beverage types concurrently via
Future.waitinBeerApiService.fetchAllDrinks. - Replace
SocketExceptionhandling withhttp.ClientExceptionin provider error handling and tests (avoidsdart:ioon web). - Navigate via GoRouter when selecting a festival from the festival selector sheet.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
lib/services/beer_api_service.dart |
Parallelizes multi-beverage fetching to reduce overall load time. |
lib/providers/beer_provider.dart |
Updates network error mapping to web-safe http.ClientException. |
lib/widgets/festival_menu_sheets.dart |
Adds GoRouter navigation to keep URL in sync when switching festivals. |
test/provider_test.dart |
Updates tests to throw/assert http.ClientException instead of SocketException. |
test/utf8_encoding_test.mocks.dart |
Adds generated Mockito mocks for UTF-8 encoding tests. |
🚀 Cloudflare Pages PreviewYour preview deployment is ready! Preview URL: https://claude-prioritize-impact-imp.staging-cambeerfestival.pages.dev This preview will be automatically updated when you push new commits to this PR. |
|
@richardthe3rd I've opened a new pull request, #211, to work on those changes. Once the pull request is ready, I'll request review from you. |
Co-authored-by: richardthe3rd <573334+richardthe3rd@users.noreply.github.com>
… check Co-authored-by: richardthe3rd <573334+richardthe3rd@users.noreply.github.com>
Co-authored-by: richardthe3rd <573334+richardthe3rd@users.noreply.github.com>
Co-authored-by: richardthe3rd <573334+richardthe3rd@users.noreply.github.com>
Co-authored-by: richardthe3rd <573334+richardthe3rd@users.noreply.github.com>
Co-authored-by: richardthe3rd <573334+richardthe3rd@users.noreply.github.com>
Use routing helpers in festival selector and preserve current tab
🚀 Cloudflare Pages PreviewYour preview deployment is ready! Preview URL: https://claude-prioritize-impact-imp.staging-cambeerfestival.pages.dev This preview will be automatically updated when you push new commits to this PR. |
https://claude.ai/code/session_01Vzxb1yS3rRonMVEXEdivwx