We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ff93000 commit 06a7f4aCopy full SHA for 06a7f4a
lib/src/widgets/text_line.dart
@@ -37,8 +37,14 @@ class TextLine extends StatelessWidget {
37
Widget build(BuildContext context) {
38
assert(debugCheckHasMediaQuery(context));
39
40
- if (line.hasEmbed) {
41
- final embed = line.children.single as Embed;
+ // In rare circumstances, the line could contain an Embed & a Text of
+ // newline, which is unexpected and probably we should find out the
42
+ // root cause
43
+ final childCount = line.childCount;
44
+ if (line.hasEmbed ||
45
+ (childCount > 1 && line.children.first is Embed))
46
+ {
47
+ final embed = line.children.first as Embed;
48
return EmbedProxy(embedBuilder(context, embed));
49
}
50
0 commit comments