flutter2figma 0.1.0
flutter2figma: ^0.1.0 copied to clipboard
Convert an existing Flutter UI into an editable Figma design: auto-layout frames, text styles, color variables with light/dark modes, and components.
0.1.0 #
First release.
Export #
flutter2figma exportturns a Flutter project intodesign.json(for the Figma plugin) andir.json(the intermediate representation).- Static analysis only: the app is never run. Screens are found through
wrappers such as providers,
BlocBuilder,PopScopeand auth gates. - Auto layout that follows Flutter's constraints (fixed / hug / fill).
Wrappers like
Paddingfold into frame padding, andSizedBoxspacers into gaps, but only when the result renders the same. - Layout, content, Material controls and surfaces,
TextField, and progress indicators. Widgets from packages andbuilder:widgets render their content. Anything unsupported becomes a flagged placeholder. - Runtime-dependent UI exports the initial state where it can be known, and
reports what it assumed:
- bloc/cubit builders see the bloc's initial state;
- constructor defaults are filled in, including freezed
@Default; - conditions on known values are folded;
- other conditionals keep the richer branch;
- loops over literal lists are unrolled, and loops over runtime data show sample items.
GridView,Switch,CheckboxandRadio, drawn with Material 3 defaults.
Theme #
- Reads the app's
MaterialApptheme,darkThemeandthemeMode, and resolves them the way Flutter does:- color schemes, including
ColorScheme.fromSeed; fontFamily,textThemeand GoogleFonts;- app bar, card and button themes;
- nested
Themewidgets.
- color schemes, including
- Checked against Flutter's own resolved theme on real apps (exact match).
flutter2figma themeprints the resolved theme as JSON.
Design system #
ColorSchemeroles become color variables with Light and Dark modes. Painted project color constants become variables too.- Text theme entries become text styles, and elevation levels become effect styles. Values bind to these only when they came from them.
- Material buttons become a
Buttoncomponent set. Project widgets used twice or more become components with instances.
API #
package:flutter2figma/flutter2figma.dartprovidesexportProject(). The stages are separate libraries:analyzer.dart,compiler.dart,ir.dartandfigma.dart.