kDebugMode property
Detect debug mode using assertions (only run in debug mode). This mirrors Flutter's kDebugMode but works in pure Dart.
Implementation
static final bool kDebugMode = () {
bool isDebug = false;
assert(() {
isDebug = true;
return true;
}());
return isDebug;
}();