form method

FormStack form({
  1. String name = "default",
  2. required MapKey mapKey,
  3. required LocationWrapper initialLocation,
  4. String? backgroundAnimationFile,
  5. Alignment? backgroundAlignment,
  6. required List<FormStep> steps,
})

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;
}