isStructuredErrorsEnabled method Null safety

bool isStructuredErrorsEnabled()

Whether structured errors are enabled.

Structured errors provide semantic information that can be used by IDEs to enhance the display of errors with rich formatting.

Implementation

bool isStructuredErrorsEnabled() {
  // This is a debug mode only feature and will default to false for
  // profile mode.
  bool enabled = false;
  assert(() {
    // TODO(kenz): add support for structured errors on the web.
    enabled = const bool.fromEnvironment('flutter.inspector.structuredErrors', defaultValue: !kIsWeb);
    return true;
  }());
  return enabled;
}