# 🚀 Smart Lib Form Elements
**Pre-built form widgets that you can literally copy-paste into your Flutter project.**
---
## 💡 Why This Exists
Tired of writing 100 lines of code for a single form field?
**Problem solved.**
This library contains battle-tested widgets for:
- CheckBox ✅
- Calendar 📅
- Photo Upload 📸
- Radio Buttons 🔘
- Text Inputs 📝
- ...and more
**No need to reinvent the wheel.** Just import and use.
---
## 🧩 Widgets You Can Use TODAY
### 1. CheckBox Widget
```dart
FormElementCheckBox(
title: "I agree to terms",
onChanged: (value) => print("Checked: $value"),
errorText: "You must agree to continue",
)
2. Calendar Picker
FormElementCalendar(
labelText: "Select birthdate",
onDateSelected: (date) => print("Date picked: $date"),
errorText: "Date is required",
)
3. Photo Upload
FormElementPhoto(
onImageSelected: (file) => print("Image selected: $file"),
errorText: "Photo upload required",
)
4. Radio Group
FormElementRadio(
options: [
FormElement(data: "male", title: "Male"),
FormElement(data: "female", title: "Female")
],
onDataSelected: (value) => print("Selected: $value"),
)
5. Validated Text Input
SmartFormText(
labelText: "Email",
validator: (value) {
return value.contains("@") ? null : "Invalid email";
},
)
🛠️ Installation
dependencies:
smart_lib_form_elements: ^1.0.0
🛡️ Built-in Validation
All widgets have validation logic:
// Phone number validation
FormElementPhone(
errorText: "Invalid number format",
validator: (value) {
return RegExp(r'^\+[0-9]{9,19}$').hasMatch(value)
? null
: "Must include country code";
},
)
🚦 How To Use In 2 Minutes
- Add dependency to
pubspec.yaml - Import the library:
import 'package:smart_lib_form_elements/smart_lib_form_elements.dart';
- Use widgets in your form:
Column(
children: [
FormElementCheckBox(...),
FormElementCalendar(...),
// Add more widgets here
],
)
🙋 Need Help?
Vanik Dallakyan
GitHub | LinkedIn
Make form development fun again.
Install now and join the community! 🚀
Libraries
- core/utils/helper/gallery_image_helper
- core/widgets/smart_photo_widget
- form/base/smart_form_selector
- form/base/smart_form_text
- form/base/validation/smart_validator_text_form_field
- form/elements/form_element_calendar_widget
- form/elements/form_element_check_box_widget
- form/elements/form_element_phone_widget
- form/elements/form_element_photo_widget
- form/elements/form_element_radio_widget
- form/elements/form_element_text_widget
- form/form
- form/wrapper/form_element_wrapper