flutter_blocx 1.1.0 copy "flutter_blocx: ^1.1.0" to clipboard
flutter_blocx: ^1.1.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.1.0 - 2026-10-10 #

Added #

  • Added composable BlocxCollectionView and BlocxFormView standalone view widgets with builder fallbacks (emptyBuilder, errorBuilder, loadingBuilder), allowing collection lists and forms to be embedded directly into custom widget trees without subclassing full screen state classes.
  • Added DI-friendly construction to BlocxCollectionWidget and BlocxFormWidget: added optional bloc constructor argument, automatic fallback to context.read<B>() in generateBloc(), and non-destructive lifecycle management (autoDisposeBloc / autoCloseBloc default to false when externally provided).
  • Added retry support to default errorWidget and errorWidgetByErrorCode in BlocxScreenManagerState, invoking managerCubit.clearError() to dismiss full-page errors followed by the onRetry(BuildContext) hook (overridden in BlocxCollectionWidgetState and BlocxFormWidgetState to automatically reload data).
  • Added onPop(BuildContext) hook in BlocxScreenManagerState (defaulting to Navigator.of(context).maybePop()) to enable custom navigation handling for declarative routing solutions (go_router, auto_route).
  • Added shouldReloadOnPayloadChange getter in BlocxCollectionWidgetState and BlocxFormWidgetState (defaulting to true) controlling whether updating widget.payload triggers an automatic reload / re-initialization.
  • Added optional focusNode parameter to BlocXFormTextField and BlocXFormDropdown, forwarding to underlying Flutter form fields.
  • Added optional focusNode parameter to BlocxFormWidgetState.textField and BlocxFormWidgetState.dropdown helpers, defaulting to getFocusNode(key).
  • Updated BlocxCollectionWidgetState.searchingText and BlocxSearchField default hint to use loc.searchingText and loc.searchHint from BlocXLocalizations.
  • Deprecated redundant isChecked argument in BlocxFormWidgetState.checkbox(...) in favor of specifying isChecked in BlocxCheckboxOptions, keeping both functional for backward compatibility.
  • Documented validator: parameter precedence vs pure-Dart BlocX field validation in README.md and dartdoc comments.

Changed #

  • Raised SDK floor to sdk: ">=3.8.0 <4.0.0" and Flutter floor to flutter: ">=3.32.0", aligning with blocx_core 1.1.0.
  • Dropped committed dependency_overrides from repository, using gitignored local pubspec_overrides.yaml and checking out blocx_core from develop branch in CI.

Fixed #

  • Hardened Inherited Provider DI lookup in BlocxCollectionWidgetState.generateBloc and BlocxFormWidgetState.generateBloc: catches ProviderNotFoundException and throws a descriptive FlutterError explaining that context-provided blocs must be typed as base classes BlocProvider<BlocxCollectionBloc<...>> / BlocProvider<BlocxFormBloc<...>> or passed via constructor.
  • Added didUpdateWidget in BlocxCollectionWidgetState and BlocxFormWidgetState to automatically reload hosts when widget.payload changes (when shouldReloadOnPayloadChange is enabled) and asserted that widget.bloc is not mutated dynamically.
  • Fixed form error focus ordering in BlocxFormWidgetState.requestFocusOnError: now iterates keys to find and focus the first error in declaration order rather than arbitrary map key iteration order.
  • Automatically attached managed FocusNode instances from getFocusNode(key) to text fields and dropdowns so requestFocusOnError properly focuses the corresponding input.

1.0.1 - 2026-10-09 #

Documentation #

  • Recorded baseline test and analysis results in docs/fix-notes.md.

Infrastructure #

  • Added GitHub Actions CI workflow (.github/workflows/ci.yml) covering formatting, static analysis (--fatal-infos), tests with coverage, dry-run publishing, and example web build.
  • Added bloc_test and mocktail dev dependencies and created FakeCollectionBloc test helper in test/helpers/.

