form_template 0.0.2 copy "form_template: ^0.0.2" to clipboard
form_template: ^0.0.2 copied to clipboard

A common structured place to generate useful form template parts!

🧱 FormBuilder #

FormBuilder is a simple and extensible Flutter package that allows you to build dynamic, customizable forms with minimal code. It supports a wide range of input field types like text, dropdown, checkbox, date picker, time picker, and more — all defined using simple configuration objects.


✨ Features #

  • ✅ Easily create forms with different field types
  • 🧩 Modular field configuration (TextField, Dropdown, Checkbox, DatePicker, etc.)
  • 📅 Date and time pickers included
  • 🔄 Custom onSubmit callback with all form data
  • 📐 Responsive and accessible form layout
  • 🛠️ Easily extendable for custom fields

🚀 Getting Started #

Add the package to your pubspec.yaml:


📦 Usage #

FormBuilder(
        fields: [
          TextFieldConfig(
            key: "name",
            label: "FULL NAME*",
            isRequired: true,
          ),
          TextFieldConfig(
            key: "email",
            label: "EMAIL*",
            isRequired: true,
          ),
          DropdownConfig(
            key: "department",
            label: "DEPARTMENT",
            options: [
              OptionItem(label: "IT", value: "it"),
              OptionItem(label: "ADMIN", value: "admin"),
              OptionItem(label: "HR", value: "hr"),
            ],
          ),
          CheckboxConfig(
            key: "eligible",
            label: "ELIGIBLE?",
          ),
          DatePickerConfig(
            key: "birthdate",
            label: "DATE OF BIRTH",
            enableFutureDates: false,
          ),
          TimePickerConfig(
            key: "preferred_time",
            label: "MEETING TIME",
          ),
          TextAreaConfig(
            key: "message",
            label: "MESSAGE",
            maxLines: 5,
          ),
        ],
        onSubmit: (formData) {
          print("Form submitted: $formData");
          ScaffoldMessenger.of(context).showSnackBar(
            SnackBar(
              content: Text("Form submitted successfully!"),
              backgroundColor: Colors.green,
            ),
          );
       },
      )

1
likes
130
points
32
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A common structured place to generate useful form template parts!

License

MIT (license)

Dependencies

cupertino_icons, flutter

More

Packages that depend on form_template