render method

Future<Object> render({
  1. dynamic toData = false,
})

Renders the view.

The toData parameter determines whether to render as raw data or as a fully rendered view using the specified widget template.

If toData is true, the method returns the data processed by renderData. Otherwise, it returns the rendered view content.

If the widget path is empty, an error message is returned.

Implementation

Future<Object> render({toData = false}) async {
  if (toData) {
    return renderData();
  }
  if (widget.isEmpty) {
    return 'Widget of UIView is required.';
  }

  var view = await rq.render(
    path: widget,
    viewParams: {r'$v': await renderData()},
  );
  rq.removeParam(r'$v');

  return view;
}