figma2flutter
0.3.1-alpha, released 2 years ago by appnormal.com
Converts Tokens Studio for Figma JSON exports into Flutter code and themes.
What it does
Parses design tokens from a JSON file or folder exported from Figma (Tokens Studio) and generates Flutter code, including themes, custom composition tokens, and styles like colors, typography, and spacing.
AI-written summary of version 0.3.1-alpha, based on the package's README and metadata. Report an inaccuracy
Use it when
- You use Tokens Studio for Figma and want to sync design tokens into your Flutter project automatically.
- You need a structured way to manage design systems with support for themes, typography, and composition tokens.
Skip it when
- You do not use Figma or Tokens Studio for your design tokens.
- You prefer manual styling and do not want a command-line code generator for your themes.
Strengths
- Supports multiple themes and metadata sets.
- Handles complex tokens like gradients, shadows, border radii, and math expressions.
- Provides composition tokens for creating custom widgets and InputDecoration conversions.
Weaknesses
- Breaking changes may occur on releases lower than v1.0.0.
- Some token types or CSS color spaces (like non-sRGB) have limited or no support.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 5
Activate via 'dart pub global activate figma2flutter' and run the command against your JSON tokens file or folder.
Tokens(
tokens: LightTokens(),
child: MaterialApp(
home: Container(
width: context.tokens.sizing.large,
color: context.tokens.color.primary,
),
),
)Alternatives
Packages that do the same job and could replace figma2flutter.
- json_serializable
Automatically generate code for converting Dart classes to and from JSON.
94Compare - json_annotation
Provides annotations for json_serializable to generate JSON (de)serialization code.
84Compare - json2model
Generates Dart model classes from JSON strings via command line
69Compare - auto_exporter
Automatically export Dart classes and enums using annotations and build_runner.
58Compare
Works with
Packages commonly used together with figma2flutter: ones it builds on, ones built on it, and its own family.