idWidgetOverlay static method

WidgetOverlayBuilder idWidgetOverlay({
  1. Color? color,
  2. Color textColor = Colors.white,
  3. double radius = 0.0,
})

An individual overlay for a Testable widget that renders with the given color and border radius. This will render the current status text from the active TestRunner in the center of the widget.

Implementation

static WidgetOverlayBuilder idWidgetOverlay({
  Color? color,
  Color textColor = Colors.white,
  double radius = 0.0,
}) =>
    ({
      required BuildContext context,
      required Testable testable,
    }) =>
        Container(
          alignment: Alignment.center,
          padding: EdgeInsets.all(4.0),
          decoration: BoxDecoration(
            borderRadius: BorderRadius.circular(radius),
            border: Border.all(
              color: TinyColor(
                TestableRenderController.of(context).overlayColor ??
                    color ??
                    Theme.of(context).errorColor,
              ).darken(20).color,
            ),
          ),
          child: ClipRect(
            child: Text(
              testable.id!,
              overflow: TextOverflow.ellipsis,
              style: TextStyle(
                color: textColor,
                fontFamily: 'Courier New',
                fontFamilyFallback: ['monospace', 'Courier'],
              ),
            ),
          ),
        );