TextNode.rich constructor

TextNode.rich(
  1. List<TextRun> runs, {
  2. String name = '',
  3. double x = 0,
  4. double y = 0,
  5. double? width,
  6. double? height,
  7. SceneColor? fill,
  8. SceneColor? borderColor,
  9. double borderWidth = 1,
  10. double corner = 0,
  11. double? cornerTopLeft,
  12. double? cornerTopRight,
  13. double? cornerBottomRight,
  14. double? cornerBottomLeft,
  15. double? minWidth,
  16. double? maxWidth,
  17. double? minHeight,
  18. double? maxHeight,
  19. double opacity = 1,
  20. bool visible = true,
  21. SceneTextAlign align = SceneTextAlign.left,
  22. int? maxLines,
  23. SceneTextStyle? style,
})

A paragraph of several runs, each with its own delta over style — one paragraph, laid out and wrapped as one, which is the whole reason a bold word is not a second node beside the first.

Implementation

TextNode.rich(
  List<TextRun> runs, {
  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.align = SceneTextAlign.left,
  this.maxLines,
  SceneTextStyle? style,
}) : runs = [...runs],
     fontFamily = style?.fontFamily,
     fontSize = style?.fontSize ?? 16,
     weight = style?.weight ?? SceneFontWeight.w400,
     italic = style?.italic ?? false,
     letterSpacing = style?.letterSpacing ?? 0,
     wordSpacing = style?.wordSpacing ?? 0,
     lineHeight = style?.lineHeight ?? 1.15,
     color = style?.color ?? const SceneColor(0xFF1A1A1A),
     textCase = style?.textCase ?? SceneTextCase.none,
     decoration = style?.decoration ?? SceneTextDecoration.none,
     decorationColor = style?.decorationColor,
     decorationThickness = style?.decorationThickness ?? 1,
     decorationStyle =
         style?.decorationStyle ?? SceneTextDecorationStyle.solid,
     layers = [...?style?.layers],
     axes = {...?style?.axes};