FlutterCompiler class

Compiles analyzed Flutter widget trees into IrDocuments.

Constructors

FlutterCompiler({MaterialTheme theme = const MaterialTheme(), bool extractTheme = true, ThemeBrightness? brightness, double screenWidth = 390, double screenHeight = 844, int listPreviewCount = 3, bool designSystem = true, int minComponentUses = 2, Map<String, IconFont> iconFonts = const {}, ProjectAssets? assets})

Properties

assets ↔ ProjectAssets?
Where asset images are read from; compile defaults it to the project being compiled.
getter/setter pair
brightness → ThemeBrightness?
Which app theme to export; null follows MaterialApp.themeMode.
final
designSystem → bool
Emit an IrDesignSystem: color variables (per theme mode), text and effect styles, and components.
final
diagnostics → List<IrDiagnostic>
no setter
eval → ValueEvaluator
final
extractTheme → bool
Read the app's MaterialApp theme in compile. When false, the constructor's theme is used as is.
final
hashCode → int
The hash code for this object.
no setterinherited
iconFonts → Map<String, IconFont>
Icon fonts by family (e.g. MaterialIcons). Icons in these fonts are exported as their glyph outlines; others as placeholders.
final
listPreviewCount → int
How many items to render for ListView.builder without a literal count.
final
minComponentUses → int
A project widget becomes a component once used this many times.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
screenHeight → double
final
screenWidth → double
final
theme → MaterialTheme
The ambient theme (Theme.of(context)) at the current point.
no setter

Methods

compile(ProjectAnalysis analysis, {Map<String, IrScreen> rendered = const {}, Map<String, IrImageAsset> renderedImages = const {}}) → IrDocument
Compiles every screen of analysis. Screens in rendered (by name, e.g. captured at runtime) are used as they are instead, and their renderedImages are embedded too.
compileScreen(String name, DartValue tree, String? source) → IrScreen
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited