FrameNode constructor

FrameNode({
  1. String name = '',
  2. double x = 0,
  3. double y = 0,
  4. double? width,
  5. double? height,
  6. SceneColor? fill,
  7. SceneColor? borderColor,
  8. double borderWidth = 1,
  9. double corner = 0,
  10. double? cornerTopLeft,
  11. double? cornerTopRight,
  12. double? cornerBottomRight,
  13. double? cornerBottomLeft,
  14. double? minWidth,
  15. double? maxWidth,
  16. double? minHeight,
  17. double? maxHeight,
  18. double opacity = 1,
  19. bool visible = true,
  20. NodeLayout layout = NodeLayout.absolute,
  21. bool clip = false,
  22. double gap = 8,
  23. double? padding,
  24. double? paddingLeft,
  25. double? paddingTop,
  26. double? paddingRight,
  27. double? paddingBottom,
  28. List<double?>? columns,
  29. double? cellPadding,
  30. double? cellPaddingLeft,
  31. double? cellPaddingTop,
  32. double? cellPaddingRight,
  33. double? cellPaddingBottom,
  34. SceneMainAxisAlignment mainAlign = SceneMainAxisAlignment.start,
  35. SceneCrossAxisAlignment crossAlign = SceneCrossAxisAlignment.center,
  36. List<SceneNode> children = const [],
})

Padding comes in as the grammar spells it — one number when one number says it, four names when it does not — rather than as a SceneEdges, which the file has no way to write.

Implementation

FrameNode({
  super.name,
  super.x,
  super.y,
  super.width,
  super.height,
  super.fill,
  super.borderColor,
  super.borderWidth,
  super.corner,
  super.cornerTopLeft,
  super.cornerTopRight,
  super.cornerBottomRight,
  super.cornerBottomLeft,
  super.minWidth,
  super.maxWidth,
  super.minHeight,
  super.maxHeight,
  super.opacity,
  super.visible,
  this.layout = NodeLayout.absolute,
  this.clip = false,
  this.gap = 8,
  double? padding,
  double? paddingLeft,
  double? paddingTop,
  double? paddingRight,
  double? paddingBottom,
  List<double?>? columns,
  double? cellPadding,
  double? cellPaddingLeft,
  double? cellPaddingTop,
  double? cellPaddingRight,
  double? cellPaddingBottom,
  this.mainAlign = SceneMainAxisAlignment.start,
  this.crossAlign = SceneCrossAxisAlignment.center,
  List<SceneNode> children = const [],
}) : columns = columns == null ? [] : [...columns],
     padding = _edges(
       padding,
       paddingLeft,
       paddingTop,
       paddingRight,
       paddingBottom,
     ),
     cellPadding = _edges(
       cellPadding,
       cellPaddingLeft,
       cellPaddingTop,
       cellPaddingRight,
       cellPaddingBottom,
     ) {
  this.children.addAll(children);
}