ModerationBehaviors class final

A configuration object that determines how moderation causes are interpreted and translated into UI behaviors.

The defaults replicate the official Bluesky moderation logic. Pass a customized instance via ModerationOpts.behaviors to change how blocks, mutes, muted words, hidden posts and labels are handled, without forking the moderation engine itself.

final opts = ModerationOpts(
  userDid: session.did,
  prefs: prefs,
  behaviors: ModerationBehaviors(
    // e.g. show muted content in feeds instead of blurring it.
    mute: {
      ModerationBehaviorContext.profileView: ModerationBehavior.alert,
    },
    // e.g. override or add global label definitions.
    labels: {
      ...kLabelDefinitions,
      'my-custom-label': myCustomLabelDefinition,
    },
  ),
);

Constructors

ModerationBehaviors({Map<ModerationBehaviorContext, ModerationBehavior> block = kDefaultBlockBehaviors, Map<ModerationBehaviorContext, ModerationBehavior> mute = kDefaultMuteBehaviors, Map<ModerationBehaviorContext, ModerationBehavior> muteWord = kDefaultMuteWordBehaviors, Map<ModerationBehaviorContext, ModerationBehavior> hide = kDefaultHideBehaviors, Map<String, InterpretedLabelValueDefinition> labels = kLabelDefinitions})
const

Properties

block Map<ModerationBehaviorContext, ModerationBehavior>
The behaviors applied when the subject is blocking, blocked by, or has another block relationship with the user.
final
hashCode int
The hash code for this object.
no setteroverride
hide Map<ModerationBehaviorContext, ModerationBehavior>
The behaviors applied when the subject was hidden by the user.
final
labels Map<String, InterpretedLabelValueDefinition>
The global label definitions keyed by label identifier.
final
mute Map<ModerationBehaviorContext, ModerationBehavior>
The behaviors applied when the subject is muted by the user.
final
muteWord Map<ModerationBehaviorContext, ModerationBehavior>
The behaviors applied when the subject matches one of the user's muted words.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override