warning method

void warning(
  1. String message, {
  2. String? group,
  3. bool label = true,
  4. bool dryRun = false,
})

Implementation

void warning(
  String message, {
  String? group,
  bool label = true,
  bool dryRun = false,
}) {
  final labelColor =
      dryRun ? dryRunWarningLabelColor : dryRunWarningMessageColor;
  final messageColor =
      dryRun ? dryRunWarningMessageColor : warningMessageColor;

  if (group != null) {
    if (label) {
      _stdoutGroup('$warningLabel${labelColor(':')} $message', group);
    } else {
      _stdoutGroup(messageColor(message), group);
    }

    return;
  }

  if (label) {
    stdout('$warningLabel${labelColor(':')} $message');
  } else {
    stdout(messageColor(message));
  }
}