Installing Morphr
Before you can start using Morphr, you need to install both the CLI tool and the Flutter library. This guide walks you through the installation process.
Prerequisites
- Flutter SDK
- A Figma account
Installing the Morphr CLI
The Morphr CLI is a command-line tool that helps you manage your Figma-to-Flutter workflow. You can install it globally using pub.dev
:
dart pub global activate morphr
After installation, verify that the CLI is working correctly:
morphr --help
You should see the version number of the Morphr CLI tool.
Troubleshooting PATH Issues
If you see a "command not found" error, you may need to add the Dart pub cache bin directory to your PATH:
For macOS/Linux:
Add the following line to your ~/.bashrc
, ~/.zshrc
, or equivalent:
export PATH="$PATH":"$HOME/.pub-cache/bin"
Then restart your terminal or run source ~/.bashrc
(or equivalent) to apply the changes.
For Windows:
Add %USERPROFILE%\AppData\Local\Pub\Cache\bin
to your PATH environment variable.
Installing the Morphr Flutter Library
To add Morphr to your Flutter project, edit your pubspec.yaml
file and add the dependency:
dependencies:
morphr: <latest-version>
Then run:
flutter pub get
Using Git Repository (Alternative)
If you prefer to use the latest development version, you can install directly from the Git repository:
dependencies:
morphr:
git: https://github.com/intales/morphr
Verifying Installation
To verify that both the CLI and library are correctly installed:
- Check the CLI:
morphr --help
You should see a list of available commands.
- Check the library in your Flutter project:
import 'package:morphr/morphr.dart';
// If this imports without errors, the library is correctly installed