Application e-commerce Flutter de démonstration construite avec une architecture en couches et Riverpod.
- Catalogue produits : liste + détail
- Panier : ajout, suppression, modification des quantités
- Favoris persistés localement avec
shared_preferences - Recherche, filtrage par catégorie et tri par prix/nom
- Profil utilisateur mock
- Gestion
loading / error / dataavecAsyncValue - Bonus : animation d'ajout au panier
lib/
├── main.dart
├── core/
│ └── theme/
│ └── app_theme.dart
├── data/
│ ├── models/
│ │ ├── cart_item.dart
│ │ └── product.dart
│ ├── repositories/
│ │ └── product_repository.dart
│ └── services/
│ └── favorites_storage.dart
├── domain/
│ └── user_profile.dart
├── providers/
│ └── app_providers.dart
└── presentation/
├── screens/
│ ├── home_screen.dart
│ ├── product_detail_screen.dart
│ ├── cart_screen.dart
│ ├── favorites_screen.dart
│ └── profile_screen.dart
└── widgets/
├── product_card.dart
└── quantity_stepper.dart
Le projet contient notamment :
productsProvider—FutureProvidercartProvider—StateNotifierProviderfavoritesProvider—StateNotifierProviderfilterProvider—StateNotifierProviderfilteredProductsProvider—ProviderproductByIdProvider—Provider.familyprofileProvider—Provider
Avec Riverpod 3,
StateNotifierProviderest conservé dans l'API legacy. Le projet utilise doncpackage:flutter_riverpod/legacy.dartpour les providers concernés.
flutter pub get
flutter runLe catalogue est chargé depuis assets/products.json, donc aucune API externe n'est nécessaire.