PropsMeta.forSimpleKey constructor

PropsMeta.forSimpleKey(
  1. String key
)

A convenience constructor to make a metadata object for a single key.

Useful within UiComponent2.consumedProps.

Example:

@override
get consumedProps => [
  propsMeta.forMixin(InputWrapperProps),
  PropsMeta.forSimpleKey('onChange'),
];

Implementation

factory PropsMeta.forSimpleKey(String key) => PropsMeta(
  fields: [PropDescriptor(key)],
  keys: [key],
);