addFromProps method

void addFromProps(
  1. Map? props
)

Adds the CssClassPropsMixin.className and excludes the CssClassPropsMixin.classNameBlacklist values if specified within the provided props Map.

This method gracefully handles null props, as well as unspecified/null prop values.

This method, along with toProps, are useful for merging sets of className/blacklist props.

Implementation

void addFromProps(Map? props) {
  if (props == null) {
    return;
  }

  var cssClassProps = CssClassPropsMapView(props);

  this
    ..add(cssClassProps.className)
    ..blacklist(cssClassProps.classNameBlacklist);
}