WxSpoilerText class
A widget that extends WxText to provide dynamic text expansion/collapse functionality.
This widget allows users to reveal or hide text content through a tap interaction. It's ideal for displaying sensitive information or lengthy text snippets that can be gradually revealed upon user request.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- Text
- WxText
- WxSpoilerText
Constructors
-
WxSpoilerText(String text, {Key? key, TextStyle? style, StrutStyle? strutStyle, TextAlign? textAlign, TextDirection? textDirection, TextScaler? textScaler, Locale? locale, bool? softWrap, TextOverflow? overflow, int? maxLines, String? semanticsLabel, TextWidthBasis? textWidthBasis, TextHeightBehavior? textHeightBehavior, Color? selectionColor, String? highlight, TextStyle? highlightStyle, WxTextFilterTap? highlightOnTap, List<
WxTextFilter> filter = const [], bool filterDisabled = false, bool filterCaseSensitive = false, bool filterMultiLine = false, bool filterUnicode = false, bool filterDotAll = false, Color outlineColor = const Color(0xFF000000), double outlineWidth = 0, Offset outlineOffset = Offset.zero, bool outlineBehind = false, Gradient? gradient, WxTextVariantBuilder? variant, Color? color, Color? backgroundColor, List<Shadow> ? shadows, String? fontFamily, double? fontSize, FontWeight? fontWeight, FontStyle? fontStyle, double? letterSpacing, double? wordSpacing, TextBaseline? textBaseline, double? height, bool expanded = false, ValueSetter? onExpanded, bool filterDisabledOnCollapsed = false, Duration duration = const Duration(milliseconds: 200), WxSpoilerBuilder wrapper = WxSpoilerText.defaultWrapper}) -
Creates a collapsible text widget.
const
Properties
- backgroundColor → Color?
-
Shortcut to
style.backgroundColor
finalinherited - caseSensitive → bool
-
If filter not empty,
then Dart ignores the case of letters when matching.
For example, with caseSensitive disable,
the
regexp
patterna
matches botha
andA
.finalinherited - color → Color?
-
Shortcut to
style.color
finalinherited - data → String?
-
The text to display.
no setterinherited
- dotAll → bool
-
If filter not empty,
then the
.
pattern will match all characters, including line terminators.finalinherited - duration → Duration
-
The duration of the whole orchestrated animation.
final
-
effectiveFilter
→ List<
WxTextFilter> -
This getter calculates and returns a combined list of
WxTextFilter
objects representing the actual filters applied to text content.no setterinherited - expanded → bool
-
Determines initial text visibility (expanded or collapsed).
final
-
filter
→ List<
WxTextFilter> -
List of
WxTextFilter
used to filter and control text appearancefinalinherited - filterDisabled → bool
-
Determines whether the text filter is disabled or not
finalinherited
- filterDisabledOnCollapsed → bool
-
Determines whether to disable all the filter when text collapsed.
final
- fontFamily → String?
-
Shortcut to
style.fontFamily
finalinherited - fontSize → double?
-
Shortcut to
style.fontSize
finalinherited - fontStyle → FontStyle?
-
Shortcut to
style.fontStyle
finalinherited - fontWeight → FontWeight?
-
Shortcut to
style.fontWeight
finalinherited - gradient → Gradient?
-
A gradient to use when filling the text.
If this is specified,
style.color
has no effect.finalinherited - hashCode → int
-
The hash code for this object.
no setterinherited
- height → double?
-
Shortcut to
style.height
finalinherited - highlight → String?
-
The text to highlight
finalinherited
- highlightOnTap → WxTextFilterTap?
-
Function triggered when a user taps on highlighted text
finalinherited
- highlightStyle → TextStyle?
-
The text style of highlighted text
finalinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- letterSpacing → double?
-
Shortcut to
style.letterSpacing
finalinherited - locale → Locale?
-
Used to select a font when the same Unicode character can
be rendered differently, depending on the locale.
finalinherited
- maxLines → int?
-
An optional maximum number of lines for the text to span, wrapping if necessary.
If the text exceeds the given number of lines, it will be truncated according
to overflow.
finalinherited
- minLines → int
-
Defines the minimum number of lines
the widget will always display,
regardless of the actual text content.
finalinherited
- minLinesDebugColor → Color?
-
This property defines the background color used to highlight
the area where the minimum number of lines of text will be displayed.
It's helpful for visually debugging layouts that rely on
a specific number of text lines being shown.
finalinherited
- multiLine → bool
-
If filter not empty,
then
^
and$
will match the beginning and end of a line, as well as matching beginning and end of the input, respectively.finalinherited - onExpanded → ValueSetter?
-
A callback function that is invoked whenever the
expanded
property changes.final - outlineBehind → bool
-
Whether the outline position is behind the text.
finalinherited
- outlineColor → Color
-
The color of the text outline.
finalinherited
- outlineOffset → Offset
-
Controls the distance between the text content and its outline in a widget.
It accepts an Offset object, which represents a two-dimensional displacement
in terms of horizontal (dx) and vertical (dy) distances.
finalinherited
- outlineWidth → double
-
The width of the text outline, in logical pixels.
finalinherited
- overflow → TextOverflow?
-
How visual overflow should be handled.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectionColor → Color?
-
The color to use when painting the selection.
finalinherited
- semanticsLabel → String?
-
An alternative semantics label for this text.
finalinherited
-
shadows
→ List<
Shadow> ? -
Shortcut to
style.shadows
finalinherited - softWrap → bool?
-
Whether the text should break at soft line breaks.
finalinherited
- strutStyle → StrutStyle?
-
The strut style to use. Strut style defines the strut, which sets minimum
vertical layout metrics.
finalinherited
- style → TextStyle?
-
If non-null, the style to use for this text.
finalinherited
- styleFromShortcuts → TextStyle
-
Collected text style from shortcuts
no setterinherited
- styleOverridden → TextStyle?
-
If non-null, the style to use for this text.
finalinherited
- text → String
-
The text to display.
finalinherited
- textAlign → TextAlign?
-
How the text should be aligned horizontally.
finalinherited
- textBaseline → TextBaseline?
-
Shortcut to
style.textBaseline
finalinherited - textDirection → TextDirection?
-
The directionality of the text.
finalinherited
- textHeightBehavior → TextHeightBehavior?
-
Defines how to apply TextStyle.height over and under text.
finalinherited
- textScaleFactor → double?
-
Deprecated. Will be removed in a future version of Flutter. Use
textScaler instead.
finalinherited
- textScaler → TextScaler?
-
The font scaling strategy to use when laying out and rendering the text.
finalinherited
- textSpan → InlineSpan?
-
The text to display as a InlineSpan.
no setterinherited
- textWidthBasis → TextWidthBasis?
-
Defines how to measure the width of the rendered text.
finalinherited
- unicode → bool
-
If filter not empty,
then Dart treats the pattern as a Unicode pattern per the ECMAScript standard.
finalinherited
- variant → WxTextVariantBuilder?
-
The variant text style to apply.
finalinherited
- wordSpacing → double?
-
Shortcut to
style.wordSpacing
finalinherited - wrapper → WxSpoilerBuilder
-
Callback that builds the final widget
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
createRegExp(
String source) → RegExp -
Creates and returns a new RegExp object based on the provided
source
string and optional configuration flags. Thesource
string represents the actual regular expression pattern you want to match against text.inherited -
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- defaultWrapper → const Widget Function(dynamic context, dynamic text, dynamic toggle)
- Default builder that uses GestureDetector to enable tapping on the wrapped content