CustomStylesBuilder typedef Null safety

CustomStylesBuilder = Map<String, String>? Function(Element element)

A callback to specify custom styling.

The returned Map will be applied as inline styles. See list of all supported inline stylings in, the sample callback below changes the color for all elements that have CSS class name:

  'Hello <span class="name">World</span>!',
  customStylesBuilder: (element) =>
    element.classes.contains('name') ? {'color': 'red'} : null,


typedef CustomStylesBuilder = Map<String, String>? Function(
  dom.Element element,