GradientConfig class
Configuration for applying gradients to text.
Constructors
- GradientConfig({required Gradient gradient, bool ignoreWidgetSpan = true, GradientRenderMode renderMode = GradientRenderMode.fullText, RegExp? ignoreRegex, void beforeDrawGradient(PaintingContext context, TextPainter textPainter, Offset offset)?, BlendMode blendMode = BlendMode.srcIn})
- Creates an instance of GradientConfig.
Properties
- beforeDrawGradient → void Function(PaintingContext context, TextPainter textPainter, Offset offset)?
-
A callback function that is called before the gradient is drawn on the text.
final
- blendMode → BlendMode
-
The blend mode to be used when applying the gradient.
default: BlendMode.srcIn (i.e., the gradient will be applied to the text).
It's better to use BlendMode.srcIn or BlendMode.srcATop.
final
- gradient → Gradient
-
The gradient to be applied for ExtendedText
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- ignoreRegex → RegExp?
-
It is a regular expression used to match
specific parts of the text where the gradient should not be applied.
For example, it can be used to exclude certain characters or words
(like emoji or special symbols) from the gradient effect.
default:
GradientMixin.ignoreRegex
final - ignoreWidgetSpan → bool
-
Whether the gradient should include
WidgetSpan
elements.final - renderMode → GradientRenderMode
-
The mode of gradient application (e.g., full text, per line, or per selection).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
copyWith(
{Gradient? gradient, bool? ignoreWidgetSpan, GradientRenderMode? renderMode, void beforeDrawGradient(PaintingContext context, TextPainter textPainter, Offset offset)?, BlendMode? blendMode}) → GradientConfig - Creates a copy of this GradientConfig with the given values.
-
copyWithIgnoreRegex(
RegExp? ignoreRegex) → GradientConfig -
Creates a copy of this GradientConfig with the given
ignoreRegex
. -
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
Static Properties
- ignoreEmojiRegex ↔ RegExp
-
getter/setter pair