Create + Edit Product Screens
products/views/create_product_screen.dart · edit_product_screen.dart
Overview
Two-step wizards. Create: 975-line composite of basic info → options matrix → variant pricing → image upload. Edit: same form prefilled, plus an inventory-quantity per variant input.
User Flow
- Create: pickCategory → setTitle/desc → addOption × N → fill variant prices → upload images → submit.
- Edit: load existing product → modify any field → submit triggers updatePhysicalProduct + setInventoryItemQuantity for changed variants.
- Image picker uses image_picker; uploaded URLs are appended to product.images.
Cases & Edge Cases
- Editing options after variants exist is risky — the matrix re-builds, but server may refuse if existing variant.value strings no longer fit.
- Currency change is allowed in edit but rare — UI shows a warning.
- Long-press on a variant offers a 'duplicate' helper to copy price into adjacent variants.
Code References
- lib/src/features/seller/products/views/create_product_screen.dart
- lib/src/features/seller/products/views/edit_product_screen.dart
API Calls
Empty — fill this in later. Open the manifest and add content here.
Notes
Create screen is 975 lines — a good candidate for splitting into step-widgets but not blocking shipping.