ruby_text 2.0.2 ruby_text: ^2.0.2 copied to clipboard
A RubyText widget, you can easily use this library to achieve the furigana effect.
RubyText #
A ruby text widget with flutter.
Install #
dependencies:
ruby_text: <Latest version.>
Example #
RubyText(
[
RubyTextData(
'検査',
ruby: 'けんさ',
),
],
);
Other #
RubyText(
this.data, {
this.style,
this.rubyStyle,
this.onTapDown,
this.onTapUp,
this.onTap,
this.onTapCancel,
this.textAlign,
this.textDirection,
this.softWrap,
this.overflow,
this.maxLines,
});
RubyTextData(
this.text, {
this.ruby,
this.style,
this.rubyStyle,
this.onTapDown,
this.onTapUp,
this.onTap,
this.onTapCancel,
});
// if you want to can use buildRubySpan
WidgetSpan buildRubySpan(
String text, {
String ruby,
BuildContext context,
TextStyle style,
TextStyle rubyStyle,
GestureTapDownCallback onTapDown,
GestureTapUpCallback onTapUp,
GestureTapCallback onTap,
GestureTapCancelCallback onTapCancel,
})