debugPaint method

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

Override this method to paint debugging information.

Implementation

@override
void debugPaint(PaintingContext context, Offset offset) {
  assert(() {
    // Only perform the baseline checks after `PipelineOwner.flushLayout` completes.
    // We can't run this check in the same places we run other intrinsics checks
    // (in the `RenderBox.size` setter, or after `performResize`), because
    // `getDistanceToBaseline` may depend on the layout of the child so it's
    // the safest to only call `getDistanceToBaseline` after the entire tree
    // finishes doing layout.
    //
    // Descendant `RenderObject`s typically call `debugPaint` before their
    // parents do. This means the baseline implementations are checked from
    // descendants to ancestors, allowing us to spot the `RenderBox` with an
    // inconsistent implementation, instead of its ancestors that only reported
    // inconsistent baseline values because one of its ancestors has an
    // inconsistent implementation.
    if (debugCheckIntrinsicSizes) {
      _debugVerifyDryBaselines();
    }
    if (debugPaintSizeEnabled) {
      debugPaintSize(context, offset);
    }
    if (debugPaintBaselinesEnabled) {
      debugPaintBaselines(context, offset);
    }
    if (debugPaintPointersEnabled) {
      debugPaintPointers(context, offset);
    }
    return true;
  }());
}