ReadMoreLess class

Inheritance

Constructors

ReadMoreLess({Key? key, required String text, String? readLessText, String? readMoreText, Duration animationDuration = const Duration(milliseconds: 200), double collapsedHeight = 70, int maxLines = 4, TextStyle? textStyle, TextAlign textAlign = TextAlign.center, Widget? iconCollapsed, Widget? iconExpanded, Widget customButtonBuilder(bool isCollapsed, VoidCallback onPressed)?, Color iconColor = Colors.black, TextStyle? buttonTextStyle})
const

Properties

animationDuration Duration
The duration of the animation when transitioning between read more and read less.
final
buttonTextStyle TextStyle?
The textstyle used for the read more/less button
final
collapsedHeight double
The height of the text in the collapsed state.
final
customButtonBuilder → (Widget Function(bool isCollapsed, VoidCallback onPressed)?)
Allows for a function that builds a custom clickable widget. isCollapsed is provided to detimine in what state the widget has to be built. onPressed is provided to allow for the widget to be clickable and to trigger the collapsed state.
final
hashCode int
The hash code for this object.
no setterinherited
iconCollapsed Widget?
Allows a widget to replace the icon in the read more/less button in the collapsed state.
final
iconColor Color
The color of the icon in the read more/less button. Does not work when iconCollapsed or iconExpanded are specified.
final
iconExpanded Widget?
Allows a widget to replace the icon in the read more/less button in the expanded state.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
maxLines int
The maximum number of lines of the text in the collapsed state.
final
readLessText String?
The text on the button when the text is expanded, in case the text overflows
final
readMoreText String?
The text on the button when the text is collapsed, in case the text overflows
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
text String
The main text to be displayed.
final
textAlign TextAlign
Whether and how to align text horizontally.
final
textStyle TextStyle?
The main textstyle used for 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
exceedsMaxLines(TextStyle textStyle, BoxConstraints size) bool
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