customNatureError function

String? customNatureError(
  1. String nature
)

Null when nature is a valid custom nature: it matches customNaturePattern and is no nature buildkit detects itself (detectedNatureNames); else why not.

Implementation

String? customNatureError(String nature) {
  if (!customNaturePattern.hasMatch(nature)) {
    return '`$nature` breaks the pattern ^[a-z][a-z0-9-]*\$';
  }
  if (detectedNatureNames.contains(nature)) {
    return '`$nature` is a nature buildkit detects itself';
  }
  return null;
}