Since I can't leave a comment, I'm posting my question here.
I tried using:
await Future.delayed(Duration(milliseconds: 1000));
However, some users still can't see the JS file being loaded.
Should I try increasing the delay time?
Have you found any other solution that works more reliably?