paint method

  1. @override
void paint(
  1. Context context
)
override

Draw itself and its children, according to the calculated box.offset

Implementation

@override
void paint(Context context) {
  super.paint(context);
  final resolvedPadding = padding.resolve(Directionality.of(context));
  if (child != null) {
    final mat = Matrix4.identity();
    mat.translateByDouble(
      box!.left + resolvedPadding.left,
      box!.bottom + resolvedPadding.bottom,
      0,
      1,
    );
    context.canvas
      ..saveContext()
      ..setTransform(mat);
    child!.paint(context);
    context.canvas.restoreContext();
  }
}