addUnconsumedProps method

  1. @override
void addUnconsumedProps(
  1. Map props,
  2. Iterable<PropsMeta> consumedProps
)
override

Copies key-value pairs from the provided props map into this map, excluding those with keys found in consumedProps.

consumedProps should be a Iterable<PropsMeta> instance. This is the return type of PropsMetaCollection's related APIs forMixins, allExceptForMixins, and all.

Example:

// within a functional component (wrapped in `uiFunction`)
// Consider props in FooProps "consumed"...
final consumedProps = props.staticMeta.forMixins({FooProps});
// ...and filter them out when forwarding props to Bar.
return (Bar()..addUnconsumedProps(props, consumedProps))();

To only add DOM props, use addUnconsumedDomProps.

Related: UiComponent2's addUnconsumedProps

Implementation

@override
void addUnconsumedProps(Map props, Iterable<PropsMeta> consumedProps) =>
    throw UnimplementedError('@PropsMixin instances do not implement addUnconsumedProps');