This answer includes the two main ones mentioned as well as a vital point that wasn't:
- LAUNCH CONFIGURATION
Select and open your launch config:
Note the args
value:
{
"version": "0.2.0",
"configurations": [
{
"name": "Flutter (lib\\main.dart)",
"type": "dart",
"request": "launch",
"program": "lib\\main.dart",
"flutterMode": "profile",
"args": ["-d", "chrome", "--web-renderer", "html"]
}
]
}
Make sure you're running the same config:
Now you can run the app as usual.
- CORS
Install gsutil
and create a file cors.json
with content:
[
{
"origin": ["*"],
"method": ["GET"],
"maxAgeSeconds": 3600
}
]
Run gsutil cors set cors.json gs://[YOUR BUCKET]
. If you later want to clear this config from your bucket change the content to []
and run again.
- ADD TOKEN TO NetworkImage WIDGET
This is what made it work for my rules that required authentication, as I have removed the token param from the image url. Get the user auth token (FirebaseAuth.instance.currentUser.getIdToken()
) and add it to the headers arg like so:
NetworkImage(imageUrl, headers: {
'Authorization': 'Bearer $token',
})
Not sure what your particular situation is with "another domain" but I hope this is relevant.