sohan_flutter_cli 1.0.0
sohan_flutter_cli: ^1.0.0 copied to clipboard
A command-line tool to set up a Flutter project with predefined templates, folders, files, and dependencies.
A sample command-line application #
Flutter CLI Tool for Project Setup #
This CLI tool is designed to simplify the process of integrating a custom Flutter starter template into an existing Flutter project. It automates tasks like replacing specific files, adding necessary dependencies, and syncing them using flutter pub get.
Features #
- Clone Template Repository: Clones a pre-defined starter template from a GitHub repository.
- Replace Files & Folders: Replaces or creates specific files and folders in the user's project with the ones from the template.
- Update
pubspec.yaml: Automatically adds necessary dependencies to the project'spubspec.yamlfile. - Run
flutter pub get: Syncs the new dependencies by runningflutter pub getto ensure that all dependencies are up to date. - Support for
.gitkeepFiles: Automatically creates.gitkeepfiles in empty directories to ensure they are tracked by Git. - Project Customization: Allows you to select which specific files and folders from the template you want to replace or add in your project.
How It Works #
- Cloning the Template: The CLI tool clones the starter template repository from GitHub.
- Replacing Files: Based on the user's selection, the tool replaces or creates specified files and folders in the target Flutter project directory.
- Updating Dependencies: The tool reads the
pubspec.yamlof the user's Flutter project and updates it with necessary dependencies (if they are not already present). - Syncing Dependencies: Once dependencies are updated, the tool runs
flutter pub getto ensure all dependencies are synchronized. - Cleaning Up: After completing the setup, the tool removes the cloned template folder and any temporary files.
Prerequisites #
Before using this tool, make sure you have the following installed:
- Flutter: Ensure that Flutter SDK is installed and available in your system path.
- Dart: The tool is written in Dart, so make sure Dart SDK is installed as well.
Installation #
To install this CLI tool globally, run: dart pub global activate sohan_flutter_cli
Usage #
Once installed, you can run the following command to set up your Flutter project: sohan_flutter_cli setup