flutter_project_template
A CLI tool that bootstraps a new Flutter project with a clean architecture, pre-configured dependencies, and a ready-to-use folder structure.
What It Does
Running dart run flutter_project_template in a Flutter project will:
- Install dependencies —
http,flutter_bloc,shared_preferences,go_router,http_parser,easy_localization,equatable - Create the folder structure under
lib/:
lib/
├── config/
│ ├── theme_config/
│ └── locale_config/
├── models/
├── modules/
│ ├── splash/screen/
│ ├── home/
│ │ ├── bloc/
│ │ ├── cubit/
│ │ ├── screen/
│ │ └── widget/
│ ├── main/screen/
│ ├── profile/screen/
│ └── search/screen/
├── repository/
├── services/
├── utils/
└── widgets/
languages/
- Generate boilerplate files — theme management, routing, API services, shared preferences, localization, and more (defined in
lib/file_with_content.dart) - Write
lib/main.dart— withEasyLocalization,ThemeCubit(viaBlocProvider),go_routerconfig, and text-scale clamping - Update
pubspec.yaml— adds alanguages/asset entry
Features
- Automated dependency installation
- Clean, scalable folder structure ready from the start
- Pre-configured
main.dartwith theme, localization, and routing - Internationalization support via
easy_localization(en, my) - Theme switching with
ThemeCubit(light / dark) - Text-scale clamping (0.8–1.1) for consistent UI
- Utility extensions and context extensions included
Getting Started
-
Create a new Flutter project (or use an existing one):
flutter create my_app cd my_app -
Add this package:
flutter pub add flutter_project_template -
Run the bootstrap script:
dart run flutter_project_template -
Customize the generated files to suit your needs and add your business logic.