Production-oriented Point of Sale application built with Flutter, Clean Architecture, and the BLoC pattern.
This project is focused on a scalable POS core with clear architecture boundaries:
- Domain-first business logic
- Reactive state management with flutter_bloc
- Dependency injection with get_it
- Value equality with equatable
- Local persistence for products and sales via Drift
- Admin console for product management and sales review
Current implemented flow:
- Product catalog loading from a mock remote data source
- Product search in the catalog
- Reactive shopping cart updates
- 10% tax total calculation
- Checkout actions for cash and card
- Admin product add/delete flow with local persistence and refresh
- Flutter (Material 3)
- flutter_bloc
- equatable
- get_it
The POS feature follows this module structure:
lib/features/pos/
- data/
- datasources/
- product_remote_data_source.dart
- product_local_data_source.dart
- sales_local_data_source.dart
- pos_local_database.dart
- models/
- product_model.dart
- repositories/
- product_repository_impl.dart
- sales_repository_impl.dart
- datasources/
- domain/
- entities/
- product.dart
- cart_entity.dart
- transaction_record.dart
- repositories/
- product_repository.dart
- sales_repository.dart
- usecases/
- calculate_total.dart
- save_transaction.dart
- entities/
- presentation/
- bloc/
- cart/
- cart_event.dart
- cart_state.dart
- cart_bloc.dart
- product_catalog/
- product_catalog_event.dart
- product_catalog_state.dart
- product_catalog_bloc.dart
- cart/
- di/
- service_locator.dart
- views/
- pos_view.dart
- admin_home_view.dart
- bloc/
Entrypoint:
- lib/main.dart
- ProductModel extends the Product entity
- MockProductRemoteDataSource simulates remote product fetch
- ProductRepositoryImpl maps datasource results to domain contracts
- Drift-backed local data sources persist products and sales records
- Entities: Product, CartItemEntity, CartEntity
- Use cases: CalculateTotal, SaveTransaction
- Standard tax rate: 10%
- Totals exposed as subtotal, tax, total
- CartBloc events:
- AddItem
- RemoveItem
- ClearCart
- ProductCatalogBloc:
- Loads products
- Filters by search query
- POSView:
- Responsive two-panel layout
- Left: product grid and search
- Right: cart list, totals, checkout actions
- AdminHomeView:
- Product management tab for add/delete
- Sales tab for transaction history
Prerequisites:
- Flutter SDK installed and available in PATH
Install dependencies:
flutter pub get
Run app:
flutter run
Analyze code:
flutter analyze
Run tests:
flutter test
Current validation status:
flutter analyzepassesflutter testpasses
Development progress, next features, and bug backlog are tracked in:
- PROJECT_TRACKER.md
- Add unit tests for domain use cases and repository logic
- Add CartBloc transition tests
- Add stronger checkout flow validation and receipt generation
- Introduce persistent local storage for cart and order history
Internal project. Add a license section when publishing externally.