TextDrawable constructor

TextDrawable({
  1. required String text,
  2. required Offset position,
  3. double rotation = 0,
  4. double scale = 1,
  5. TextStyle style = const TextStyle(fontSize: 14, color: Colors.black),
  6. TextDirection direction = TextDirection.ltr,
  7. bool locked = false,
  8. bool hidden = false,
  9. Set<ObjectDrawableAssist> assists = const <ObjectDrawableAssist>{},
})

Creates a TextDrawable to draw text.

The path will be drawn with the passed style if provided.

Implementation

TextDrawable({
  required this.text,
  required Offset position,
  double rotation = 0,
  double scale = 1,
  this.style = const TextStyle(
    fontSize: 14,
    color: Colors.black,
  ),
  this.direction = TextDirection.ltr,
  bool locked = false,
  bool hidden = false,
  Set<ObjectDrawableAssist> assists = const <ObjectDrawableAssist>{},
})  : textPainter = TextPainter(
        text: TextSpan(text: text, style: style),
        textAlign: TextAlign.center,
        textScaleFactor: scale,
        textDirection: direction,
      ),
      super(
          position: position,
          rotationAngle: rotation,
          scale: scale,
          assists: assists,
          locked: locked,
          hidden: hidden);