flutter_blocx 1.0.0
flutter_blocx: ^1.0.0 copied to clipboard
Flutter UI widgets for paginated lists, infinite grids, slivers, reactive forms, and screen state management powered by blocx_core.
Changelog #
1.0.0 #
Added #
- Stable
1.0.0Release &blocx_core: ^1.0.0Compatibility- Upgraded
blocx_coredependency to^1.0.0, supporting liveBlocxEventHubcollection and form stream synchronization (BlocxFormStateApplyInitialDataToFormand automatic route pop on entity deletion).
- Upgraded
- Type Conversion & Layout Options in
BlocXFormTextField/textField()- Added
TypeConverter<T>typedef (T Function(String value)) andtypeConverter/converterparameter toBlocXFormTextFieldandBlocxFormWidgetState.textField(...)to convert raw text input (e.g., toint,double, or custom types) before dispatchingBlocxFormEventUpdateData. - Added
isDenseandconstraintsoptions toBlocXTextFieldOptions(andBlocXTextFieldOptionsCopyWith).
- Added
- Validation Error Tooltip on
BlocxFormRegisterButton- Wrapped
BlocxFormRegisterButtonin aTooltipdisplaying active form validation errors (state.errors.values.join(".\n")).
- Wrapped
BlocxCollectionItemStateTheme & Dimension HelpersBlocxCollectionItemState<W, T, P>now extendsBlocXWidgetState<W>(BlocxWidgetState<W>), exposingtheme,textTheme,colorScheme,width, andheightgetters directly inside stateful collection items without passingBuildContext.
- Bundled AI Agent Skill (
skills/flutter-blocx)- Added a comprehensive
flutter-blocxAI coding skill (SKILL.mdandreferences/) covering all collection screens, layouts, item widgets, reactive form controls, and screen manager components.
- Added a comprehensive
Changed #
- Unified
generateBlocGetter Across Collection & Form Screen States- Changed
BlocxFormWidgetState.generateBlocfrom a method (generateBloc()) to a getter (BlocxFormBloc<F, P, E> get generateBloc;) matchingBlocxCollectionWidgetState.generateBloc.
- Changed
BlocXFormTextFieldDefault Decoration Density & PaddingBlocXFormTextFieldnow forwardsoptions.isDense,options.contentPadding, andoptions.constraintsdirectly toInputDecorationinstead of forcingisDense: trueand a hardcodedEdgeInsets.symmetric(horizontal: 16, vertical: 16)fallback.
BlocxFormRegisterButtonDisabled StateBlocxFormRegisterButton.isDisablednow also disables the button whenstate.errors.isNotEmpty.
- Full Web & WASM Platform Compatibility
- Removed the unused
loggerdependency and paired withblocx_core: ^1.0.0for 100% Web and WASM runtime support across all 6 Flutter platforms.
- Removed the unused
- Documentation & Pub Score Improvements
- Rebuilt
README.mdwith concise architecture guides, side-by-side comparisons, and cross-packageblocx_core+flutter_blocxquickstarts, and expandedpubspec.yamlmetadata.
- Rebuilt
Fixed #
BlocxFormRegisterButtonFilled Style Precedence- Fixed
buildFilledButtoninBlocxFormRegisterButtonto prioritizebuttonOptions.filledStylebefore falling back tobuttonOptions.style.
- Fixed
Migration Guide #
Change generateBloc() method to get generateBloc getter in BlocxFormWidgetState
// Before (0.9.0)
@override
BlocxFormBloc<ProfileForm, User, ProfileField> generateBloc() => ProfileFormBloc();
// After (1.0.0)
@override
BlocxFormBloc<ProfileForm, User, ProfileField> get generateBloc => ProfileFormBloc();
0.9.0 #
Added #
- Unified Package Exports in
package:flutter_blocx/flutter_blocx.dart- Re-exported
form_widget.dartandlist_widget.dartfrom the main library entry point. - Exported
BlocxFormCheckbox,BlocxScreenManagerState,BlocxErrorWidget,BlocxSnackBar, andBlocXLocalizations.
- Re-exported
- Typedef Aliases for API Consistency
- Added
BlocxWidgetState,BlocxFormTextField,BlocxFormDropdown,BlocxTextFieldOptions,BlocxDropdownOptions, andBlocxSnackbarTypeas aliases matching theBlocxcasing convention.
- Added
- Automated Unit & Widget Test Suite
- Added comprehensive widget and unit tests in
test/for form fields, collection widgets, screen manager state, error page rendering, and snackbars.
- Added comprehensive widget and unit tests in
Fixed #
- Unified
BlocxStatelessWidget- Resolved duplicate class definition across
src/core/base/andsrc/core/widgets/. - Preserved full backwards compatibility while unifying
width,height,theme,textTheme, andcolorSchemecontext getters.
- Resolved duplicate class definition across
0.8.4 #
Fixed #
-
BlocxFormRegisterButton-
Changed
statefrom rawBlocxFormStateto typedBlocxFormState<F, E>. -
Prevented submit buttons from becoming permanently disabled after validation errors in
FormValidationMode.onSubmit. -
Added
disableWhenInvalid, defaulting tofalse. -
Added loading/disabled handling for:
- form submission
- unique-field validation
- required field info fetching
-
Added a clear error when no matching
BlocxFormWidgetStateancestor is found.
-
-
BlocxFormButtonRow- Changed
formStatefrom rawBlocxFormStateto typedBlocxFormState<F, E>. - Passed
disableRegisterWhenInvalidthrough toBlocxFormRegisterButton. - Added configurable
height. - Improved secondary button naming and documentation.
- Changed
-
BlocXFormTextField- Fixed
TextFieldTypehandling for filled, outlined, and underlined variants. - Respected custom
InputDecorationwhile still merging bloc-driven errors and suffix loading indicators. - Applied
borderRadiusto default filled and outlined decorations. - Prevented clear buttons from showing for obscure text fields.
- Updated automatic text direction when typing RTL/LTR content.
- Improved external/internal controller ownership handling.
- Fixed
-
BlocxFormWidgetState- Typed
BlocProvider.valueandBlocConsumerusage. - Typed form-state listener checks.
- Typed helper methods and form state getter.
- Fixed controller and focus-node disposal order.
- Closed owned blocs before calling
super.dispose(). - Converted initial form values to strings safely when hydrating text controllers.
- Typed
-
BlocxCollectionWidgetState- Added owned/external scroll controller tracking.
- Avoided disposing externally provided scroll controllers.
- Removed
AutoScrollControllerlisteners before disposal. - Closed owned collection blocs before calling
super.dispose(). - Guarded scroll-to-item logic so it only runs with
AutoScrollController. - Typed collection helper event dispatches.
Changed #
- Improved dartdocs across updated form and collection widget APIs.
- Improved lifecycle safety for form and collection widget states.
- Improved submit UX by making the bloc responsible for blocking invalid submits instead of disabling the button by default.
0.8.3 #
- Updated README.md
0.8.2 #
- Updated CHANGELOG.md
0.8.1 #
- Updated README.md to fix some inconsistencies
0.8.0 #
Added #
-
BlocxScreenManagerState.errorWidgetByErrorCode— new overridable hook that builds a full-page error widget forScreenManagerCubitStateDisplayErrorPageByErrorCode. Convertsstate.errorCodeto a human-readable message viaBlocXLocalizations.errorCodeMessageand renders aBlocxErrorWidget. Override to add per-error-code UI, retry logic, or reporting callbacks. -
BlocxScreenManagerState.decorateScaffold— new overridable hook to wrap the scaffold produced byscaffoldWidgetwith additional widgets (e.g.PopScope, theme providers). Only called whenwrapInScaffoldistrue. -
BlocXLocalizations— new required members:close— label for dismiss/close actions in built-in error and snackbar widgets.copyDetails— label for the "copy error details" action inBlocxErrorWidget.dateRangeError(DateTime minDate, DateTime maxDate)— message used by the date-range validator when the selected date falls outside the allowed range.BlocXErrorCode.fieldCannotBeEmpty— new error code; add a translation in yourerrorCodeMessagesmap.
-
BlocxScreenManagerStatedocumentation — comprehensive dartdoc added to all public/protected members:wrapInScaffold,managerCubit,decorateScaffold,errorWidget,errorWidgetByErrorCode,mainWidget,scaffoldWidget.
Changed #
-
blocx_coredependency bumped from0.7.1to^0.8.2, picking up all breaking mixin renames and the newBlocxPaginatedUseCaseTaskintroduced inblocx_core0.8.0. -
BlocxScreenManagerState.showSnackBar— parameter list reformatted to one-per-line for readability; no API change. -
BlocxScreenManagerState.scaffoldWidget—UnimplementedErrormessage split across lines for readability; message text unchanged. -
Example
ExampleLocalizations—errorGettingInitialFormDataentry condensed to a single line; new entries added (see Added above). -
Example
MyApp—ThemeDataconstruction collapsed to a single line; no visual change.
Migration Guide #
Update your pubspec constraint
dependencies:
flutter_blocx: ^0.8.0
Implement new BlocXLocalizations members
Add the three new members to your BlocXLocalizations subclass:
@override
String get close => 'Close';
@override
String get copyDetails => 'Copy details';
@override
String dateRangeError(DateTime minDate, DateTime maxDate) =>
'Date must be between $minDate and $maxDate.';
Add the new error code to your errorCodeMessages map:
BlocXErrorCode.fieldCannotBeEmpty: 'This field cannot be empty',
Adopt blocx_core 0.8.x mixin renames
blocx_core ^0.8.2 renamed all collection mixins and form mixins. Update your with clauses — see the blocx_core 0.8.0 migration guide for the full rename table.
0.7.1 prior release #
See repository history for earlier entries.