ErrorCode constructor

const ErrorCode(
  1. {String? correctionMessage,
  2. bool hasPublishedDocs = false,
  3. bool isUnresolvedIdentifier = false,
  4. required String name,
  5. @Deprecated('Please use problemMessage') String? message,
  6. String? problemMessage,
  7. required String uniqueName}
)

Initialize a newly created error code to have the given name. The message associated with the error will be created from the given problemMessage template. The correction associated with the error will be created from the given correctionMessage template.

Implementation

const ErrorCode({
  String? correctionMessage,
  this.hasPublishedDocs = false,
  this.isUnresolvedIdentifier: false,
  required this.name,
  @Deprecated('Please use problemMessage') String? message,
  String? problemMessage,
  required this.uniqueName,
})  : _correctionMessage = correctionMessage,
      _problemMessage = problemMessage ?? message ?? 'NO MESSAGE',
      // ignore: unnecessary_null_comparison
      assert(hasPublishedDocs != null),
      // ignore: unnecessary_null_comparison
      assert(isUnresolvedIdentifier != null),
      assert((message == null) != (problemMessage == null),
          'Either problemMessage or message must be provided (not both)');