setResizeMode method
Implementation
@ControllerProps(NodeProps.kResizeMode)
void setResizeMode(ImageRenderViewModel renderViewModel, String resizeMode) {
if (resizeMode == 'contain') {
renderViewModel.fit = BoxFit.contain;
} else if (resizeMode == 'cover') {
renderViewModel.fit = BoxFit.cover;
} else if (resizeMode == 'center') {
renderViewModel.alignment = Alignment.center;
} else if (resizeMode == 'origin') {
renderViewModel.alignment = Alignment.topLeft;
} else if (resizeMode == 'repeat') {
renderViewModel.repeat = ImageRepeat.repeat;
} else {
renderViewModel.fit = BoxFit.cover;
}
}