feat: dyn show more

Closes #1629

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-10-19 20:12:28 +08:00
parent 287cea4d6c
commit cc00b2cc39
4 changed files with 38 additions and 1 deletions

View File

@@ -174,6 +174,7 @@ class Text extends StatelessWidget {
this.textWidthBasis,
this.textHeightBehavior,
this.selectionColor,
this.onShowMore,
}) : textSpan = null,
assert(
textScaler == null || textScaleFactor == null,
@@ -211,6 +212,7 @@ class Text extends StatelessWidget {
this.textWidthBasis,
this.textHeightBehavior,
this.selectionColor,
this.onShowMore,
}) : data = null,
assert(
textScaler == null || textScaleFactor == null,
@@ -349,6 +351,8 @@ class Text extends StatelessWidget {
/// (semi-transparent grey).
final Color? selectionColor;
final VoidCallback? onShowMore;
@override
Widget build(BuildContext context) {
final DefaultTextStyle defaultTextStyle = DefaultTextStyle.of(context);
@@ -435,6 +439,7 @@ class Text extends StatelessWidget {
text: data,
children: textSpan != null ? <InlineSpan>[textSpan!] : null,
),
onShowMore: onShowMore,
);
}
if (semanticsLabel != null || semanticsIdentifier != null) {