toImage method
WImage
toImage({
- double? width,
- double? height,
- double? size,
- BoxFit? fit,
- ValueChanged<
WImageLoadStatus> ? onLoadStatusChanged, - 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,
);
}