cssText method

String cssText()

Implementation

String cssText() {
  if (fit == BoxFit.contain) {
    return 'contain';
  }
  if (fit == BoxFit.cover) {
    return 'cover';
  }
  if (width == null && height == null) {
    return 'auto';
  }

  if (width != null && (width == height || height == null)) {
    return width!.cssText();
  }

  return '${width!.cssText()} ${height!.cssText()}';
}