Skip to content

Instantly share code, notes, and snippets.

@ddikman
Last active September 23, 2021 03:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ddikman/6a61230ba7bac22b6c9f58998f7868c7 to your computer and use it in GitHub Desktop.
Save ddikman/6a61230ba7bac22b6c9f58998f7868c7 to your computer and use it in GitHub Desktop.
Example of feature flagging
void registerRoutes() {
// ...
final useNewArticlePage = isDebugMode == true;
if (useNewArticlePage) {
routing.register(Routes.Article, (context, param) => FixedSizeArticlePage());
} else {
routing.register(Routes.Article, (context, param) => ArticlePage());
}
// ....
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment