auto_hyphenating_text
auto_hyphenating_text copied to clipboard
Add support for Text.rich
My implementation leverages Text.rich. Is this something that you can support?
What do you mean? The widget should already use rich text.
I'm using the RichText widget. This is my code snippet:
Text.rich(
TextSpan(
style: TextStyle(
color: textColor,
fontFamily: lang.fontFamily,
fontSize: preferenceController.fontSize.value,
fontStyle: fontStyle,
),
children: [
TextSpan(
children: <InlineSpan>[
WidgetSpan(
alignment: PlaceholderAlignment.top,
child: Text(
line.getString() ?? '',
textScaler: const TextScaler.linear(.5),
style: TextStyle(
color: textColor,
fontSize: preferenceController.fontSize.value,
fontFeatures: const <FontFeature>[
FontFeature.superscripts(),
],
),
),
),
TextSpan(
text: line.getString2(),
),
],
),
],
),
textAlign: TextAlign.justify,
textDirection: lang.textDirection,
)
When I attempt to replace Text.rich( with AutoHyphenatingText.rich(, I receive this error message:
The method 'rich' isn't defined for the type 'AutoHyphenatingText'.
Try correcting the name to the name of an existing method, or defining a method named 'rich'.
Does it work with other languages? Which languages are currently supported?
@impure , Any updates?
This isn't supported, it's supposed to be a drop in replacement for Text or SelectableText. Adding arbitrary TextSpan support would be too complicated.