Skip to content

Upgrade versions, implement software product lines variation for features, storage service, and state management#3

Open
MHibriziF wants to merge 10 commits into
ristekoss:mainfrom
MHibriziF:main
Open

Upgrade versions, implement software product lines variation for features, storage service, and state management#3
MHibriziF wants to merge 10 commits into
ristekoss:mainfrom
MHibriziF:main

Conversation

@MHibriziF
Copy link
Copy Markdown

Flutter Clean Architecture with SPLE implementation

Summary

This PR builds on top of https://github.com/ristekoss/flutter-clean-architecture, the original organization boilerplate. It incorporates work from an unmerged upstream PR (#2)

Changes are layered in three stages:

Stage 1 — Inherited from upstream unmerged PR (#2 via https://github.com/yudha-haris/flutter-clean-architecture/tree/main)

  • Gradle upgraded to 8.3 with full Android build config modernization
  • Dependencies updated to support Flutter 3.27
  • Migrated DI from manual get_it registration modules to injectable + build_runner annotation-based auto-wiring
  • Bloc structure refactored to follow official flutter_bloc documentation patterns
  • Removed per-feature di/ module files (product_module.dart, profile_module.dart, etc.) — replaced by @Injectable/@LazySingleton annotations

Stage 2 — Version upgrade

  • Flutter upgraded to 3.41.3 / Dart 3.11.1
  • Dependencies bumped accordingly

Stage 3 — Software Product Line (SPL) layer

  • Added spl.yaml as single source of truth for product configuration
  • Storage variability (XOR) — AppStorage abstract interface with swappable backends: flutter_secure_storage, hive, sqflite, shared_preferences. Only the active provider's impl file is generated; switching via
    CLI deletes the old and generates the new
  • State management variability (OR) — global default + per-feature override supporting bloc, cubit, and riverpod. Features can mix solutions freely
  • SecureStorage service removed — redundant wrapper; SecureDatabase now uses FlutterSecureStorage const directly. Auth tokens always go to the OS keychain (not a variability point)
  • Feature lifecycle management — add, disable (moves to features_catalog/, preserves code), enable (restores from catalog), remove (hard delete)
  • codegen/spl_manager.dart — CLI tool driving all of the above, with Mason integration (falls back to inline templates if Mason is unavailable)
  • Mason bricks in bricks/ — real .dart files with Mustache variables for feature and storage scaffolding
  • Freezed v3 fixes — added missing abstract keyword to 6 response classes
  • module_generator.dart removed — fully superseded by spl_manager
  • SPL.md added — full documentation for the SPL layer

Test plan

  • flutter analyze — 0 errors
  • dart run codegen/spl_manager.dart list — shows active features and SPL config
  • dart run codegen/spl_manager.dart add <name> — scaffolds clean arch feature, DI auto-wired
  • dart run codegen/spl_manager.dart disable <name> / enable <name> — feature moves to/from features_catalog/
  • dart run codegen/spl_manager.dart storage set hive — switches storage backend, regenerates impl
  • App runs and template features (authentication, onboarding, product, profile) work end-to-end

@MHibriziF MHibriziF marked this pull request as draft March 15, 2026 16:31
@MHibriziF MHibriziF marked this pull request as ready for review March 15, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants