myanes-dev / flutter-clean-architecture-mvvm-example

mvvm | usecases | repository | Sample app with implementation of every layer of Clean Architecture for Flutter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DOGS GAMES

Alt text

Flutter Clean Architecture Example by myanes

Sample app with implementation of every layer of my approach to Clean Architecture for Flutter:

Alt text

Presentation <-> Domain <-> Data

  • Presentation: Screens/Views + ViewModels
  • Domain: Models + UseCases
  • Data: DTOs + DB_Entities +Repositories + DataSources

Tech Specifications

  • 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

Libraries πŸ“¦

Comming soon:

  • Translated Strings -> i18n
  • More robust error handling
  • More complex state management examples with bloc
  • Custom App Icon + Splash screen

App Features πŸ“‹

  • 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

Testing βš™οΈ

Both Unit and Widget tests examples are available. For Unit testing dependencies are replaced by mock classes generated by mockito.

Verifications:

  • 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

License πŸ“„

Feel free to use it ❀️.

A ⭐️ is appreciated


with 🧠 by myanes 😜

About

mvvm | usecases | repository | Sample app with implementation of every layer of Clean Architecture for Flutter


Languages

Language:Dart 56.6%Language:C++ 19.3%Language:CMake 17.3%Language:Ruby 2.5%Language:HTML 1.7%Language:C 1.3%Language:Swift 1.2%Language:Kotlin 0.1%Language:Objective-C 0.0%