Last active
March 26, 2020 09:26
-
-
Save magicleon94/401c5cfa6743670a4ca6b4d0c4828672 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 const 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