Param class

Represents a parameter for a command with type information and validation.

Constructors

Param({required String name, String? flags, String? description, String? defaultValue, String? type, List<String>? values, bool isTypeExplicit = false})
const

Properties

booleanDefault → bool
Returns the default value as a boolean
no setter
defaultValue → String?
final
description → String?
final
displayValues → List<String>
Returns the display values for this enum parameter (without quotes)
no setter
flags → String?
final
hashCode → int
The hash code for this object.
no setterinherited
isBoolean → bool
Returns true if this parameter is a boolean type
no setter
isEnum → bool
Returns true if this parameter is an enum (has a list of allowed values)
no setter
isTypeExplicit → bool
Whether the type was explicitly specified in YAML (true) or inferred (false)
final
name → String
final
requiresBooleanPicker → bool
Returns true if this parameter requires a boolean picker
no setter
requiresEnumPicker → bool
Returns true if this enum parameter requires an interactive picker
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
type → String?
The type of the parameter: 'boolean', 'string', 'int', 'double' If null, defaults to 'string'
final
values → List<String>?
List of allowed values for enum parameters If non-empty, the parameter is treated as an enum
final

Methods

isValidValue(String value) → bool
Validates if the given value is allowed for this parameter
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parseValue(String rawValue) → dynamic
Parses a raw string value according to the parameter's type
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited