arch-atlas

Marketplace Provider Wiring

marketplaceServiceProvider + marketplaceControllerProvider

di

Overview

marketplaceServiceProvider provides a singleton MarketplaceService; marketplaceControllerProvider provides the Notifier. ProductListState is the consumed value.

User Flow

  1. Controller.build() does ref.watch(marketplaceServiceProvider) — if you override the service provider in tests, the controller picks it up.
  2. No autoDispose — state survives screen pops so the user returns to their scroll position + filters.

Cases & Edge Cases

  • Switching to autoDispose would lose pagination on a back-and-forth — current behavior is intentional.
  • Service is reconstructed on every provider rebuild because the constructor is a plain `MarketplaceService()` — harmless since Dio is a singleton.

Code References

  • lib/src/features/shared/marketplace/controllers/marketplace_controller.dart:8 // marketplaceServiceProvider
  • lib/src/features/shared/marketplace/controllers/marketplace_controller.dart:427 // marketplaceControllerProvider

API Calls

Empty — fill this in later. Open the manifest and add content here.

Notes

Tests that swap the service must do so via ProviderScope override; instantiating MarketplaceController directly bypasses Riverpod and is brittle.