Skip to content

0x384c0/Experiments-flutter

Repository files navigation

Clean Architecture Modular Flutter App

A sample flutter app that has multiple features.
Inspired by Clean Architecture from Uncle Bob

tests workflow deploy_web workflow

Environment

[✓] Flutter (Channel stable, 3.24.5, on macOS 15.1 24B83 darwin-arm64, locale en-KG)
    • Flutter version 3.24.5 on channel stable at /Users/user/fvm/versions/3.24.5
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision dec2ee5c1f (6 days ago), 2024-11-13 11:13:06 -0800
    • Engine revision a18df97ca5
    • Dart version 3.5.4
    • DevTools version 2.37.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/user/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /Users/user/Library/Android/sdk
    • Java binary at: /opt/homebrew/opt/openjdk@17/bin/java
    • Java version OpenJDK Runtime Environment Homebrew (build 17.0.13+0)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16B40
    • CocoaPods version 1.15.2

[✓] Android Studio (version 2024.2)

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

TODO