form method
Load the form from dart language model
FormStack.api().form(steps: [
InstructionStep(
id: GenericIdentifier(id: "IS_STARTED"),
title: "Example Survey",
text: "Simple survey example using dart model",
cancellable: false),
QuestionStep(
title: "Name",
text: "Your name",
inputType: InputType.name,
id: GenericIdentifier(id: "NAME"),
)
CompletionStep(
id: GenericIdentifier(id: "IS_COMPLETED"),
title: "Survey Completed",
text: "ENd Of ",
onFinish: (result) {
debugPrint("Completed With Result : $result");
},
),
]);
Implementation
FormStack form(
{String name = "default",
required MapKey mapKey,
required LocationWrapper initialLocation,
String? backgroundAnimationFile,
Alignment? backgroundAlignment,
required List<FormStep> steps}) {
var list = LinkedList<FormStep>();
list.addAll(steps);
FormWizard form = FormWizard(list,
mapKey: mapKey,
fromInstanceName: instanceName,
backgroundAlignment: backgroundAlignment,
backgroundAnimationFile: backgroundAnimationFile,
initialLocation: initialLocation);
_forms.putIfAbsent(name, () => form);
return this;
}