build method

  1. @override
Widget build(
  1. BuildContext context
)
override

Returns a Container widget with the given properties.

The color property of the BoxDecoration is set to the Theme.of(context).colorScheme.surfaceContainer color.

The borderRadius property of the BoxDecoration is set to a BorderRadius.circular with a radius determined by the useInBorderRadius property.

The child is passed as-is.

Implementation

@override
/// Returns a [Container] widget with the given properties.
///
/// The [color] property of the [BoxDecoration] is set to the
/// [Theme.of(context).colorScheme.surfaceContainer] color.
///
/// The [borderRadius] property of the [BoxDecoration] is set to a
/// [BorderRadius.circular] with a radius determined by the
/// [useInBorderRadius] property.
///
/// The [child] is passed as-is.
Widget build(final BuildContext context) => Container(
  padding: padding,
  decoration: BoxDecoration(
    color: color ?? Theme.of(context).colorScheme.surfaceContainer,
    borderRadius: useInBorderRadius
        ? BorderRadius.circular(AppConstants.inBorderRadius)
        : BorderRadius.circular(AppConstants.outBorderRadius),
  ),
  child: child,
);