ExampleFeature Flags

Gradual Rollout

Release a new feature to 5% of users, monitor for issues, then progressively increase to 100% — all without a new app release.

The rollout process

0%

Deploy behind the flag

Ship the new feature in your app release, wrapped in a flag check. Flag is off for everyone.

5%

Initial canary

Enable for 5% of users. Monitor crash rates, API errors, and user feedback for 24–48 hours.

25%

Expand if stable

No issues found — increase to 25%. Monitor for another 24 hours.

50%

Majority rollout

Half your users see the new feature. Final validation window.

100%

Full release

All users have the feature. Plan to remove the flag in the next app release.

Flutter code

The code never changes between rollout stages — only the percentage in the dashboard changes:

lib/screens/home_screen.dartDart
@override
Widget build(BuildContext context) {
  // This check stays the same throughout the entire rollout
  final showNewFeed = Koolbase.flags['new_feed_algorithm'] == true;

  return Scaffold(
    body: showNewFeed
      ? const NewFeedScreen()      // shown to users in the rollout
      : const LegacyFeedScreen(),  // shown to everyone else
  );
}

Emergency rollback

If you detect a problem — spike in crashes, user complaints, or an error rate jump — disable the flag immediately from the dashboard. All users revert to the old behavior within one polling cycle (default 60 seconds):

Kill switch

Dashboard → Feature Flags → new_feed_algorithm → toggle off. No code change. No app release. Instant rollback.

Always keep the fallback path working

The legacy path must remain functional until the flag is removed from code entirely. Never delete the old code path until you've shipped a release at 100% and confirmed stability.