I'm trying to utilize a new line command to create a new line in text. It appears from this issue that this is not possible: New Line Command (
) Not Working With Firebase Firestore Database Strings
Is this still the case? Assuming so, does Flutter offer any methods with similar functionality to the following that would allow me to work around this?
label.text = stringRecived.replacingOccurrences(of: "
", with: "
")
*More context:
Here is a picture of my Firestore string where I entered the data.
I then use a future builder to call this from Firestore and then pass the string (in this case comment) into another widget.
return new SocialFeedWidget(
filter: false,
articleID: document['article'],
article_header: document['article_title'],
userName: document['author'],
spectrumValue: document['spectrum_value'].toDouble(),
comment: document['comment'],
fullName: document['firstName'] + " " + document['lastName'],
user_id: document['user_id'],
postID: document.documentID,
posterID: userID,
);
}).toList(),
In the new widget, I pass it in as a string an feed it via a Text widget as follows:
new Text(
comment,
style: new TextStyle(
color: Color.fromRGBO(74, 74, 74, 1.0),
fontSize: 13.0,
),
),
When it appears, it still has the
within the string.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…