Skip to content

Commit

Permalink
perf(pkgs): Avoid duplicate nested columns
Browse files Browse the repository at this point in the history
Avoid duplicate nested columns:
* Avoid duplicate nested layout columns when munching single child span.
  • Loading branch information
realth000 committed Nov 28, 2023
1 parent f84a315 commit 017f85f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/packages/html_muncher/lib/src/html_muncher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ class Muncher {
}
}
if (spanList.isNotEmpty) {
// Do not wrap in another layout when there is only one span.
if (spanList.length == 1) {
return spanList.first;
}
widgetList.add(RichText(
text: TextSpan(children: spanList),
textAlign: state.textAlign ?? TextAlign.justify,
Expand Down

0 comments on commit 017f85f

Please sign in to comment.