zeba_academy_smart_forms 1.0.0
zeba_academy_smart_forms: ^1.0.0 copied to clipboard
JSON-driven smart form engine with validation, multi-step support, custom widgets and auto serialization.
zeba_academy_smart_forms #
A production-ready Flutter dynamic form engine that builds forms from JSON with validation, multi-step support, custom widgets, and automatic form serialization.
Designed for EdTech apps, enterprise apps, surveys, onboarding flows, and admin dashboards.
✨ Features #
- JSON‑driven dynamic forms
- Built‑in field validation
- Multi‑step form support
- Custom input widgets
- Automatic form serialization
- Error highlighting
- Clean architecture
- Lightweight and fast
📦 Installation #
Add the package to your pubspec.yaml:
dependencies:
zeba_academy_smart_forms: ^1.0.0
Then run:
flutter pub get
🚀 Quick Start #
import 'package:flutter/material.dart';
import 'package:zeba_academy_smart_forms/zeba_academy_smart_forms.dart';
final fields = [
FormFieldModel(
name: "name",
label: "Full Name",
type: "text",
required: true,
),
FormFieldModel(
name: "email",
label: "Email",
type: "text",
),
FormFieldModel(
name: "course",
label: "Course",
type: "dropdown",
options: ["Flutter", "AI", "Data Science"],
),
];
SmartFormWidget(
fields: fields,
onSubmit: (data) {
print(data);
},
)
🧩 JSON Form Example #
Forms can also be created using JSON.
[
{
"name": "name",
"label": "Full Name",
"type": "text",
"required": true
},
{
"name": "email",
"label": "Email",
"type": "text"
},
{
"name": "course",
"label": "Course",
"type": "dropdown",
"options": ["Flutter", "AI", "Data Science"]
}
]
Convert JSON into form models:
final fields = jsonData
.map((e) => FormFieldModel.fromJson(e))
.toList();
🧱 Supported Field Types #
Current built‑in fields:
- Text field
- Dropdown
Planned field types:
- Email field
- Password field
- Date picker
- Checkbox
- Radio buttons
- Slider
- File upload
🛡 Validation #
Built‑in validators include:
- Required fields
- Email validation
Example:
validator: Validators.required
🔄 Form Serialization #
Form data can be automatically converted into a JSON‑like map.
Example output:
{
"name": "John",
"email": "john@email.com",
"course": "Flutter"
}
📸 Screenshots #
| Dynamic Smart Form |
|---|
| [Smart Form] |
📁 Project Structure #
lib
├── zeba_academy_smart_forms.dart
└── src
├── models
│ └── form_field_model.dart
├── widgets
│ └── smart_form_widget.dart
├── validation
│ └── validators.dart
└── engine
└── form_serializer.dart
💡 Use Cases #
- EdTech registration forms
- Survey forms
- Onboarding forms
- Admin panel tools
- Dynamic backend‑driven forms
🧪 Testing #
Run tests using:
flutter test
🤝 Contributing #
Contributions are welcome.
- Fork the repository
- Create a feature branch
- Submit a pull request
📄 License #
This project is licensed under the GNU General Public License v3.0.
👨💻 Author #
Developed by Zeba Academy.
Website: https://zeba.academy/flutter/
