reusable_editor 1.2.9
reusable_editor: ^1.2.9 copied to clipboard
A modular form and file editor package for Flutter with support for Form widgets. Includes Cubit-based state management, form field validation, and UI input widgets.
Changelog #
All notable changes to this project will be documented in this file.
1.2.9 #
Sep 11, 2025 #
π Fixed #
- Error state now updates correctly after valid input in
TextFieldCubit. - Added
ImageFieldValidatortypedef for consistency with TextFieldValidator. ImageFieldCubitaccepts an optional validator, defaults tovalidateImageFile.ImageFieldStatestores thevalidator, so validation logic stays consistent.clear()preserves thevalidator.
1.2.7 #
1.2.3 #
Sep 7, 2025 #
β¨ Updated #
- Improved
AssetImageToFileextension - Improved
AssetToXFileExtensionextension - Added XFile Image Validation Extension
β¨ Removed #
- Removed
BaseBlocAnd place it in the submission_state package. - Removed
BaseStateAnd place it in the submission_state package. - Removed
FormSubmissionStateAnd place it in the submission_state package.
1.2.2 #
1.2.0 #
1.1.8 #
1.1.7 #
1.1.6 #
1.1.5 #
1.1.4 #
July 26, 2025 #
β Created
- Usages
ImageFieldStatein theImageFieldCubit.
-
base_bloc.dart: Introduced a foundational abstract class for all BLoCs. This class enforces the use of a common state that extendsBaseState, encouraging consistency and reusability across all business logic components. -
base_state.dart: Defined an abstract base state that all Cubit or Bloc states should extend. It encapsulates aFormSubmissionStatusto track form states (e.g., loading, success, failure), aligning with the Single Responsibility Principle. -
form_submission_status.dart: Added sealed classes to represent the different statuses of form submission: initial, submitting, success, and failed. These classes ensure clear and maintainable handling of form-related logic, and provide extensibility for future states. -
loading_cubit.dart: Implemented a dedicatedCubitto manage general-purpose loading states across the app. This promotes separation of concerns by delegating loading logic to its own class. -
loading_state.dart: Introduced a strongly-typed state system forLoadingCubit, includingLoadingInitial,LoadingInProgress, andLoadingError. This supports more expressive and testable UI loading feedback.
These additions were created following SOLID principles and ensure a clean architecture approach for scalable and maintainable Flutter applications.
1.1.0 #
July 22, 2025 #
β»οΈ Refactored
- Added
formFieldValidatorgetter toFieldCubit<T>to provide a reusable Flutter form validator callback without duplicating validation logic.
1.0.9 #
July 22, 2025 #
β Added #
String?.loadAsXFile()for converting asset paths toXFile
β Refactored #
SwitchCubithas been completely replaced byToggleCubit, which extendsFieldCubit<bool>.- Offers cleaner implementation using
.toggle(),.enable(),.disable(). - Leverages
FieldCubitvalidation and reset mechanics. - More reusable and aligns with all other form field cubits.
- Offers cleaner implementation using
β¨ Enhanced #
- Updated example usage in
main.dartto demonstrate:- Modern
ToggleCubitinstead ofSwitchCubit. - Unified form field cubit usage.
validate()pattern on allFieldCubit<T>instances.- Usage of
EnumOptionDropDownMenuFormField,AppCheckbox,AppTextField,AppDatePicker, etc.
- Modern
1.0.8 #
1.0.7 #
1.0.6 #
Jul 16, 2025 #
β¨ Enhanced #
-
Introduced
FieldCubit<T>andFieldState<T>:- Generic, reusable Cubit for form input fields.
- Tracks current value and error message.
- Includes
.update(value),.clear(), and.reset()methods.
β Refactored #
-
DateTimeCubit,TextFieldCubit, andSwitchCubitupdated to:- Respect user-provided initial values.
- Improved state updates and structure.
- Used common structure aligning with
FieldCubit<T>.
1.0.5 #
Jul 6, 2025 #
π§Ή Refactored #
- Removed
ImagePickerCubitregistration and BlocProvider setup fromreusable_editor. - Decoupled image picking functionality:
reusable_editorno longer handles or depends on image picking, cropping, or compressing logic.- All related logic has been moved to the independent package
reusable_image_widget.
π Migration Note #
If you were using ImagePickerCubit or image-related widgets in reusable_editor, you must now:
- Add the
reusable_image_widgetpackage to your project. - Register its dependencies using
registerReusableImageWidgetDependencies(). - Include
ImagePickerCubitin your widget tree usingreusableImageWidgetBlocProviders.
β
This makes reusable_editor cleaner, more modular, and focused strictly on form field editors and reusable input
Cubits.
1.0.4 #
1.0.3 #
1.0.2 #
1.0.1 #
Jul 3, 2025 #
π Documentation #
-
Added GitHub Pages-based documentation under the
doc/folder:WIDGET_USAGE.mdβ widget usage examplesCUBIT_USAGE.mdβ usage of FieldCubit, ToggleCubit, etc.FIELD_TYPE_USAGE.mdβ usage patterns forFieldCubit<T>with various types- Setup
index.mdas the documentation landing page - Linked documentation from README
1.0.0 #
Jul 3, 2025 #
π Added #
-
New Input Widgets using
FieldCubit<T>(renamed to App-prefixed)AppTextFieldβ for text input with validationAppCheckboxβ checkbox input with error textAppDropdown<T>β generic dropdown fieldAppSwitchβ switch toggle inputAppRadioGroup<T>β radio button group inputAppSliderβ numeric slider inputAppRangeSliderβ range slider input with min/maxAppDatePickerβ date picker fieldAppTimePickerβ time picker fieldAppFilePickerβ file picker usingfile_pickerpackage
β Renamed #
selection_cubit.dartβenum_option_cubit.dartselection_state.dartβenum_option_state.dart
π§± Cubits #
ToggleCubitadded for boolean toggle handling usingFieldCubit<bool>FieldCubit<T>added as a generic form state cubit with validation support
π¨ Styles #
- Text field and error styles use centralized
AppFormTextStyles - Input decoration elements follow
InputDecorationStylesfor consistent field UI (e.g., border, padding, label styles)
0.0.6+2 #
- Export Bloc Provider.
- Export GetIt DI.
0.0.6+1 #
- Added DateTimeCubit Bloc Provider.
- Registered DateTimeCubit GetIt DI.
0.0.6 #
- Implemented Bloc Provider.
- Implemented GetIt DI.
- Removed fileRegisterGetItDiRestApiDataSource.
0.0.5 #
- Added fileRegisterGetItDiRestApiDataSource,
0.0.4 #
- Added Register Input Field Get It Di,
0.0.3 #
Updated #
-
Refactored SwitchCubit:
- Now uses a typed SwitchState model instead of a raw bool.
- Introduced debug logging in onChanged and clearSwitch for easier tracing.
- Improved structure following SOLID principles.
-
Added
- clearSwitch() method to SwitchCubit for resetting the switch state to default (true).
0.0.2 #
Added #
-
Support for uploading and deleting files via Firestore or REST API.
-
FileEntityandFileResponseEntitymodels. -
Enum-based dropdown form field (
EnumOptionDropDownMenuFormField). -
Cubits for managing UI state:
DateTimeCubitImageCrudCubitSelectionCubitSwitchCubitTextFieldCubit
-
Utility extensions:
String?.loadAsFile()for converting asset paths toFileString.loadAssetImage()for loading images as bytes
-
Abstract interfaces for file handling and dependency constants.
-
Example usage with a mock implementation of
IFireStorageService.
0.0.1 #
- Initial release of
reusable_editorpackage.