Feature/parking lot information#1824
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new “Parking Lots” feature to the app’s home/faculty views by introducing a parking occupation fetcher + Riverpod provider, new UI card components, and localized strings.
Changes:
- Introduce parking lot occupation domain model, fetcher, and Riverpod provider.
- Add parking lot home card UI (including loading shimmer) and a uni_ui card to render lot rows + occupancy bars.
- Wire the new parking card into favorites/home/faculty screens and add i18n strings/icons.
Reviewed changes
Copilot reviewed 14 out of 19 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/uni_ui/lib/icons.dart | Adds a parking icon mapping for UI usage. |
| packages/uni_ui/lib/cards/parking_lot_card.dart | New UI card for rendering parking lot rows + occupancy indicator. |
| packages/uni_app/lib/view/home/widgets/parking/parking_home_card.dart | New home card that consumes parking provider and renders ParkingLotCard. |
| packages/uni_app/lib/view/home/widgets/parking/parking_card_shimmer.dart | Loading shimmer placeholder for the parking card. |
| packages/uni_app/lib/view/home/widgets/edit/draggable_utils.dart | Adds parking label/icon support in the “edit home” draggable UI. |
| packages/uni_app/lib/view/home/home.dart | Wires parking provider/card into home favorites + refresh behavior. |
| packages/uni_app/lib/view/faculty/faculty.dart | Adds parking card to Faculty page and refreshes parking data on pull-to-refresh. |
| packages/uni_app/lib/utils/favorite_widget_type.dart | Adds parking to the favorites enum. |
| packages/uni_app/lib/model/providers/riverpod/parking_lot_provider.dart | New CachedAsyncNotifier-backed provider for parking occupation. |
| packages/uni_app/lib/model/entities/parking_lot_occupation.dart | New entities/enums representing parking lots and occupation. |
| packages/uni_app/lib/controller/fetchers/parking_lot_fetcher.dart | New network fetcher/parser for parking lot occupation endpoint. |
| packages/uni_app/lib/l10n/intl_pt_PT.arb | Adds Portuguese translations for parking UI strings. |
| packages/uni_app/lib/l10n/intl_en.arb | Adds English translations for parking UI strings. |
| packages/uni_app/lib/generated/l10n.dart | Generated localization accessor updates for parking strings. |
| packages/uni_app/lib/generated/intl/messages_pt_PT.dart | Generated pt_PT messages updates for parking strings. |
| packages/uni_app/lib/generated/intl/messages_en.dart | Generated en messages updates for parking strings. |
| flake.nix | Updates Flutter package selection in the Nix dev environment. |
| flake.lock | Updates pinned nixpkgs revision/hash. |
| .gitignore | Ignores .direnv and fixes/normalizes custom lint log ignore line. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @override | ||
| Widget build(BuildContext context) { | ||
| final occupied = capacity - free; | ||
| final ratio = capacity > 0 ? (occupied / capacity).clamp(0.0, 1.0) : 0.0; |
| @override | ||
| Widget build(BuildContext context) { | ||
| return GenericCard( | ||
| key: key, |
| Duration? get cacheDuration => const Duration(minutes: 15); | ||
|
|
||
| @override | ||
| Future<ParkingLotOccupation?> loadFromStorage() async { | ||
| return null; | ||
| } |
| Future<ParkingLotOccupation> getParkingLotOccupation(Session session) async { | ||
| final url = '${NetworkRouter.getBaseUrl('feup')}$_endpoint'; | ||
|
|
||
| final response = await NetworkRouter.getWithCookies(url, {}, session); |
| } | ||
|
|
||
| @override | ||
| void onCardClick(BuildContext context) => {}; |
| final parkingLotProvider = | ||
| AsyncNotifierProvider<ParkingLotNotifier, ParkingLotOccupation?>( | ||
| ParkingLotNotifier.new, | ||
| ); | ||
|
|
||
| final class ParkingLotNotifier | ||
| extends CachedAsyncNotifier<ParkingLotOccupation?> { |
Codecov Report❌ Patch coverage is ❌ Your project check has failed because the head coverage (7%) is below the target coverage (70%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## develop #1824 +/- ##
=======================================
- Coverage 7% 7% -0%
=======================================
Files 38 38
Lines 1842 1875 +33
=======================================
Hits 125 125
- Misses 1717 1750 +33 🚀 New features to boost your workflow:
|
|
i added the necessary changes for this to run on CarPlay. i could only test this with an emulator for now, because trying to run locally grants me this error:
anyway, this is what it looked like on the emulator:
|

Closes #1823