setSource method
- @ControllerProps(NodeProps.kSource)
- ImageRenderViewModel renderViewModel,
- VoltronArray? source
Implementation
@ControllerProps(NodeProps.kSource)
void setSource(ImageRenderViewModel renderViewModel, VoltronArray? source) {
if (source == null || source.size() == 0) return;
VoltronMap? firstObj = source.get<VoltronMap>(0);
String? src = firstObj?.get<String>('uri');
if (src != null) {
src = renderViewModel.context.convertRelativePath(renderViewModel.rootId, src);
if (src != renderViewModel.src) {
renderViewModel.src = src;
}
}
}