flutterfire cannot fetch data from firebase firestore unless the path is hardcoded

Viewed 27

original code

If i change the .doc argument to the roomID variable, firebase wouldn't send any data back. Im confident the value inside the variable is completely same as the string. I know maybe there's some weird asynchronous stuff happening where the variable isn't set before this code runs? but the print function works fine.

Thoughts guys? any help will be appreciated.

1 Answers

It turns out that there is a leading whitespace in that variable. I thought that it's maybe the issue. I printed the length of it in the console and counted it myself, char by char. I got the same result and just ignored it. I spent a day to fix this error until my friend spotted it out for me. What a waste day....

Related