skip to Main Content

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'

I’m all for security, but this makes for a poor developer experience when you’re working on the app and it’s UX locally; straight up annoying! 😉

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? Thank you 👋

2

Answers


  1. it’s work for me:

    void main() {
      // Suppress console warnings
      debugPrintOverride = (message, {wrapWidth}) {};
    
      runApp(MyApp());
    }
    
    Login or Signup to reply.
  2. 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>
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search