setDefaultSource method
- @ControllerProps(NodeProps.kDefaultSource)
- ImageRenderViewModel renderViewModel,
- String defaultSource
Implementation
@ControllerProps(NodeProps.kDefaultSource)
void setDefaultSource(ImageRenderViewModel renderViewModel, String defaultSource) {
if (defaultSource.startsWith('data:image/')) {
var bytesImage = const Base64Decoder().convert(defaultSource.split('base64,').last);
renderViewModel.defaultImage = Image.memory(bytesImage);
} else {
LogUtils.w('ImageController', "setDefaultSource error, defaultSource must be base64");
}
}