build method

Widget build(
  1. BoxDecoration? decoration
)

Build the scenario with paddings, outlines etc to better distinguish them once several scenarios are being tested. This is being used by NvGoldenMultiple.

Implementation

Widget build(BoxDecoration? decoration) => Container(
      margin: const EdgeInsets.all(_margin),
      width: screen.size.width,
      height:
          screen.size.height + _textHeight + _borderThickness * 2 + _space,
      child: Column(
        mainAxisSize: MainAxisSize.min,
        textDirection: TextDirection.ltr,
        children: [
          Container(
            height: _textHeight,
            child: Center(
              child: Text(
                screen.name != null ? '(${screen.name}) $name' : '$name',
                overflow: TextOverflow.ellipsis,
                textDirection: TextDirection.ltr,
                style: TextStyle(
                  fontFamily: 'Roboto',
                  color: Colors.black,
                  fontWeight: FontWeight.bold,
                  fontSize: 20,
                  decoration: TextDecoration.none,
                ),
              ),
            ),
          ),
          SizedBox(height: _space),
          Container(
            width: screen.size.width,
            height: screen.size.height,
            clipBehavior: Clip.hardEdge,
            decoration: decoration ?? BoxDecoration(),
            child: Builder(
              builder: (context) {
                final mediaQuery =
                    MediaQuery.maybeOf(context) ?? const MediaQueryData();
                final mergedMediaQuery = mediaQuery.copyWith(
                  size: screen.size,
                  padding: screen.safeArea,
                  platformBrightness: screen.platformBrightness,
                  devicePixelRatio: screen.devicePixelRatio,
                  textScaleFactor: screen.textScaleFactor,
                );

                return MediaQuery(
                  data: mergedMediaQuery,
                  child: wrap?.call(widget) ?? widget,
                );
              },
            ),
          ),
        ],
      ),
    );