在 Firebase Firestore 中显示新行
Show new line in Firebase Firestore
我不知道如何让这首诗出现在 Firestore 的新行中。我该怎么做?
"Broken bottles and charred pieces of glass,\n"
"Wadded up newspapers tossed on the grass,\n"
"Pouring of concrete and tearing out trees.\n"
"This is the environment that surrounds me?\n\n"
"Poisons and insecticides sprayed on our food,\n"
"Oceans filling with thick oil crude.\n"
"All sea life destined to a slow, awful doom.\n"
"These are the things we are to consume?\n\n"
"Mills pumping out iron, expelling yellow fumes,\n"
"Airlines emitting caustic gases from fuels,\n"
"Weapons of destruction tested at desolate sites.\n"
"And this is the air that's to sustain life?\n\n"
"There has to be something that someone can do,\n"
"Like raise the awareness to those around you\n"
"That if we don't heed the problem at hand\n"
"It's your life that's at stake, the destruction of man.\n\n";
return StreamBuilder(
stream: Firestore.instance
.collection('poems')
.snapshots(),
Padding(
padding: const EdgeInsets.all(16),
child: Text(
document['body'] == null ? '' : document['body'],
Firebase 控制台在显示字段值时隐藏换行符。
虽然数据本身没有被修改,因此您通常希望在自己的应用程序中而不是在 Firebase 控制台中检查换行符的显示。
我不知道如何让这首诗出现在 Firestore 的新行中。我该怎么做?
"Broken bottles and charred pieces of glass,\n"
"Wadded up newspapers tossed on the grass,\n"
"Pouring of concrete and tearing out trees.\n"
"This is the environment that surrounds me?\n\n"
"Poisons and insecticides sprayed on our food,\n"
"Oceans filling with thick oil crude.\n"
"All sea life destined to a slow, awful doom.\n"
"These are the things we are to consume?\n\n"
"Mills pumping out iron, expelling yellow fumes,\n"
"Airlines emitting caustic gases from fuels,\n"
"Weapons of destruction tested at desolate sites.\n"
"And this is the air that's to sustain life?\n\n"
"There has to be something that someone can do,\n"
"Like raise the awareness to those around you\n"
"That if we don't heed the problem at hand\n"
"It's your life that's at stake, the destruction of man.\n\n";
return StreamBuilder(
stream: Firestore.instance
.collection('poems')
.snapshots(),
Padding(
padding: const EdgeInsets.all(16),
child: Text(
document['body'] == null ? '' : document['body'],
Firebase 控制台在显示字段值时隐藏换行符。
虽然数据本身没有被修改,因此您通常希望在自己的应用程序中而不是在 Firebase 控制台中检查换行符的显示。