fjbatresv / flutter_smart_forms_demo

Demo Flutter application for the concepto of smart Forms.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Smart Forms

The idea of this project is build forms using entitys.

In this case the project use Firestore like database from where is obtained the forms with the necessary parameters for the dynamic build.

You can find in the main.dart a simple request using Stream for the list of smart_forms obtained fomr the Firestore Collection.

The data of this documents is the next:

{
    "name": "<Form Name>",
    "button": "<Label to show on submit button>",
    "fields": [
        {
            "label": "<Label to show>",
            "error_message": "<The error message to show in case is necessary>",
            "required": true || false,
            "type": "<Type of field from the options>"
        }
    ]
}

Field Types

The first types added to the builder are:

  • text
  • multiline
  • email
  • number
  • phone
  • url

Inside the builder exist a regex validator for each field of type.

Pieces

The logic between the builder is separated using the files:

Makes the decision of form and render all the files with the necessary EditingControllers.

This build only a field of the form with the requested feauture by type, the focus and more.

Implementation

For implementation with Firebase you need to make the process for each platform:

About

Demo Flutter application for the concepto of smart Forms.

License:MIT License


Languages

Language:Dart 84.7%Language:HTML 11.4%Language:Swift 2.8%Language:Kotlin 0.9%Language:Objective-C 0.3%