ExpandableText constructor
const
ExpandableText({
- Key? key,
- required TextSpan textSpan,
- required int maxLines,
- Text seeMore = const Text("Show more", style: TextStyle(fontWeight: FontWeight.bold, decoration: TextDecoration.underline)),
- Text seeLess = const Text("Show less", style: TextStyle(fontWeight: FontWeight.bold, decoration: TextDecoration.underline)),
Multiline text that can be eventually expanded with a button to show more lines.
Defines the max number of lines to show and the text to truncate.
Implementation
const ExpandableText({
super.key,
required this.textSpan,
required this.maxLines,
this.seeMore = const Text(
"Show more",
style: TextStyle(
fontWeight: FontWeight.bold, decoration: TextDecoration.underline),
),
this.seeLess = const Text(
"Show less",
style: TextStyle(
fontWeight: FontWeight.bold, decoration: TextDecoration.underline),
),
});