getBoxDecoration method

BoxDecoration getBoxDecoration(
  1. BoxDecoration? boxDecoration,
  2. Color? color
)

Returns a BoxDecoration with the specified color if the boxDecoration is not null, otherwise returns a BoxDecoration with the specified color, or an empty BoxDecoration.

Implementation

BoxDecoration getBoxDecoration(BoxDecoration? boxDecoration, Color? color) {
  if (boxDecoration != null) {
    return boxDecoration.color != null
        ? boxDecoration
        : boxDecoration.copyWith(color: color);
  }

  if (color != null) {
    return BoxDecoration(color: color);
  }

  return const BoxDecoration();
}