kReleaseMode top-level constant
bool
const kReleaseMode
A constant that is true if the application was compiled in release mode.
More specifically, this is a constant that is true if the application was compiled in Dart with the '-Djaspr.flags.release=true' flag.
Since this is a const value, it can be used to indicate to the compiler that a particular block of code will not be executed in release mode, and hence can be removed.
Generally it is better to use kDebugMode or assert
to gate code, since
using kReleaseMode will introduce differences between release and profile
builds, which makes performance testing less representative.
See also:
- kDebugMode, which is true in debug builds.
Implementation
const bool kReleaseMode = bool.fromEnvironment('jaspr.flags.release');