SurveyStep<T> class
Model for a survey step, which could be a question or an informational screen.
Constructors
-
SurveyStep({required String id, required String title, String? description, required SurveyStepType stepType, List<
SurveyOption> ? options, T? answer, bool isRequired = true, Future<void> beforeComplete(dynamic answer)?, void onCompleted(dynamic answer)?, Future<void> onInit(SurveyStep<T> ? step)?, Widget customWidget(BuildContext context, SurveyStep<T> step)?}) -
SurveyStep.custom({required String id, required String title, String? description, T? answer, bool isRequired = true, Future<
void> beforeComplete(dynamic answer)?, void onCompleted(dynamic answer)?, Future<void> onInit(SurveyStep<T> ? step)?, Widget customWidget(BuildContext context, SurveyStep<T> step)?}) - Constructor for creating a custom survey step.
-
SurveyStep.datePicker({required String id, required String title, String? description, T? answer, bool isRequired = true, Future<
void> beforeComplete(dynamic answer)?, void onCompleted(dynamic answer)?, Future<void> onInit(SurveyStep<T> ? step)?, Widget customWidget(BuildContext context, SurveyStep<T> step)?}) - Constructor for creating a date picker survey step.
-
SurveyStep.multipleChoiceMultiSelect({required String id, required String title, String? description, required List<
SurveyOption> options, T? answer, bool isRequired = true, Future<void> beforeComplete(dynamic answer)?, void onCompleted(dynamic answer)?, Future<void> onInit(SurveyStep<T> ? step)?, Widget customWidget(BuildContext context, SurveyStep<T> step)?}) - Constructor for creating a multiple choice multi select survey step.
-
SurveyStep.multipleChoiceSingleSelect({required String id, required String title, String? description, required List<
SurveyOption> options, T? answer, bool isRequired = true, Future<void> beforeComplete(dynamic answer)?, void onCompleted(dynamic answer)?, Future<void> onInit(SurveyStep<T> ? step)?, Widget customWidget(BuildContext context, SurveyStep<T> step)?}) - Constructor for creating a multiple choice single select survey step.
-
SurveyStep.notification({required String id, required String title, String? description, T? answer, bool isRequired = true, Future<
void> beforeComplete(dynamic answer)?, void onCompleted(dynamic answer)?, Future<void> onInit(SurveyStep<T> ? step)?, Widget customWidget(BuildContext context, SurveyStep<T> step)?}) - Constructor for creating a notification survey step.
-
SurveyStep.preparation({required String id, required String title, String? description, List<
SurveyOption> ? options, T? answer, bool isRequired = true, Future<void> beforeComplete(dynamic answer)?, void onCompleted(dynamic answer)?, Future<void> onInit(SurveyStep<T> ? step)?, Widget customWidget(BuildContext context, SurveyStep<T> step)?}) - Constructor for creating a preparation survey step.
-
SurveyStep.rating({required String id, required String title, String? description, T? answer, bool isRequired = true, Future<
void> beforeComplete(dynamic answer)?, void onCompleted(dynamic answer)?, Future<void> onInit(SurveyStep<T> ? step)?, Widget customWidget(BuildContext context, SurveyStep<T> step)?}) - Constructor for creating a rating survey step.
-
SurveyStep.slider({required String id, required String title, String? description, T? answer, bool isRequired = true, Future<
void> beforeComplete(dynamic answer)?, void onCompleted(dynamic answer)?, Future<void> onInit(SurveyStep<T> ? step)?, Widget customWidget(BuildContext context, SurveyStep<T> step)?}) - Constructor for creating a slider survey step.
-
SurveyStep.successScreen({required String id, required String title, String? description, T? answer, bool isRequired = true, Future<
void> beforeComplete(dynamic answer)?, void onCompleted(dynamic answer)?, Future<void> onInit(SurveyStep<T> ? step)?, Widget customWidget(BuildContext context, SurveyStep<T> step)?}) - Constructor for creating a success screen survey step.
-
SurveyStep.timePicker({required String id, required String title, String? description, T? answer, bool isRequired = true, Future<
void> beforeComplete(dynamic answer)?, void onCompleted(dynamic answer)?, Future<void> onInit(SurveyStep<T> ? step)?, Widget customWidget(BuildContext context, SurveyStep<T> step)?}) - Constructor for creating a time picker survey step.
-
SurveyStep.toggleSwitch({required String id, required String title, String? description, T? answer, bool isRequired = true, Future<
void> beforeComplete(dynamic answer)?, void onCompleted(dynamic answer)?, Future<void> onInit(SurveyStep<T> ? step)?, Widget customWidget(BuildContext context, SurveyStep<T> step)?}) - Constructor for creating a toggle switch survey step.
-
SurveyStep.yesNo({required String id, required String title, String? description, List<
SurveyOption> ? options, T? answer, bool isRequired = true, Future<void> beforeComplete(dynamic answer)?, void onCompleted(dynamic answer)?, Future<void> onInit(SurveyStep<T> ? step)?, Widget customWidget(BuildContext context, SurveyStep<T> step)?}) - Constructor for creating a yes/no survey step.
Properties
- answer ↔ T?
-
getter/setter pair
-
beforeComplete
→ Future<
void> Function(dynamic answer)? -
Callback before the step is completed, can be used for async operations.
final
-
customWidget
→ Widget Function(BuildContext context, SurveyStep<
T> step)? -
final
- description → String?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
final
- isLoading ↔ bool
-
getter/setter pair
- isRequired → bool
-
final
- onCompleted → void Function(dynamic answer)?
-
Callback when the step is completed.
final
-
onInit
→ Future<
void> Function(SurveyStep<T> ? step)? -
final
-
options
↔ List<
SurveyOption> ? -
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stepType → SurveyStepType
-
final
- title → String
-
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited