TextDrawable constructor
TextDrawable({
- required String text,
- required Offset position,
- double rotation = 0,
- double scale = 1,
- TextStyle style = const TextStyle(fontSize: 14, color: Colors.black),
- TextDirection direction = TextDirection.ltr,
- bool locked = false,
- 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);