Feature Flags
A Comprehensive Guide to Implementing Feature Flags in Flutter
What are feature flags? Feature flags, also known as feature toggles or feature switches, are a…
Alexandru Puiu
April 14, 2023
3 min read
1services.AddTogglyWeb(options =>
2{
3 options.AppKey = "<YOUR_APP_KEY>";
4 options.Environment = "<YOUR_APP_ENVIRONMENT>";
5});
6
7// Views
8<feature name="FeatureX,FeatureY" requirement="Any">
9 <p>This only be seen if 'FeatureX' or 'FeatureY' is enabled.</p>
10</feature>
11
12// Controllers & Actions
13[FeatureGate(FeatureFlags.Users)]
14[FeatureUsage(FeatureFlags.Users)]
15public class UsersController : Controller
16{
17 ...
18}
19
20//IFeatureManagerSnapshot
21var feature1Enabled = await _featureManager.IsEnabledAsync(FeatureFlags.Feature1);