Flutter Product Variant Logic Integration

Замовник: AI | Опубліковано: 21.09.2025

I need a clean, maintainable implementation of product variants inside my existing Android-targeted Flutter app. The catalogue currently exposes only one variant type—Size—but that choice must automatically trigger a dependent value we track as Weight. In practice, when a shopper picks a size, the app should look up and display the correct weight and pass it through to the basket, price calculation, stock check, and checkout API calls. I will hand you: • the present Flutter project (stable channel, null-safety enabled) • a simple REST endpoint that returns each product’s sizes together with the matching weight What I expect back: • Dart models and provider/service code that map the size → weight relationship • a responsive selector widget that greys out unavailable sizes and instantly refreshes the dependent weight display • integration with my existing cart bloc so the chosen size and weight flow through to every subsequent screen • concise setup notes so I can merge and test locally No UI redesign is needed—just slot your selector in place of the current placeholder. Clean code, clear naming, and null-safety throughout are mandatory.