Reputation: 5891
My API sends a json with the following format:
{ status: false, message: 'This is an error \n\n with multi line!' }
I'd like to show the message and apply the new lines set in the json.
I'm using Dio package and I return the information like:
Response response = await Dio().post(...)
String message = response.data['message'];
This prints literally This is an error \n\n with multi line!
instead of printing:
This is an error
with multi line!
If I type manually String message = 'This is an error \n\n with multi line!'
it works great.
It seems to me that I have to use replaceAll
function, but I don't know what to replace.
Upvotes: 0
Views: 1109