Last active
March 26, 2020 09:26
-
-
Save magicleon94/b530f4b75b5c7f2adcc15426e003b077 to your computer and use it in GitHub Desktop.
Excluding Dart code from the release compiled executable (Medium article)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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