DiagnosticsNode constructor Null safety

DiagnosticsNode(
  1. {required String? name,
  2. DiagnosticsTreeStyle? style,
  3. bool showName,
  4. bool showSeparator,
  5. String? linePrefix}
)

Initializes the object.

The style, showName, and showSeparator arguments must not be null.

Implementation

DiagnosticsNode({
  required this.name,
  this.style,
  this.showName = true,
  this.showSeparator = true,
  this.linePrefix,
}) : assert(showName != null),
     assert(showSeparator != null),
     // A name ending with ':' indicates that the user forgot that the ':' will
     // be automatically added for them when generating descriptions of the
     // property.
     assert(
       name == null || !name.endsWith(':'),
       'Names of diagnostic nodes must not end with colons.\n'
       'name:\n'
       '  "$name"',
     );