WizardQuestion<T> class
Abstract representation of a wizard question.
Constructors
-
WizardQuestion({required String id, required String prompt, required WizardQuestionType type, String? helpText, T? defaultValue, List<
WizardOption> options = const [], Validator<T> ? validator, ValidationResult customValidate(T value)?, bool condition(WizardContext context)?, dynamic valueGetter(WizardContext context)?, void valueSetter(WizardContext context, dynamic value)?}) -
Creates a WizardQuestion instance.
const
Properties
- condition → bool Function(WizardContext context)?
-
Predicate determining whether this question is visible based on WizardContext.
final
- customValidate → ValidationResult Function(T value)?
-
Custom inline validation function.
final
- defaultValue → T?
-
Default value if user enters empty input.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- helpText → String?
-
Optional help text or explanation.
final
- id → String
-
Unique identifier key for storing/retrieving the answer.
final
-
options
→ List<
WizardOption> -
List of selectable options (for singleSelect and multiSelect).
final
- prompt → String
-
The prompt question text displayed to the user.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → WizardQuestionType
-
The type of input expected.
final
-
validator
→ Validator<
T> ? -
Custom validator or core Validator used to validate the input value.
final
- valueGetter → dynamic Function(WizardContext context)?
-
Function to extract initial value from existing WizardContext.
final
- valueSetter → void Function(WizardContext context, dynamic value)?
-
Function to apply user answer back into WizardContext.
final
Methods
-
isVisible(
WizardContext context) → bool -
Determines if this question should be asked given
context. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
validateInput(
T input) → ValidationResult -
Validates
inputusing validator or customValidate.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited