buildView method
Implementation
@override
FormStepView buildView(FormStackForm formKitForm) {
formKitForm.onValidtionError = onValidationError;
formKitForm.onFinish = onFinish;
switch (inputType) {
case InputType.email:
resultFormat =
resultFormat ?? ResultFormat.email("Please enter a valid email.");
return TextFeildWidgetView.email(
this, formKitForm, text, resultFormat!, title);
case InputType.name:
resultFormat =
resultFormat ?? ResultFormat.name("Please enter a valid name.");
return TextFeildWidgetView.name(
this, formKitForm, text, resultFormat!, title);
case InputType.file:
resultFormat =
resultFormat ?? ResultFormat.notNull("Please select a file.");
return TextFeildWidgetView.file(
this, formKitForm, text, resultFormat!, title, filter);
case InputType.password:
resultFormat = resultFormat ??
ResultFormat.password("Please enter a valid password.");
return TextFeildWidgetView.password(
this, formKitForm, text, resultFormat!, title);
case InputType.text:
resultFormat =
resultFormat ?? ResultFormat.notBlank("Please enter a valid data.");
return TextFeildWidgetView.text(
this, formKitForm, text, resultFormat!, title, numberOfLines);
case InputType.number:
resultFormat =
resultFormat ?? ResultFormat.number("Please enter a valid number.");
return TextFeildWidgetView.number(
this, formKitForm, text, resultFormat!, title);
case InputType.date:
resultFormat = resultFormat ??
ResultFormat.date("Please enter a valid date.", "dd-MM-yyyy");
return DateInputWidget.date(
this, formKitForm, text, resultFormat!, title);
case InputType.time:
resultFormat = resultFormat ??
ResultFormat.date("Please enter a valid time.", "HH:mm:ss");
return DateInputWidget.time(
this, formKitForm, text, resultFormat!, title);
case InputType.dateTime:
resultFormat = resultFormat ??
ResultFormat.date(
"Please enter a valid date.", "yyyy-MM-dd'T'HH:mm");
return DateInputWidget.dateTime(
this, formKitForm, text, resultFormat!, title);
case InputType.smile:
resultFormat = resultFormat ?? ResultFormat.smile("Please select.");
return SmileInputWidget.smile(
this, formKitForm, text, resultFormat!, title);
case InputType.singleChoice:
resultFormat =
resultFormat ?? ResultFormat.singleChoice("Please select any.");
return ChoiceInputWidget.single(
this,
formKitForm,
text,
resultFormat!,
title,
options,
selectionType ?? SelectionType.arrow,
autoTrigger ?? false);
case InputType.dropdown:
resultFormat =
resultFormat ?? ResultFormat.singleChoice("Please select any.");
return ChoiceInputWidget.dropdown(this, formKitForm, text,
resultFormat!, title, options, autoTrigger ?? false);
case InputType.multipleChoice:
resultFormat =
resultFormat ?? ResultFormat.multipleChoice("Please select any.");
return ChoiceInputWidget.multiple(this, formKitForm, text,
resultFormat!, title, selectionType ?? SelectionType.tick, options);
case InputType.otp:
resultFormat = resultFormat ??
ResultFormat.length("Please enter all fields", count);
return CommonInputWidget.otp(
this, formKitForm, text, resultFormat!, title, count);
case InputType.dynamicKeyValue:
resultFormat =
resultFormat ?? ResultFormat.notEmpty("Please add any one");
return CommonInputWidget.dynamicKeyValueField(
this, formKitForm, text, resultFormat!, title, maxCount);
case InputType.htmlEditor:
resultFormat =
resultFormat ?? ResultFormat.notNull("Please enter any.");
return CommonInputWidget.htmlWidget(
this, formKitForm, text, resultFormat!, title);
case InputType.mapLocation:
resultFormat =
resultFormat ?? ResultFormat.notNull("Please enter any.");
return CommonInputWidget.map(
this, formKitForm, text, resultFormat!, title, maxHeight ?? 600);
case InputType.avatar:
resultFormat =
resultFormat ?? ResultFormat.notNull("Please update image.");
return CommonInputWidget.avatar(
this, formKitForm, text, resultFormat!, title);
case InputType.banner:
resultFormat =
resultFormat ?? ResultFormat.notNull("Please update image.");
return CommonInputWidget.banner(
this, formKitForm, text, resultFormat!, title);
default:
}
throw UnimplementedError();
}