Я пытаюсь получить строку из облачного пожарного магазина в формате Unicode и отобразить ее в своем приложении для флаттера.
c.10 \ u {207B} \ u {2076} секунд: начинается адронная эпоха: когда Вселенная охлаждается примерно до 10 \ u {00B9} \ u {2070} кельвинов, происходит кварк-адронный переход, в котором кварки связываются, образуя большесложные частицы - адроны.Это ограничение кварков включает в себя образование протонов и нейтронов (нуклонов), строительных блоков атомных ядер.
Когда я сохраняю его в виде строки и отображаю в виджете RichText, он работает нормально:
Widget _buildListItem(BuildContext context, DocumentSnapshot data) {
final record = Record.fromSnapshot(data);
String temp1 = "c. 10\u{207B}\u{2076} seconds: Hadron epoch begins: As the universe cools to about 10\u{00B9}\u{2070} kelvin, a quark-hadron transition takes place in which quarks bind to form more complex particles—hadrons. This quark confinement includes the formation of protons and neutrons (nucleons), the building blocks of atomic nuclei.";
return Padding(
key: ValueKey(record.name),
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
child: Container(
child: RichText(
text: TextSpan(text: temp1, style: defaultStyle),
),
),
);}
Принимая во внимание, что если я попытаюсь сохранить его в облачном хранилище и использовать тот же виджет RichText, он не будет работать.Это просто печать, как есть .:
Widget _buildListItem(BuildContext context, DocumentSnapshot data) {
final record = Record.fromSnapshot(data);
//String temp1 = "c. 10\u{207B}\u{2076} seconds: Hadron epoch begins: As the universe cools to about 10\u{00B9}\u{2070} kelvin, a quark-hadron transition takes place in which quarks bind to form more complex particles—hadrons. This quark confinement includes the formation of protons and neutrons (nucleons), the building blocks of atomic nuclei.";
return Padding(
key: ValueKey(record.name),
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 8.0),
child: Container(
child: RichText(
text: TextSpan(text: record.name, style: defaultStyle),
),
),
);
}
Пожалуйста, предоставьте решение для этого