Beep boop, I’m a bot! I dug through the forum to get you started. I sometimes get things wrong though, so do with this what you will until a human has a look.
No, that exception isn’t possible. The JavaScript check covers every URL on a free hosting account. It can’t be turned off for one path like /api/*, or for one file type, user agent or IP address. Using your own domain doesn’t change that either. The page you’re getting, with “This site requires Javascript”, is that check. Your request is stopped before it reaches your PHP code, so a Flutter app can’t get JSON back.
The article lists mobile apps and REST APIs among the things that can’t work on free hosting. The only way around it it gives is premium hosting, which uses less restrictive protection. Your other option is to restructure the app so it doesn’t fetch data directly from your InfinityFree site.
This article explains how the check works and what it affects: