toImage method

WImage toImage({
  1. double? width,
  2. double? height,
  3. double? size,
  4. BoxFit? fit,
  5. ValueChanged<WImageLoadStatus>? onLoadStatusChanged,
  6. ValueChanged<double>? onLoadProgress,
})

将字符串转换为 WImage 组件

Implementation

WImage toImage({
  double? width,
  double? height,
  double? size,
  BoxFit? fit,
  ValueChanged<WImageLoadStatus>? onLoadStatusChanged,
  ValueChanged<double>? onLoadProgress,
}) {
  final config = WImageConfig()
    ..width = size ?? width
    ..height = size ?? height;

  if (fit != null) {
    config.fit = fit;
  }

  return WImage(
    config: config,
    data: this,
    onLoadStatusChanged: onLoadStatusChanged,
    onLoadProgress: onLoadProgress,
  );
}