Core Concepts

This page introduces the key concepts you need to understand before working with IntelliToggle. These foundational ideas will help you make the most of feature flags and ensure you’re applying them effectively within your Dart or Flutter applications.

What Are Feature Flags?

A feature flag is a runtime switch that allows you to enable or disable functionality in your application without deploying new code. Feature flags are commonly used for:

  • Gradual or percentage-based rollouts

  • A/B testing and experimentation

  • Instant rollback of problematic features

  • Environment-specific feature control

  • Internal-only or beta feature access

Think of them as if-statements controlled remotely.

Flag Types

IntelliToggle supports multiple types of flags depending on the feature behavior you want to control:

Type Description

boolean

On/off flags (e.g., enable dark mode)

string

Used for content variants or AB test group names

number

Useful for thresholds, pricing experiments, etc.

json // Optional, if IntelliToggle supports it

Complex structured values (e.g., config settings)

Your SDK will return the type you declare. A mismatch between flag type and expected type may cause evaluation errors.

Feature Evaluation

At runtime, IntelliToggle evaluates a flag based on:

  • The flag definition

  • The current environment (e.g., development, staging, production)

  • Context provided by the SDK (e.g., user ID, segment)

You can also pass in evaluation context explicitly (see SDK Usage).

final enabled = await toggle.getFlag<bool>('new_ui');

Environments

Flags can behave differently based on the environment you’re running in.

Common environments:

  • development

  • staging

  • production

Each environment can have its own default values, targeting rules, and overrides. This helps you test flags safely before enabling them for end users.

User Targeting (Segmentation)

Targeting allows you to serve features only to certain users or groups. You can segment based on:

  • User ID

  • Email domain

  • Platform or OS

  • Custom attributes (e.g., region, account tier)

Example: roll out a new onboarding flow only to premium users.

await toggle.getFlag<bool>(
  'new_onboarding',
  context: {
    'user_id': currentUser.id,
    'account_type': currentUser.accountType,
  }
);

Targeting rules are defined in the IntelliToggle dashboard.

Remote Configuration

Flags can do more than enable or disable a feature. They can also be used to return remote configuration values:

final buttonColor = await toggle.getFlag<String>('primary_button_color');

This lets you adjust visual or functional behavior remotely without a redeploy.

Experimentation and A/B Testing

You can define flags that serve different values to different users and track which variant performs better.

Example use cases:

  • Test different headlines

  • Roll out a new feature to 10% of users

  • Compare onboarding flows across groups

Integration with analytics tools is recommended for measuring outcomes (e.g., Google Analytics, Mixpanel, etc.).

Kill Switches

Feature flags can also serve as emergency kill switches, allowing you to disable critical functionality if something goes wrong in production.

Best practices:

  • Always define fallback behavior in code

  • Monitor health metrics on newly enabled flags

final isFeatureSafe = await toggle.getFlag<bool>('checkout_v2');
if (!isFeatureSafe) return fallbackCheckout();

Summary

Feature flags are more than just toggles — they’re control levers for modern, continuous delivery. Understanding environments, targeting, evaluation, and flag types will help you build safer, more resilient, and more flexible applications with IntelliToggle.

For next steps, check out: