FormStack class
FormStack - Comprehensive Library for Creating Dynamic Form
FormStack is a library designed to help developers create dynamic user interfaces in Flutter. Specifically, the library is focused on creating forms and surveys using a JSON or Dart language model.
The primary goal of FormStack is to make it easy for developers to create dynamic UIs without having to write a lot of code. By using a JSON or Dart model to define the structure of a form or survey, developers can quickly create UIs that are easy to customize and update.
While the library was initially created to help developers create survey UIs, the focus has expanded to include any type of dynamic application UI. With FormStack, developers can create UIs that are responsive and adaptable to different devices and screen sizes.
Overall, FormStack is a powerful tool for creating dynamic user interfaces in Flutter. It offers a flexible and customizable approach to UI design, allowing developers to create UIs that are easy to use and maintain.
await FormStack.api().loadFromAsset('assets/app.json');
class SampleScreen extends StatelessWidget {
const SampleScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: FormStack.api().render(),
);
}
}
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- instanceName ↔ String
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
addCompletionCallback(
Identifier identifier, {String? formName = "default", dynamic onFinish(Map< String, dynamic> )?, OnBeforeFinishCallback? onBeforeFinishCallback}) → FormStack - Add the completion handler to add you logic when the form finish
-
addOnValidationError(
Identifier identifier, dynamic onValidationError(String)?, {String? formName = "default"}) → FormStack - Add validation error listener
-
addResultForm(
Identifier identifier, ResultFormat? resultFormat, {String? formName = "default"}) → FormStack -
buildFormFromJson(
Map< String, dynamic> ? body, {MapKey? mapKey, LocationWrapper? initialLocation}) → Future<FormStack> - Build the from from Map (JSON)
-
buildFormFromJsonString(
String data, {MapKey? mapKey, LocationWrapper? initialLocation}) → Future< FormStack> - Build the form from the JSON content
-
form(
{String name = "default", required MapKey mapKey, required LocationWrapper initialLocation, String? backgroundAnimationFile, Alignment? backgroundAlignment, required List< FormStep> steps}) → FormStack - Load the form from dart language model
-
loadFromAsset(
String path, {MapKey? mapKey, LocationWrapper? initialLocation}) → Future< FormStack> - Load single json file from assets folder
-
loadFromAssets(
List< String> files, {MapKey? mapKey, LocationWrapper? initialLocation}) → Future<FormStack> - Import and parse multiple JSON files located in the assets folder.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
render(
{String name = "default"}) → Widget - Render the form to the UI Primary method to implement in you Widget tree.
-
setDisabledUI(
List< String> disabledUIIds, {String? formName = "default"}) → FormStack - Disbale UI
-
setError(
Identifier identifier, String message, {String? formName = "default"}) → FormStack - Add the Error
-
setOptions(
List< Options> options, GenericIdentifier identifier, {String? formName = "default"}) → FormStack - Add the Result
-
setResult(
Map< String, dynamic> input, {String? formName = "default"}) → FormStack - Add the Result
- Prevent System back navigation or getting call back when the user click the system back button.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
api(
{String name = "default"}) → FormStack - Create the instnce for the app name - instance name.
-
clearConfiguration(
) → void - Clear your instant. Are you sure to use this.
-
clearForms(
{String name = "default"}) → void - Clear forms from instance name .
-
formByInstaceAndName(
{String name = "default", String formName = "default"}) → FormStackForm? - Get the purticular from from different instance.