Fixed #

  • Handled BlocxCollectionStateError in BlocxCollectionWidgetState, displaying collectionErrorWidget (BlocxErrorWidget with "Try again" action) on initial load failure rather than leaving the screen in an endless loading spinner or empty view.
  • Aligned collectionWrapperBuilder to read isLoading and isSearching directly from incoming state snapshots rather than polling internal mutable bloc fields.
  • Eliminated $O(n^2)$ indexOf lookups during collection list building by directly passing the delegate item index in InfiniteList and SliverInfiniteList, and updated BlocxCollectionItem.index(context) to resolve indices by identifier via state.indexOfId instead of reference equality.
  • Added scroll extent threshold checks in InfiniteList and SliverInfiniteList as a robust fallback for triggering next-page loading (loadBottomData) when scrolled near the list edge, guarded by an internal triggering flag to prevent duplicate event dispatches during active drag notifications.
  • Updated applyInitialDataToForm in BlocxFormWidgetState to only update controller text when changed and preserve the active cursor position (clamped to the new text length).
  • Added optional BlocxFormState<F, E>? formState parameter to submitButton and formButtonRow helpers in BlocxFormWidgetState, enabling direct snapshot reading and avoiding reliance on internal mutable bloc fields.

1.0.0 #

Added #

  • Stable 1.0.0 Release & blocx_core: ^1.0.0 Compatibility
    • Upgraded blocx_core dependency to ^1.0.0, supporting live BlocxEventHub collection and form stream synchronization (BlocxFormStateApplyInitialDataToForm and automatic route pop on entity deletion).
  • Type Conversion & Layout Options in BlocXFormTextField / textField()
    • Added TypeConverter<T> typedef (T Function(String value)) and typeConverter / converter parameter to BlocXFormTextField and BlocxFormWidgetState.textField(...) to convert raw text input (e.g., to int, double, or custom types) before dispatching BlocxFormEventUpdateData.
    • Added isDense and constraints options to BlocXTextFieldOptions (and BlocXTextFieldOptionsCopyWith).
  • Validation Error Tooltip on BlocxFormRegisterButton
    • Wrapped BlocxFormRegisterButton in a Tooltip displaying active form validation errors (state.errors.values.join(".\n")).
  • BlocxCollectionItemState Theme & Dimension Helpers
    • BlocxCollectionItemState<W, T, P> now extends BlocXWidgetState<W> (BlocxWidgetState<W>), exposing theme, textTheme, colorScheme, width, and height getters directly inside stateful collection items without passing BuildContext.
  • Bundled AI Agent Skill (skills/flutter-blocx)
    • Added a comprehensive flutter-blocx AI coding skill (SKILL.md and references/) covering all collection screens, layouts, item widgets, reactive form controls, and screen manager components.

Changed #

  • Unified generateBloc Getter Across Collection & Form Screen States
    • Changed BlocxFormWidgetState.generateBloc from a method (generateBloc()) to a getter (BlocxFormBloc<F, P, E> get generateBloc;) matching BlocxCollectionWidgetState.generateBloc.
  • BlocXFormTextField Default Decoration Density & Padding
    • BlocXFormTextField now forwards options.isDense, options.contentPadding, and options.constraints directly to InputDecoration instead of forcing isDense: true and a hardcoded EdgeInsets.symmetric(horizontal: 16, vertical: 16) fallback.
  • BlocxFormRegisterButton Disabled State
    • BlocxFormRegisterButton.isDisabled now also disables the button when state.errors.isNotEmpty.
  • Full Web & WASM Platform Compatibility
    • Removed the unused logger dependency and paired with blocx_core: ^1.0.0 for 100% Web and WASM runtime support across all 6 Flutter platforms.
  • Documentation & Pub Score Improvements
    • Rebuilt README.md with concise architecture guides, side-by-side comparisons, and cross-package blocx_core + flutter_blocx quickstarts, and expanded pubspec.yaml metadata.

