ReadMoreExpandableText class

A widget that displays text that can be expanded and collapsed.

The ReadMoreExpandableText widget displays text that can be expanded to show more content or collapsed to show less. It provides customization options for text styles, max lines, and expand/collapse button appearance.

Inheritance

Constructors

ReadMoreExpandableText({Key? key, required String text, int maxLines = 3, TextStyle? textStyle, TextStyle? buttonStyle, String expandText = 'See More', String collapseText = 'See Less', IconData expandIcon = Icons.keyboard_arrow_down, IconData collapseIcon = Icons.keyboard_arrow_up, Color? iconColor, double iconSize = 17.5, EdgeInsets buttonPadding = const EdgeInsets.only(top: 12.0)})
const

Properties

buttonPadding EdgeInsets
The padding to apply around the expand/collapse button
final
buttonStyle TextStyle?
The style to apply to the "See More"/"See Less" button
final
collapseIcon IconData
The icon to show for the collapse button
final
collapseText String
The text to show for the collapse button
final
expandIcon IconData
The icon to show for the expand button
final
expandText String
The text to show for the expand button
final
hashCode int
The hash code for this object.
no setterinherited
iconColor Color?
The color of the expand/collapse icons
final
iconSize double
The size of the expand/collapse icons
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
maxLines int
The maximum number of lines to show when collapsed
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
text String
The text content to display
final
textStyle TextStyle?
The style to apply to the text
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
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, int wrapWidth = 65}) 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