Migration to Flutter Guide
Discover our battle-tested 21-step framework for a smooth and successful migration to Flutter!
Home
Glossary

Firebase Remote Config in Flutter

What is Firebase Remote Config in Flutter?

Firebase Remote Config in Flutter allows you to change app behavior and UI values remotely, without publishing a new app version. It is commonly used for feature flags, UI tweaks, limits, and temporary switches controlled from Firebase.

Why does it matter in Flutter app development?

Mobile releases are slow and risky.

Remote Config lets you:

  • disable broken features instantly
  • tune values after release
  • run controlled rollouts
  • experiment without redeploying

It acts as a safety layer between releases.

How does it work?

Remote Config stores key–value pairs in Firebase.

The Flutter app:

  • Defines local default values.
  • Fetches remote values asynchronously.
  • Activates fetched values.
  • Reads them via typed getters (getBool, getString, etc.).

If fetching fails, the app falls back to defaults.

When to use it?

Use Remote Config when:

  • Values may change after release.
  • You need feature flags.
  • Behavior should vary by environment or platform.
  • You want remote control without backend changes.

When not to use it?

Avoid Remote Config when:

  • Data must be real-time.
  • Logic is security-critical.
  • Configuration is complex or deeply nested.
  • App cannot work without fresh remote values.

Cache behavior (very important)

Remote Config is cached.

By default, values are fetched at most once every 12 hours. This often confuses developers during testing.

In development, reduce the interval:

await remoteConfig.setConfigSettings(
  RemoteConfigSettings(
    fetchTimeout: const Duration(minutes: 1),
    minimumFetchInterval: const Duration(minutes: 0),
  ),
);

On production, increase it again to several hours to avoid unnecessary network usage.

Defaults and offline safety

Always define defaults in code using setDefaults.

Why this matters:

  • First app launch may have no internet.
  • Fetch may fail.
  • Empty values can break UI logic.

The app should work correctly before any remote fetch succeeds.

UX pitfall: when to activate values

Calling fetchAndActivate() while the user is on a screen can cause visible UI changes (text, colors, layout). This looks like a glitch.

Safer strategies

  • fetch and activate during a splash/loading screen
  • fetch in background and activate on next app launch

Real-time updates

Remote Config supports live updates via onConfigUpdated.

This is useful for:

  • kill switches
  • forced update banners
  • time-sensitive promotions

It should be used carefully to avoid unexpected UI changes.

Best practices

  • Treat Remote Config as a control layer, not business logic.
  • Keep values simple and well-documented.
  • Separate fetch timing from UI rendering.
  • Never rely on it for authorization or security rules.

Learn more

Flutter architecture by LeanCode

Feature-Based Flutter App Architecture - LeanCode

Read about the LeanCode approach to Flutter architecture. We highlight some of the design decisions that should be made when developing a feature in mobile apps. This includes our approach to dependency injection, state management, widget lifecycle, and data fetching.

Flutter at scale by LeanCode

Building an Enterprise Application in Flutter

Building an enterprise-scale application in Flutter, as in any other framework, requires a specific approach toward organizing the team and the code they create. This comprehensive tech article explains how to approach such a large-scale project.