Skip to content
On this page

ExpandableText

Text that can expand from a shortened preview.

ExpandableText in FluttyUIExpandableText in FluttyUI dark theme

Import

import 'package:flutter/widgets.dart';
import 'package:fluttyui/fluttyui.dart' as ui;

API Reference

The declarations below match the current FluttyUI source. Types are shown without the optional ui. import prefix.

ExpandableText

const ExpandableText(
  this.text, {
  super.key,
  this.maxLines = 3,
  this.isExpanded,
  this.initiallyExpanded = false,
  this.onExpandedChanged,
  this.style,
  this.textAlign = TextAlign.start,
  this.expandLabel = 'Read more',
  this.collapseLabel = 'Show less',
  this.actionColor,
  this.actionGap = 6,
  this.motion,
});
ParameterTypeRequiredDefault
textStringYes—
keyKey?Nonull
maxLinesintNo3
isExpandedbool?Nonull
initiallyExpandedboolNofalse
onExpandedChangedValueChanged<bool>?Nonull
styleTextStyle?Nonull
textAlignTextAlignNoTextAlign.start
expandLabelStringNo'Read more'
collapseLabelStringNo'Show less'
actionColorColor?Nonull
actionGapdoubleNo6
motionComponentMotion?Nonull

Application Setup

Place components under FluttyApp to provide theme, navigation, localization, and overlay defaults. Use theme tokens for shared appearance settings.

Source

lib/src/widgets/typography/expandable_text/expandable_text.dart

This reference is generated from the ExpandableText declaration in the FluttyUI core checkout. The component catalog lists the other available building blocks.

DartFlutter

Get started with FluttyUI