A flexible and modular file management and form handling package for Flutter, supporting both Firestore and REST API-based storage systems along with comprehensive form field management. This package includes file operations, form state management using Cubits, and a collection of reusable form field widgets.
- Abstract interfaces for clean architecture
- Cubits for managing form states (e.g., image, switch, dropdown, text field)
- Complete set of reusable form field widgets
- Extensions for asset loading as
File
andUint8List
- Enum-based dropdown with icon and label support
Add the following to your pubspec.yaml
:
dependencies:
reusable_editor: <latest_version>
import 'package:reusable_editor/reusable_editor.dart';
Full usage guides available at: 👉 https://geniecodersrc.github.io/reusable_editor
// Create cubit for a field
final textFieldCubit = FieldCubit<String>(
initialValue: 'Default',
validator: RequiredValidator(),
);
// Use with AppTextField
AppTextField(cubit: textFieldCubit);
// Toggle field example
final toggleCubit = ToggleCubit(initialValue: false);
AppSwitch(cubit: toggleCubit);
AppCheckbox
- Checkbox with label and validationAppDatePicker
- Date selection fieldAppDropdown
- Custom dropdown fieldAppFilePicker
- File selection widgetAppRadioGroup
- Radio button groupAppRangeSlider
- Range slider inputAppSlider
- Slider inputAppSwitch
- Toggle switchAppTextField
- Text input fieldAppTimePicker
- Time selection field
enum FileSourceType { firebase, server }
final dropdown = EnumOptionDropDownMenuFormField<FileSourceType>(
selectedValue: selectedOption,
onChanged: (value) => print(value?.type),
hint: 'Select file source',
dropdownItems: [
EnumOptionEntity(type: FileSourceType.firebase, icon: Icons.cloud, label: 'Firebase'),
EnumOptionEntity(type: FileSourceType.server, icon: Icons.storage, label: 'Server'),
],
);
final file = await 'assets/image.png'.loadAsFile();
final bytes = await 'assets/image.png'.loadAssetImage();
FieldCubit<T>
- Generic form field management with validationToggleCubit
- Specialized cubit for boolean toggle fieldsDateTimeCubit
- Manages date selectionImageCrudCubit
- Handles image pick logic and validationEnumOptionCubit<T>
- Dropdown Selection with Generic enumSwitchCubit
- Toggle logicTextFieldCubit
- Text field validation
Feel free to open issues or pull requests.
© MIT License. Developed with ❤️ by Shohidul Islam