Create Product Form State
products/providers/create_product_provider.dart · ProductOptionEntry + ProductVariantEntry + CreateProductState
Overview
The dynamic options/variants matrix that powers the create wizard. ProductOptionEntry holds title + values (e.g. Size → S,M,L). ProductVariantEntry holds the cross-product (S/Rouge, S/Bleu, …) with per-variant price/sku/stock.
User Flow
- User adds an Option row → ProductOptionEntry.values builds incrementally.
- Each new option or value rebuilds the variant matrix (cross-product of all option values).
- Per-variant fields (price, sku, stockQuantity) are filled inline in step 2.
- isValid getter on ProductOptionEntry gates the Continue button.
Cases & Edge Cases
- Adding a third option doubles+triples the variant count quickly — UI throttles input + scrolls horizontally.
- Variant title is composed as 'value1 / value2 / value3' — separator is hard-coded ' / '.
- Empty values silently drop out of the matrix; an option with 0 valid values forces an isValid=false.
Code References
- lib/src/features/seller/products/providers/create_product_provider.dart:17 // ProductOptionEntry
- lib/src/features/seller/products/providers/create_product_provider.dart:42 // ProductVariantEntry
- lib/src/features/seller/products/providers/create_product_provider.dart:74 // CreateProductState
API Calls
Empty — fill this in later. Open the manifest and add content here.
Notes
Mirrors the provision-side wizard but kept separate — physical products may have inventory tracking, provisions do not.