isRunningInDebugMode top-level constant

bool const isRunningInDebugMode

Tells whether the code is running in debug mode (assertions enabled).

If the value is false, one of the following may be true:

Example

import 'package:os/os.dart';

void doSomething() {
  if (isRunningInDebugMode) {
    // ...
  } else {
    // ...
  }
}

See also

Implementation

const bool isRunningInDebugMode =
    !isRunningInReleaseMode && !isRunningInProfileMode;