Serving Files from Flutter Web

1 minute read

Wrds is a Flutter app hosted with Firebase hosting, as well as an Android and iOS app.

Admob requires that all apps serve an app_ads.txt file on their domain, but since Wrds domain is a Flutter app I wasn’t sure how to do that since Flutter is a magical platform.

I served a selectable text widget from my Flutter app to serve an app_ads.txt but Admob didn’t pick it up. Really I just wanted to serve an actual text file but didn’t know how to do it because Google failed me.

Serving Text Files from a Flutter App

You can put any files you want to be packaged with your app into your Flutter project’s web directory, and they’ll be bundled with your app when it’s automatically deployed to Firebase hosting with your git integration. You are doing that, right?

Updated: