Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@ app.*.map.json
*.freezed.dart
*.g.dart
.env

# AI assistants
.claude
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"java.configuration.updateBuildConfiguration": "interactive"
}
101 changes: 63 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 👨‍💻 Flutter Boilerplate
[![Generic badge](https://img.shields.io/badge/Flutter-v3.16.1-blue)](https://flutter.dev/docs)
[![Generic badge](https://img.shields.io/badge/Dart-v3.2.1-blue)](https://dart.dev/guides)

[![Generic badge](https://img.shields.io/badge/Flutter-v3.41.3-blue)](https://flutter.dev/docs)[![Generic badge](https://img.shields.io/badge/Dart-v3.11.1-blue)](https://dart.dev/guides)

Flutter Template

Expand All @@ -11,55 +11,84 @@ Flutter Template
Add .env file to the project directory (see .env.example)

Example how to run development app

```
flutter clean
flutter pub get
flutter pub run build_runner build --delete-conflicting-outputs
dart run build_runner build --delete-conflicting-outputs
flutter run
```

Example how to run production app

```
flutter clean
flutter pub get
flutter pub run build_runner build --delete-conflicting-outputs
dart run build_runner build --delete-conflicting-outputs
flutter build apk -t lib/main_production.dart
```

### ⚙️ Supported Flavor

1. staging
2. production
1. staging
2. production

### 🎯 Architecture & Pattern

Reso coder's flutter clean architecture

![alt text](https://i0.wp.com/resocoder.com/wp-content/uploads/2019/08/Clean-Architecture-Flutter-Diagram.png?ssl=1)

### ⚡️ Module generator
### 🧬️ State Management

Since we use clean architecture, it doesn't matter what state management you prefer to use

But for this project example, we use [Bloc](https://pub.dev/packages/flutter_bloc)

In order to minimize your effort in repetitive code writing, you can use the module_generator.dart
### 🧩 Software Product Line (SPL)

simply run
This template includes an SPL layer for managing variability — swappable storage backends and state management solutions, plus a CLI to add/remove/toggle features.

See [SPL.md](SPL.md) for the full guide.

```
dart run .\codegen\module_generator.dart
dart run codegen/spl_manager.dart list
dart run codegen/spl_manager.dart add <feature>
dart run codegen/spl_manager.dart disable <feature>
dart run codegen/spl_manager.dart enable <feature>
dart run codegen/spl_manager.dart storage set hive
dart run codegen/spl_manager.dart state set cubit
```

and insert your module name (example: catalog)
### 🧱 Mason (Code Generation)

### 🧬️ State Management
This project uses [Mason](https://pub.dev/packages/mason_cli) for brick-based code generation. Bricks are stored in `bricks/` as real `.dart` files with Mustache variables.

Install Mason globally (one-time):

```
dart pub global activate mason_cli
```

Initialize bricks for this project (one-time, after `flutter pub get`):

Since we use clean architecture, it doesn't matter what state management you prefer to use
```
mason get
```

But for this project example, we use [Bloc](https://pub.dev/packages/flutter_bloc)
The SPL CLI (`spl_manager.dart`) uses Mason automatically when available. You can also invoke bricks directly:

```
mason make feature --name <name>mason make feature --name <name> --with_storage true --state cubit
```

Bricks are excluded from Dart analysis (`analysis_options.yaml`) because they contain Mustache syntax (`{{name.pascalCase()}}`), not valid Dart.

### API Documentation

[DummyJson](https://dummyjson.com/docs/)

This boilerplate use DummyJson for remote data sources
This boilerplate use DummyJson for remote data sources

See [Auth](https://dummyjson.com/docs/auth) to obtain username and password to login in this app

Expand All @@ -69,45 +98,41 @@ snake_case for file and folder.

### :capital_abcd: Git flow

Commit rules:
(feat|fix|docs|style|refactor|perf|test|build|ci):\/*

feat: A new feature
Commit rules:(feat|fix|docs|style|refactor|perf|test|build|ci):/\*

fix: A bug fix
feat: A new feature

docs: Documentation only changes
fix: A bug fix

style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
docs: Documentation only changes

refactor: A code change that neither fixes a bug nor adds a feature
style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)

perf: A code change that improves performance
refactor: A code change that neither fixes a bug nor adds a feature

test: Adding missing tests
perf: A code change that improves performance

build: Changes to the build/compilation/packaging process or auxiliary tools such as documentation generation
test: Adding missing tests

ci: Changes in the continuous integration/delivery setup
build: Changes to the build/compilation/packaging process or auxiliary tools such as documentation generation

ci: Changes in the continuous integration/delivery setup

#### examples:
#### examples:

feat(auth): Form Login
feat(auth): Form Login

feat(product): implement product screen

ci: refactor analysis job
feat(product): implement product screen

ci: refactor analysis job

#### before push
1. flutter analyze
2. flutter test

branch rules:
(feature|hotfix|coldfix|service|integration|ui)\/\/*
1. flutter analyze
2. flutter test

branch rules:(feature|hotfix|coldfix|service|integration|ui)//\*

### How to contribute

To help work on this project, please refer to [CONTRIBUTING.md](CONTRIBUTING.md)
To help work on this project, please refer to [CONTRIBUTING.md](CONTRIBUTING.md)
Loading