Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove/hide Firebase warning "Running in emulator mode. Do not use with production credentials" when using Flutter?

When using Firebase in a Flutter app and enabling emulators for local/offline development, I cannot find a way to hide the "running in emulator mode" warning.

Enabling in flutter:

FirebaseAuth.instance.useAuthEmulator(host, 9099);

What you see when running on a platform....

flutter 'Running in emulator mode. Do not use with production credentials'

This makes for a poor developer experience when you're working on the app UX / UI locally.

Other published issues on this matter use CSS to hide the warning, but given this is a Flutter app, the same approach won't work.

How else can this be solved?

like image 596
Matthew Spence Avatar asked Oct 22 '25 20:10

Matthew Spence


1 Answers

If this is happening in the web build you can use the css trick.

You just need to add the style to web/index.html:

<body>
  <style>
    .firebase-emulator-warning {
      display: none;
    }
  </style>
... other body stuff
</body>
like image 181
Adson Leal Avatar answered Oct 25 '25 11:10

Adson Leal