paint method

  1. @override
void paint(
  1. PaintingContext context,
  2. Offset offset
)
override

Paints this render object into the given context at offset.

Implementation

@override
void paint(PaintingContext context, Offset offset) {
  final Color bgColor = focused ? focusColor : backgroundColor;
  final Color fgColor = enabled ? Color.white : Color.brightBlack;
  final TextStyle bgStyle = TextStyle(backgroundColor: bgColor);
  final TextStyle fgBgStyle =
      TextStyle(color: fgColor, backgroundColor: bgColor);
  final int textW = _textWidth;
  _fillBackground(
      context, offset.x.toInt(), offset.y.toInt(), textW + 3, bgStyle);
  final int cx = _paintChars(
      context, offset.x.toInt() + 1, offset.y.toInt(), text, fgBgStyle);
  final String arrow = isOpen ? ' ▲' : ' ▼';
  _paintChars(context, cx, offset.y.toInt(), arrow, fgBgStyle);
}