modifyProps method

void modifyProps(
  1. PropsModifier? modifier, [
  2. bool shouldModify = true
])

Allows modifier to alter the instance if shouldModify is true.

Is a noop if shouldModify is false or modifier is null.

Related: addProps

Implementation

void modifyProps(PropsModifier? modifier, [bool shouldModify = true]) {
  if (!shouldModify || modifier == null) return;

  modifier(this);
}