Skip to content

Commit eb08b01

Browse files
committed
Auto wrap ruby to new lines when the ruby text is too long
1 parent ab2a22b commit eb08b01

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lib/src/replaced_element.dart

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,15 @@ class RubyElement extends ReplacedElement {
127127
node = c;
128128
}
129129
});
130-
return Row(
130+
return Wrap(
131131
key: AnchorKey.of(context.parser.key, this),
132-
crossAxisAlignment: CrossAxisAlignment.end,
133-
textBaseline: TextBaseline.alphabetic,
134-
mainAxisSize: MainAxisSize.min,
135-
children: widgets,
132+
runSpacing: rubySize,
133+
children: widgets.map((e) => Row(
134+
crossAxisAlignment: CrossAxisAlignment.end,
135+
textBaseline: TextBaseline.alphabetic,
136+
mainAxisSize: MainAxisSize.min,
137+
children: [e],
138+
)).toList(),
136139
);
137140
}
138141
}

0 commit comments

Comments
 (0)