ISpectBlocSettings class
Configuration settings for controlling Bloc lifecycle logging.
- Annotations
-
- @immutable
Constructors
- ISpectBlocSettings({bool enabled = true, bool printEvents = true, bool printTransitions = true, bool printChanges = true, bool printCompletions = true, bool printCreations = true, bool printClosings = true, bool printErrors = true, bool printEventFullData = false, bool printStateFullData = false, ISpectBlocTransitionFilter? transitionFilter, ISpectBlocEventFilter? eventFilter, ISpectBlocChangeFilter? changeFilter, bool enableRedaction = true, RedactionService? redactor})
-
Creates an instance of
ISpectBlocSettings.const
Properties
- changeFilter → ISpectBlocChangeFilter?
-
A filter function for change notifications.
final
- enabled → bool
-
Whether logging is enabled.
final
- enableRedaction → bool
-
Whether to apply redaction to sensitive data in log payloads.
final
- eventFilter → ISpectBlocEventFilter?
-
A filter function for events.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isRedactionActive → bool
-
Whether redaction is active for this configuration.
no setter
- printChanges → bool
-
Whether to log state changes.
final
- printClosings → bool
-
Whether to log Bloc closing events.
final
- printCompletions → bool
-
Whether to log lifecycle completions triggered by event handlers.
final
- printCreations → bool
-
Whether to log Bloc creation events.
final
- printErrors → bool
-
Whether to log Bloc errors.
final
- printEventFullData → bool
-
Whether to log full event payloads instead of only the runtime type.
final
- printEvents → bool
-
Whether to log events received by the Bloc.
final
- printStateFullData → bool
-
Whether to log full state payloads instead of only the runtime type.
final
- printTransitions → bool
-
Whether to log state transitions.
final
- redactor → RedactionService?
-
Optional redaction service for masking sensitive data in bloc state/event
payloads before they are logged.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- transitionFilter → ISpectBlocTransitionFilter?
-
A filter function for state transitions.
final
Methods
-
copyWith(
{bool? enabled, bool? printEvents, bool? printTransitions, bool? printChanges, bool? printCompletions, bool? printCreations, bool? printClosings, bool? printErrors, bool? printEventFullData, bool? printStateFullData, ISpectBlocTransitionFilter? transitionFilter, ISpectBlocEventFilter? eventFilter, ISpectBlocChangeFilter? changeFilter, bool? enableRedaction, RedactionService? redactor}) → ISpectBlocSettings - Returns a copy with the provided overrides.
-
formatEvent(
Object? event) → Object - Formats an event payload for display based on printEventFullData.
-
formatState(
Object? state) → Object - Formats a state payload for display based on printStateFullData.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
redactAdditionalData(
Map< String, dynamic> ? data) → Map<String, dynamic> ? - Applies redaction to an additionalData map if redaction is active.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- minimal → const ISpectBlocSettings
- Logs creation, transitions, and errors only.
- silent → const ISpectBlocSettings
- Turns off all logging.
- verbose → const ISpectBlocSettings
- Logs every lifecycle event with full payloads.