render method

  1. @override
dynamic render()

Renders the elements of this component.

Accepted return types:

  • dart:html UINode and UIElement.
  • DIVElement, DOMNode, AsDOMElement and AsDOMNode.
  • Future.
  • UIAsyncContent.
  • String, parsed as HTML.
  • Map (rendered as JSON).
  • List with previous types (recursively).
  • Function that returns any previous type. Including Function

Implementation

@override
dynamic render() {
  if (_load.isNotLoaded) return '...';

  if (_icon != null) {
    _icon!.remove();
  }

  if (_textElement != null) {
    _textElement!.remove();
  }

  _icon = BootstrapIcons.svgIconElement('calendar');

  _textElement = createHTML('''
    <div class="form-control" style="max-width: 80vw; white-space: nowrap; text-overflow: ellipsis;"></div>
  ''');

  _textElement!.children.add(_icon!);

  _configureLocale();
  _buildDateRanges();
  _configureDatePicker();

  return _textElement;
}