Skip to content

Commit b06c883

Browse files
author
Nguyen Dat
committed
add text overflow
1 parent 8ca2aad commit b06c883

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

lib/html_parser.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ class StyledText extends StatelessWidget {
788788
textDirection: style.direction,
789789
textScaleFactor: textScaleFactor,
790790
maxLines: style.maxLine,
791-
overflow: TextOverflow.ellipsis,
791+
overflow: style.textOverflow,
792792
),
793793
);
794794
}

lib/style.dart

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,13 @@ class Style {
182182
///
183183
int maxLine;
184184

185+
/// TextOverflow
186+
///
187+
///
188+
///
189+
///
190+
TextOverflow textOverflow;
191+
185192
Style({
186193
this.backgroundColor = Colors.transparent,
187194
this.color,
@@ -215,6 +222,7 @@ class Style {
215222
this.alignment,
216223
this.markerContent,
217224
this.maxLine,
225+
this.textOverflow,
218226
}) {
219227
if (this.alignment == null &&
220228
(display == Display.BLOCK || display == Display.LIST_ITEM)) {
@@ -288,8 +296,9 @@ class Style {
288296
//TODO merge border
289297
alignment: other.alignment,
290298
markerContent: other.markerContent,
291-
299+
292300
maxLine: other.maxLine,
301+
textOverflow: other.textOverflow,
293302
);
294303
}
295304

@@ -323,6 +332,7 @@ class Style {
323332
whiteSpace: child.whiteSpace ?? whiteSpace,
324333
wordSpacing: child.wordSpacing ?? wordSpacing,
325334
maxLine: child.maxLine ?? maxLine,
335+
textOverflow: child.textOverflow ?? textOverflow,
326336
);
327337
}
328338

@@ -359,6 +369,7 @@ class Style {
359369
Alignment alignment,
360370
String markerContent,
361371
int maxLine,
372+
TextOverflow textOverflow,
362373
}) {
363374
return Style(
364375
backgroundColor: backgroundColor ?? this.backgroundColor,
@@ -394,6 +405,7 @@ class Style {
394405
alignment: alignment ?? this.alignment,
395406
markerContent: markerContent ?? this.markerContent,
396407
maxLine: maxLine ?? this.maxLine,
408+
textOverflow: textOverflow ?? this.textOverflow,
397409
);
398410
}
399411

0 commit comments

Comments
 (0)