setWidth static method

StyleBase setWidth(
  1. StyleBase style,
  2. Dimension? width
)

Implementation

static StyleBase setWidth(StyleBase style, Dimension? width) {
  StyleBase rst = style.copyWith();
  if (style is Style) {
    (rst as Style).width = width;
  }
  if (style is ScopedStyles) {
    (rst as ScopedStyles).styles.forEach((key, value) {
      value.width = width;
    });
  }
  return rst;
}