Skip to content

tranvu1805/flutter_shell_script

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Flutter Clean Architecture (TDD) Boilerplate

A ready-to-use project structure for scalable and testable Flutter apps using Clean Architecture principles and Test-Driven Development (TDD).

πŸ“¦ What’s Included

  • Architecture: Clean Architecture (Domain, Data, Presentation)
  • State Management: BLoC
  • Dependency Injection: get_it
  • Networking: Dio
  • Code Generation: Freezed, JsonSerializable
  • Testing: Unit, Bloc, and Widget Tests

πŸ—‚οΈ Folder Structure

lib/
β”œβ”€β”€ core/
β”‚   β”œβ”€β”€ di/
β”‚   β”œβ”€β”€ error/
β”‚   └── usecases/
β”œβ”€β”€ features/
β”‚   └── auth/
β”‚       β”œβ”€β”€ data/
β”‚       β”œβ”€β”€ domain/
β”‚       └── presentation/
└── main.dart
.
test/
└── features/
.   └── auth/
.       β”œβ”€β”€ data/
.       β”œβ”€β”€ domain/
.       └── presentation/
    

πŸ§ͺ Test Coverage Summary

  • Model Layer: UserModel JSON serialization/deserialization, equality, and factory tests
  • Repository Layer: AuthRepositoryImpl unit tests for both success and failure cases
  • Use Cases: Login use case tested for correct interaction with repository and error handling
  • BLoC: Comprehensive tests for all AuthBloc states:
    • Initial, Loading, Success, Failure transitions
    • Mocked use case integration
  • UI Tests: LoginPage widget tests:
    • Input validations
    • Form submission dispatch
    • Success and failure snackbar behaviors

βš™οΈ Setup Instructions

  1. Make the script executable:
    chmod +x script.sh
  2. Create your app:
    ./script.sh <your_app_name>
  3. Run tests when prompted or manually:
    flutter test
Note: This boilerplate is designed for long-term scalability, maintainability, and high test coverage from day one.
Platform Note: This script runs best on macOS/Linux. Use Git Bash or WSL on Windows. # βš™οΈ Flutter Clean Architecture Project Generator (Windows version)

πŸš€ Setup Instructions (for Windows)

Option 1: Run via Git Bash (Recommended)

  1. Install Git for Windows
  2. Open Git Bash in the folder containing script.sh
  3. Run:
    bash script.sh <your_app_name>
    
Created with ❀️ for scalable Flutter development.

About

A Package for create a flutter clean architecture project.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 30.4%
  • C++ 23.8%
  • Dart 22.0%
  • CMake 19.4%
  • Swift 1.7%
  • C 1.4%
  • Other 1.3%