requiredString property

String get requiredString

Returns a String that can always be prepended to the parameter name. Depending on the kind, this is either an empty String, or the required keyword. Returns the parameter name parameter kinds mapped to positional arguments in Dart.

Implementation

String get requiredString {
  switch (kind) {
    case ParameterKind.positional_only:
    case ParameterKind.var_positional:
    case ParameterKind.var_keyword:
      return name;
    case ParameterKind.positional_or_keyword:
    case ParameterKind.keyword_only:
      return default_ == empty ? "required" : "";
  }
}