maskCallback<T extends Widget> method

  1. @experimental
void maskCallback<T extends Widget>(
  1. SentryMaskingDecision shouldMask(
    1. Element,
    2. T
    ), {
  2. String? name,
  3. String? description,
})

Provide a custom callback to decide whether to mask the widget of class T (or subclasses of T). Note: masking rules are called in the order they're added so if a previous rule already makes a decision, this rule won't be called.

Implementation

@experimental
void maskCallback<T extends Widget>(
    SentryMaskingDecision Function(Element, T) shouldMask,
    {String? name,
    String? description}) {
  assert(T != SentryMask);
  assert(T != SentryUnmask);
  _userMaskingRules.add(SentryMaskingCustomRule<T>(
    callback: shouldMask,
    name: name ?? T.toString(),
    description:
        description ?? 'Custom callback-based rule (description unspecified)',
  ));
}