compileScreen method

IrScreen compileScreen(
  1. String name,
  2. DartValue tree,
  3. String? source
)

Implementation

IrScreen compileScreen(String name, DartValue tree, String? source) {
  final ctx = _Ctx(
    box: const _Box(forceW: true, forceH: true),
    text: theme.textStyle('bodyMedium')!,
    iconColor: theme.color('onSurfaceVariant'),
  );
  final node = _widget(tree, ctx);
  final IrFrame root;
  if (node is IrFrame) {
    root = node;
  } else {
    root = IrFrame(name: name, children: [node]);
  }
  root
    ..name = name
    ..role = 'screen'
    ..width = IrSizing.fixed(screenWidth)
    ..height = IrSizing.fixed(screenHeight)
    ..clip = true;
  return IrScreen(
    name: name,
    width: screenWidth,
    height: screenHeight,
    source: source,
    root: _sanitize(simplify(root)) as IrFrame,
  );
}