fluttercnfluttercn

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:

  • Node.js (v14 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 npm:

npm install -g fluttercn

Or using yarn:

yarn global add fluttercn

Step 2: Initialize Your Project

Navigate to your Flutter project directory and initialize fluttercn:

cd your-flutter-project
fluttercn init

This 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 list

Or use the short alias:

fluttercn ls

Then add a component to your project:

fluttercn add button

Or add multiple components:

fluttercn add card
fluttercn add button

The 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

Troubleshooting