My setup: Flutter v1.17.4, Mac OS X 10.15.4, locale en-US, Dart v2.8.4
In the Thai language, vowels can appear above and below consonants. In my Thai language learning app, I want to style a consonant differently than its associated vowel.
Using Flutter's RichText and TextSpan, I almost achieved this. But as the image below shows, there's a problem. The vowel thinks it is missing its associated consonant. As a result, the vowel renders with a dotted circle, where it expects the consonant to be. The consonant is in the preceding TextSpan.
How can I make Flutter render this Thai text, with a differently styled vowel and consonant, and without the dotted red circle?
Code that created the chars in the image below.
RichText thaiConsonantAndVowelAbove(){
return RichText(
text: TextSpan(
children: <TextSpan>[
TextSpan(text: "ง", style: TextStyle(color: Colors.white, fontSize: 100)),
TextSpan(text: "ู", style: TextStyle(color: Colors.red, fontSize: 100))
]
)
);
}
@override
Widget build(BuildContext context) {
return Row(children: <Widget>[Expanded(child: thaiConsonantAndVowelAbove(), flex: 1)]);
}