Skip to content

Commit 79005e4

Browse files
committed
Made textalign available
1 parent cffd715 commit 79005e4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/ui/annotated_text/annotated_text.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import 'package:flutter/material.dart';
1010
/// The [actions] map is used to map the action name to the action to perform when the text is tapped.
1111
/// The [defaultStyle] is the style of the default text.
1212
/// The [annotationStyle] is the style of the annotated text.
13+
/// The [textAlign] is the alignment of the text.
1314
///
1415
/// [some text] only highlights the text, but does not trigger an action.
1516
/// [some text](action) highlights the text and triggers the action when tapped.
@@ -31,6 +32,7 @@ class AnnotatedText extends StatelessWidget {
3132
required this.actions,
3233
required this.defaultStyle,
3334
required this.annotationStyle,
35+
this.textAlign = TextAlign.start,
3436
super.key,
3537
});
3638

@@ -46,9 +48,13 @@ class AnnotatedText extends StatelessWidget {
4648
/// The style of the annotated text.
4749
final TextStyle annotationStyle;
4850

51+
/// The alignment of the text.
52+
final TextAlign textAlign;
53+
4954
@override
5055
Widget build(BuildContext context) {
5156
return RichText(
57+
textAlign: textAlign,
5258
text: _buildTextSpan(text: text, defaultStyle: defaultStyle, annotationStyle: annotationStyle, actions: actions),
5359
);
5460
}

0 commit comments

Comments
 (0)