ir library
The Flutter2Figma intermediate representation (IR).
A framework-independent description of a UI: frames with auto-layout (IrFrame), text (IrText), sizing (IrSizing), paint and typography, plus the design system (IrDesignSystem) the nodes reference.
Producers (the Flutter compiler in package:flutter2figma/compiler.dart)
and consumers (the Figma renderer in package:flutter2figma/figma.dart)
meet here. Every node records the Flutter widgets it came from
(IrNode.origin) and their file:line (IrNode.source).
Serialized as ir.json via IrDocument.toJson / IrDocument.fromJson.
Classes
- IrColor
- sRGB color with components in 0..1.
- IrColorToken
- A color variable with one value per mode.
- IrComponent
- A reusable UI element. Its variants are defined by their first occurrence in the screens (see IrNode.instance).
- IrComponentVariant
- IrCorners
- IrDesignSystem
- IrDiagnostic
- IrDocument
- IrFrame
- IrGradient
- A linear or radial gradient. Points are in the frame's unit square ((0, 0) top left, (1, 1) bottom right).
- IrImageAsset
- An image file, embedded so the document is self-contained.
- IrImagePaint
- An image painted over a frame's fill.
- IrInsets
- IrInstanceRef
- Marks a node as an occurrence of component, in the variant selected by props (empty for components without variants).
- IrNode
- IrPosition
-
Absolute placement inside a
stackparent. Unset edges are unconstrained. - IrScreen
- IrShadow
- IrShadowToken
- IrSizing
- How a node sizes itself along one axis.
- IrStroke
- IrText
- IrTextStyle
- IrTextStyleToken
- A named text style. Only typography: text color is a separate token.
- IrVector
- A filled outline, such as an icon glyph.
Enums
- IrBoxFit
-
How an image is fitted into its box, as Flutter's
BoxFit. - IrCrossAlign
- IrLayoutDirection
-
stackchildren are positioned absolutely via IrNode.position. - IrMainAlign
- IrSeverity
- IrStrokeCap
-
How an open stroke ends (Flutter's
StrokeCap;noneis butt). - IrTextAlign
- SizingMode