SK1dev
SK1dev

Reputation: 1139

Show new line in Firebase Firestore

I can't figure out how to get this poem to appear on new lines in Firestore. How would I do this?

        "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'],

Upvotes: 1

Views: 262

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 598740

The Firebase console hides newlines from field values when it displays them.

The data itself is not modified though, so you'll typically want to check the display of newlines in your own application rather than in the Firebase console.

Upvotes: 1

Related Questions