renderListItem method
Widget
renderListItem(
- dynamic data,
- int position,
- dynamic animation
)
Implementation
Widget renderListItem(dynamic data, int position, animation){
if(data is PaginationLoad){
final renderedPaginate = renderPaginate(position);
//Pagination loading
return renderedPaginate ?? NUIListViewProgressWidget();
}
else if(data == null){
final renderedSkeletal = renderSkeletal(position);
return renderedSkeletal ?? NUIListViewProgressWidget();
}
NUIListItem? item = repo().getItemByClass(data.runtimeType);
if(item == null){
throwNUI(_MODULE, "List item for type : ${data.runtimeType.toString()} is not registered in the repository");
}
NUIListActionController handler = NUIListActionController(actionHandler, NUIListItemModel(position, data, checkedMap: checkedMap, configMap: configMap));
final shadowRadius = item.shadowRadius ?? 0;
return wrapWithPadding(position, item.inflater(data, position, handler), additionalPadding: shadowRadius);
}