Flutter Clean Architecture Example by myanes
Sample app with implementation of every layer of my approach to Clean Architecture for Flutter:
- Presentation: Screens/Views + ViewModels
- Domain: Models + UseCases
- Data: DTOs + DB_Entities +Repositories + DataSources
- DI
- MVVM: UI State and Events
- Use cases
- Repository pattern
- Networking: Http + Json decode
- Offline mode: Local database
- Simple custom Router
- Theme: Light & Dark (from system settings)
- Basic Error Handling
- Testing: Widgets + Unit tests
- Dendency Injection with get_it
- State Management with getX & bloc(cubit)
- Tesiting with mockito
- Networking with http
- Local database with hive
Comming soon:
- Translated Strings -> i18n
- More robust error handling
- More complex state management examples with bloc
- Custom App Icon + Splash screen
- Play Screen. Two rouds where you can guess the breed of a random dog by looking at it's picture. Data comes from Dog CEO: https://dog.ceo/dog-api/
- Results Scren. It shows correct answers count and a replay button.
- Results history saved in local database
Both Unit and Widget tests examples are available. For Unit testing dependencies are replaced by mock classes generated by mockito.
- A game is created with 2 rounds
- Loading indicator it's shown and hided
- Move to next round
- Show game results
Some examples:
- PlayViewModel - Unit testing
- GameCreatorUsecase - Unit testing
- GameResultScreen - Widget testing
Feel free to use it ❤️.
A ⭐️ is appreciated
with 🧠 by myanes 😜