arch-atlas

Seller Services Controller

services/services_provider.dart · StateNotifier.autoDispose

domain

Overview

AutoDispose StateNotifier loading the seller's provisions from /vendor/provisions and mapping them down into the lightweight SellerService rows. Owns the deleteService action.

User Flow

  1. Ctor → fetch() → VendorService.getProvisions → map Product → SellerService.
  2. AsyncValue<List<SellerService>> tracks loading/data/error.
  3. deleteService removes the row optimistically (rebuilds list) after VendorService.deleteProvision succeeds.

Cases & Edge Cases

  • delete failure surfaces a typed message extracted from data['message'] when possible.
  • AutoDispose means leaving and returning to the screen always refetches — intentional, since seller edits can change items elsewhere.
  • Status filter (proposed/published/rejected) is done on the UI side; backend returns all statuses.

Code References

  • lib/src/features/seller/services/services_provider.dart:7 // sellerServicesProvider
  • lib/src/features/seller/services/services_provider.dart:13 // SellerServicesController

API Calls

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

Notes

Uses the legacy StateNotifier API even though the codebase is mostly Notifier — migrate when convenient.