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

melos tests workflow deploy_web workflow deploy_android workflow

Modules

App has multiple features - posts, weather. Each feature is split into 3 layers

  • 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 an Api.
  5. Information flows back to the UI to be displayed.

Presentation and Data depend on Domain, but Domain knows nothing about them.

Dependencies

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

Test coverage

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)

Build project

  • install flutter
  • dart pub global activate melos
  • dart run melos bootstrap
  • cd apps/app_main
  • flutter run

Contributing

  • CONTRIBUTING.md contains information about frameworks and libraries in app

TODO