json_form_builder 0.0.3

A Flutter package for building dynamic forms from JSON data with multi-language support.

Flutter Dynamic Form Builder

This package allows you to use form templates created with jQuery formBuilder in Flutter applications. It converts JSON format form data into Flutter widgets.

Buy Me A Coffee ;)

## Features

✅ Dynamic form creation from JSON data ✅ Form validation ✅ Customizable theme support ✅ 12+ form elements support:

  • Text Field
  • Textarea
  • Select (Dropdown)
  • Radio Group
  • Checkbox Group
  • Autocomplete
  • Date Picker
  • Number Input
  • File Upload
  • Button
  • Header
  • Paragraph
  • Hidden Field

Getting Started

  1. Add the package to your project:
dependencies:
  json_form_builder: ^0.0.2
  1. Import the package:
import 'package:json_form_builder/json_form_builder.dart';

Usage

You can directly use the JSON data from jQuery formBuilder:

// JSON data from formBuilder.io
final formData = [
  {
    "type": "text",
    "required": true,
    "label": "Full Name",
    "name": "fullname",
    "placeholder": "Enter your full name"
  },
  {
    "type": "email",
    "required": true,
    "label": "Email",
    "name": "email",
    "placeholder": "Enter your email address"
  }
];

// Form widget
json_form_builder(
  formData: formData,
  locale: const Locale('tr'),//tr, en(default), ru, fr, it, az, ar, pt
  onSubmit: (values) {
    print(values); // Print form values
  },
)

For more examples, check the example directory.

Customization

You can use the theme parameter to customize the form appearance:

json_form_builder(
  formData: formData,
  locale: const Locale('tr'),//tr, en(default), ru, fr, it, az, ar, pt
  theme: FormBuilderTheme(
    inputDecoration: InputDecoration(
      border: OutlineInputBorder(),
      filled: true,
    ),
    spacing: 16.0,
    padding: EdgeInsets.all(16.0),
  ),
  onSubmit: (values) {
    // Form operations
  },
)

Additional Information

  • You can use JSON data obtained from FormBuilder.io.

Supported Languages

  • English (en)
  • Turkish (tr)
  • Russian (ru)
  • French (fr)
  • Italian (it)
  • Azerbaijani (az)
  • Arabic (ar)
  • Portuguese (pt)

Supported Form Elements

Element TypeProperties
Text Fieldvalidation, placeholder, required
Textarearows, maxLength, required
Selectmultiple, options, required
Radio Groupinline, options, other
Checkbox Groupinline, options, toggle
Autocompleteoptions, required
Date Pickermin, max, format
Number Inputmin, max, step
File Uploadmultiple, accept
Buttonstyle, onClick
Headersize (h1-h6)
Paragraphtext
Hiddenvalue

Contributing

  1. Fork the project
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'feat: Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT License - details can be found in the LICENSE file.

Contact

Version History

  • 0.0.1
    • Initial release
    • Basic form elements support
    • Form validation
    • Theme customization
  • 0.0.2
    • Multi-language support
    • Form overflow issue
    • Improved form validation
    • New form elements
  • 0.0.3
    • Added color picker support