0x384c0 / Experiments-flutter

Example of flutter app with clean architecture

Home Page:https://0x384c0.github.io/Experiments-flutter/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Modular Flutter App

A sample flutter app that has mutliple features.

tests workflow

Build Requirements

Modules

App has multiple features - posts, weather. Each feature split in to 3 modules

  • Presentation - contains Presentation Layer (widgets and cubits)
  • Domain - contains Domain layer with business logic (interactors and interfaces)
  • Data - contains Data layer with REST API requests

Layers Scheme

layers

Communication between layers

  1. UI sends signals to Cubit
  2. Cubit executes Use cases from Interactor.
  3. Use case obtains data from Repository
  4. Repository returns data from a Api.
  5. Information flows back to the UI to be displayed.

Presentation and Data depends on Domain, but Domain know nothing about them.

Dependencies

  1. rxdart
  2. flutter_modular
  3. flutter_cubit
  4. retrofit
  5. json_annotation
  6. mocktail

Test coverage

.run scripts

Adding New module

  • run flutter create in feature directory with unique project name. For example: flutter create --template=package --project-name features_weather_presentation presentation
  • remove unused files. For example: cd presentation && rm -rf android ios linux macos windows LICENSE CHANGELOG.md
  • replace homepage: with publish_to: none in podspec.yaml
  • add dependencies from other modules
  • add this module as dependency to other modules using path:

TODO

About

Example of flutter app with clean architecture

https://0x384c0.github.io/Experiments-flutter/

License:MIT License


Languages

Language:Dart 89.9%Language:Shell 3.3%Language:Python 3.0%Language:Ruby 1.8%Language:Swift 0.9%Language:HTML 0.7%Language:GLSL 0.2%Language:Gherkin 0.2%Language:Kotlin 0.1%Language:Objective-C 0.0%