Fixed #

  • BlocxFormRegisterButton Filled Style Precedence
    • Fixed buildFilledButton in BlocxFormRegisterButton to prioritize buttonOptions.filledStyle before falling back to buttonOptions.style.

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.dart and list_widget.dart from the main library entry point.
    • Exported BlocxFormCheckbox, BlocxScreenManagerState, BlocxErrorWidget, BlocxSnackBar, and BlocXLocalizations.
  • Typedef Aliases for API Consistency
    • Added BlocxWidgetState, BlocxFormTextField, BlocxFormDropdown, BlocxTextFieldOptions, BlocxDropdownOptions, and BlocxSnackbarType as aliases matching the Blocx casing convention.
  • 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.

Fixed #

  • Unified BlocxStatelessWidget
    • Resolved duplicate class definition across src/core/base/ and src/core/widgets/.
    • Preserved full backwards compatibility while unifying width, height, theme, textTheme, and colorScheme context getters.

0.8.4 #

Fixed #

  • BlocxFormRegisterButton

    • Changed state from raw BlocxFormState to typed BlocxFormState<F, E>.

    • Prevented submit buttons from becoming permanently disabled after validation errors in FormValidationMode.onSubmit.

    • Added disableWhenInvalid, defaulting to false.

    • Added loading/disabled handling for:

      • form submission
      • unique-field validation
      • required field info fetching
    • Added a clear error when no matching BlocxFormWidgetState ancestor is found.

  • BlocxFormButtonRow

    • Changed formState from raw BlocxFormState to typed BlocxFormState<F, E>.
    • Passed disableRegisterWhenInvalid through to BlocxFormRegisterButton.
    • Added configurable height.
    • Improved secondary button naming and documentation.
  • BlocXFormTextField

    • Fixed TextFieldType handling for filled, outlined, and underlined variants.
    • Respected custom InputDecoration while still merging bloc-driven errors and suffix loading indicators.
    • Applied borderRadius to 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.
  • BlocxFormWidgetState

    • Typed BlocProvider.value and BlocConsumer usage.
    • 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.
  • BlocxCollectionWidgetState

    • Added owned/external scroll controller tracking.
    • Avoided disposing externally provided scroll controllers.
    • Removed AutoScrollController listeners 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 for ScreenManagerCubitStateDisplayErrorPageByErrorCode. Converts state.errorCode to a human-readable message via BlocXLocalizations.errorCodeMessage and renders a BlocxErrorWidget. Override to add per-error-code UI, retry logic, or reporting callbacks.

  • BlocxScreenManagerState.decorateScaffold — new overridable hook to wrap the scaffold produced by scaffoldWidget with additional widgets (e.g. PopScope, theme providers). Only called when wrapInScaffold is true.

  • 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 in BlocxErrorWidget.
    • 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 your errorCodeMessages map.
  • BlocxScreenManagerState documentation — comprehensive dartdoc added to all public/protected members:

    • wrapInScaffold, managerCubit, decorateScaffold, errorWidget, errorWidgetByErrorCode, mainWidget, scaffoldWidget.

Changed #

  • blocx_core dependency bumped from 0.7.1 to ^0.8.2, picking up all breaking mixin renames and the new BlocxPaginatedUseCaseTask introduced in blocx_core 0.8.0.

  • BlocxScreenManagerState.showSnackBar — parameter list reformatted to one-per-line for readability; no API change.

  • BlocxScreenManagerState.scaffoldWidget — UnimplementedError message split across lines for readability; message text unchanged.

  • Example ExampleLocalizations — errorGettingInitialFormData entry condensed to a single line; new entries added (see Added above).

  • Example MyApp — ThemeData construction 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.

2
likes
160
points
411
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Flutter UI widgets for paginated lists, infinite grids, slivers, reactive forms, and screen state management powered by blocx_core.

Repository (GitHub)
View/report issues

Topics

#bloc #architecture #lists #form #flutter

License

MIT (license)

Dependencies

blocx_core, flutter, flutter_bloc, implicitly_animated_list, scroll_to_index, visibility_detector

More

Packages that depend on flutter_blocx