BaseSpanBuilder<TSpan extends InlineSpan> class abstract

Abstract base class for building text spans with censored content.

This class provides a common interface for creating InlineSpan objects that represent text with censored profanity. Subclasses must implement buildPlainSpan and buildCensoredSpan to define how normal and censored text are rendered.

The buildSpans method handles the logic of splitting text into spans, calling the appropriate builder methods for normal and censored portions.

Type parameter:

  • TSpan - The type of InlineSpan this builder creates

See also:

Implementers

Constructors

BaseSpanBuilder({required CensorIt censorIt, required TextStyle style})
Abstract base class for building text spans with censored content.

Properties

censorIt CensorIt
The CensorIt instance containing censored text and match information.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
style TextStyle
The text style to apply to normal (non-censored) text.
final

Methods

buildCensoredSpan(String originalWord, int index, bool revealAll) → TSpan
Builds a span for censored (profane) text.
buildPlainSpan(String text) → TSpan
Builds a span for normal (non-censored) text.
buildSpans({bool revealAll = true}) List<TSpan>
Builds a list of spans representing the entire text with censoring applied.
getMatches() List<RegExpMatch>
Returns the list of profanity matches found in the text.
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.
inherited