zAssertsEnabled top-level property

bool zAssertsEnabled
final

Whether asserts are enabled.

This differs from zDebugMode in that it's not enabled in dart2js unless explicitly done so with the --enable-asserts flag but otherwise requires that no extra flags be passed to build commands (which may be helpful in pure Dart applications).

Implementation

final bool zAssertsEnabled = () {
  var assertsEnabled = false;
  // ignore: prefer_asserts_with_message
  assert(
    () {
      assertsEnabled = true;
      return true;
    }(),
  );
  return assertsEnabled;
}();