Skip to content

Instantly share code, notes, and snippets.

@magicleon94
Last active March 26, 2020 09:26
Show Gist options
  • Save magicleon94/b530f4b75b5c7f2adcc15426e003b077 to your computer and use it in GitHub Desktop.
Save magicleon94/b530f4b75b5c7f2adcc15426e003b077 to your computer and use it in GitHub Desktop.
Excluding Dart code from the release compiled executable (Medium article)
class Config {
static final bool enable = false;
}
class Features {
void runCheck() {
List<String> features = [
"feature1",
if (Config.enable) "feature2",
];
if (Config.enable) {
print("All features enabled");
} else {
print("Some features disabled");
}
}
}
void main() {
Features features = Features();
features.runCheck();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment