Skip to content

This repository contains a Python script to generate a Flutter Clean Architecture folder structure automatically. It creates essential directories and files, following best practices for separation of concerns. Good for Flutter developers who want a structured and scalable project setup.

Notifications You must be signed in to change notification settings

Sardor6628/flutter_clean_architecture

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Flutter Clean Architecture Folder Structure

This script creates a Clean Architecture folder structure for a Flutter project. It sets up directories and necessary placeholder files to maintain separation of concerns and improve maintainability.

Folder Structure

lib/
│── core/
│   ├── error/
│   ├── usecases/
│   ├── utils/
│   ├── network/
│   ├── database/
│   ├── theme/
│   ├── di/
│
│── features/
│   ├── feature_name/
│   │   ├── domain/
│   │   │   ├── entities/
│   │   │   ├── repositories/
│   │   │   ├── usecases/
│   │   │
│   │   ├── data/
│   │   │   ├── models/
│   │   │   ├── datasources/
│   │   │   ├── repositories/
│   │   │
│   │   ├── presentation/
│   │   │   ├── pages/
│   │   │   ├── widgets/
│   │   │   ├── cubit/  # or bloc/
│   │   │   ├── controllers/
│
│── routes/
│── l10n/
│── config/
│── env/
│── main.dart
│── app.dart

Explanation

  • core/: Contains shared functionality like error handling, theme setup, network clients, database configurations, and dependency injection.
  • features/: Each feature has a separate folder with its domain, data, and presentation layers.
    • domain/: Defines business rules and repository interfaces.
    • data/: Implements repositories, data models, and sources (remote/local).
    • presentation/: Contains UI-related components (pages, widgets, state management).
  • routes/: Defines application navigation.
  • l10n/: Handles localization.
  • config/: Stores global configuration settings.
  • env/: Environment variables for different build stages.
  • main.dart: Entry point of the application.
  • app.dart: Handles app initialization and routing.

Usage

Run the Python script and specify the base directory to generate this structure automatically.

About

This repository contains a Python script to generate a Flutter Clean Architecture folder structure automatically. It creates essential directories and files, following best practices for separation of concerns. Good for Flutter developers who want a structured and scalable project setup.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages