shouldProcess<T> method

bool shouldProcess<T>({
  1. required bool enabled,
  2. required bool filter(
    1. T
    )?,
  3. required T value,
})
inherited

Returns true when the interceptor is enabled and the optional filter either is null or returns true for value.

Consolidates the settings.enabled && (filter?.call(x) ?? true) pattern used across all network interceptors.

Implementation

bool shouldProcess<T>({
  required bool enabled,
  required bool Function(T)? filter,
  required T value,
}) =>
    enabled && (filter?.call(value) ?? true);