You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there anything we can do for this annoying problem when the encoder encodes string with backslashes etc and then dart can't read it correctly and I am still getting Invalid value: Not in inclusive range when decoding it
The text was updated successfully, but these errors were encountered:
Hi, I have found a solution for my use case so maybe it will help some1 too:
if you have a backslash "\" in your string you need to use string.replaceAll(r'\', r'\\'); and this I knew but what I didnt know is that in my case I am sending encodedPolyline to my database through rest api and I was doing string.replaceAll(r'\', r'\\'); on the string that I got back from the database but the string in the database was already without the backslash so I has to use that method on the string that I was sending to db so instead of 'y{zvH{n{fBV^V\PTLR' i had 'y{zvH{n{fBV^V\\PTLR' and in the process of sending it to the db one backslash is removed and when I get it back it is all ready to decode.
also the sign '^' is causing problems so also string.replaceAll('^', r'\^'); is needed.
I hope I explained it clear enough and I also hope that no other signs will cause trouble but I will wrap decoding method in try & catch just to be safe.
Hello,
Is there anything we can do for this annoying problem when the encoder encodes string with backslashes etc and then dart can't read it correctly and I am still getting Invalid value: Not in inclusive range when decoding it
The text was updated successfully, but these errors were encountered: