Installation
Get started with fluttercn in your Flutter project
Installation
Get fluttercn up and running in your Flutter project in just a few steps.
Prerequisites
Before you begin, make sure you have:
- Dart SDK (3.0.0 or higher) - for the CLI tool
- Flutter SDK - installed and configured on your machine
- A Flutter project - or create a new one
Step 1: Install the CLI
Install fluttercn CLI globally using Dart's pub:
dart pub global activate fluttercnImportant: Make sure ~/.pub-cache/bin is in your PATH. Add it by running:
export PATH="$PATH":"$HOME/.pub-cache/bin"To make this permanent, add the above line to your shell profile (~/.zshrc, ~/.bashrc, etc.).
Verify Installation
Check if the CLI is installed correctly:
fluttercn --versionYou should see the version number (e.g., 0.0.5).
Step 2: Initialize Your Project
Navigate to your Flutter project directory and initialize fluttercn:
cd your-flutter-project
fluttercn initThis command will:
- Validate that you're in a Flutter project
- Create the theme configuration file at
lib/config/theme.dart - Set up the necessary structure for components
Note: You only need to run this once per project. If fluttercn is already initialized, you'll see a warning message.
Step 3: Add Your First Component
Now you're ready to add components! First, let's see what's available:
fluttercn listOr use the short alias:
fluttercn lsThen add a component to your project:
fluttercn add buttonOr add multiple components:
fluttercn add card
fluttercn add buttonThe components will be copied to lib/widgets/common/ in your project, and you can start using them right away!
What's Next?
- Browse all available components
- Learn about theming your components
- Check out component examples and usage patterns