A shopping cart built around sqflite, so the basket survives app restarts.
- Persistent cart — every item is written to SQLite, so the basket is restored on relaunch.
- Provider for reactive state, with a live badge count that updates as the cart changes.
- Clean separation of concerns across
Database,Model,ProviderandScreen.
| Concern | Choice |
|---|---|
| UI | Flutter, Material |
| State management | provider |
| Persistence | sqflite, path_provider |
| Utilities | shared_preferences, badges |
lib/
- `Database`
- `Model`
- `Provider`
- `Screen`
- Flutter
>= 3.16(Dart>= 3.2)
git clone https://github.com/developer-rahim/Add_To_Cart-With-Local-Database-.git
cd Add_To_Cart-With-Local-Database-
flutter pub get
flutter runflutter test
flutter analyzeThe cart badge count is driven by Provider, so any screen can react to cart changes without manual refreshes.
Released under the MIT License.