Site icon Flutter Packages | Pub dev Packages – Flutter Mobile App World

A Dart code generator that converts Figma components to Flutter widgets

Try it

Disclaimer: All of this is purely experimental and under active development (read why I started the project here). If I would have access to Figma rendering source code it would have been a lot easier and quicker (if a Figma employee read this and can share the algorithm, it would be awesome!), but be aware that all the rendering logic is reverse engineered, so you will experience a lot of inconsistencies! Moreover, a few performance and rendering tests have created yet, so please share your experiences through issues.

The easiest way to start is the online tool.

Documentation

Dynamic elements

Example: $checkmark

You can declare a node as dynamic by starting its name with $.

A <WidgetName>Data class is generated alongside the main class, with a property for each dynamic element.

Dynamic properties are exposed and depend on the node type :

Directive (experimental)

All directives start with # and allow you to control the behavior of your components by integrating Flutter elements.

Disclaimer : widget positionning is not finished yet and may not be located as expected.

tapRECTANGLE

Example: #tap(onSelected)

Defines a rectangle as a tappable area (an InkWell) with a callback.

widgetNODE

Example: #widget(field)

Includes a widget at the node location.

Roadmap

Their is still a lot of work to do, here a quick roadmap of what I have in mind :

Features and bugs

Please file feature requests and bugs at the issue tracker.

Download Figma for Flutter Source Code on GitHub

https://github.com/aloisdeniel/figma-to-flutter
Exit mobile version