Skip to content

Commit 1e5ae06

Browse files
committed
text: Add optional textAlign param to TextWithLink
1 parent d9aba96 commit 1e5ae06

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

lib/widgets/text.dart

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,9 +438,16 @@ TextBaseline localizedTextBaseline(BuildContext context) {
438438
/// TODO(#1285): Generalize this to other styling, like code font and italics.
439439
/// TODO(#1553): Generalize this to multiple links in one string.
440440
class TextWithLink extends StatefulWidget {
441-
const TextWithLink({super.key, this.style, required this.onTap, required this.markup});
441+
const TextWithLink({
442+
super.key,
443+
this.style,
444+
this.textAlign,
445+
required this.onTap,
446+
required this.markup,
447+
});
442448

443449
final TextStyle? style;
450+
final TextAlign? textAlign;
444451

445452
/// A callback to be called when the user taps the link.
446453
///
@@ -520,6 +527,9 @@ class _TextWithLinkState extends State<TextWithLink> {
520527
]);
521528
}
522529

523-
return Text.rich(span, style: widget.style);
530+
return Text.rich(
531+
style: widget.style,
532+
textAlign: widget.textAlign,
533+
span);
524534
}
525535
}

0 commit comments

Comments
 (0)