bloc_morph 0.2.0
bloc_morph: ^0.2.0 copied to clipboard
BlocMorph is a Flutter widget for elegant state management with Bloc. It smoothly animates transitions between loading, error, empty, network error, and content states, providing a beautiful and user- [...]
BlocMorph #
A powerful and flexible Flutter package for managing UI states with the Bloc pattern, featuring smooth animations and highly customizable widgets. BlocMorph simplifies handling various UI states like loading, error, empty, and network issues, while providing seamless transitions and a polished user experience.
📜 Changelog #
Changelog #
All notable changes to the BlocMorph widget will be documented in this file.
0.2.0 2025-Sep-20 #
Added #
- Type Safety with
MorphStateInterface: Introduced aMorphStateinterface to enforce type-safe access torequestKey,typeState, anderrorproperties, eliminating unsafedynamiccasting. - Accessibility Support: Added
Semanticswidgets to default state widgets (_buildErrorWidget,_buildEmptyWidget,_buildInitWidget,_buildNetworkErrorWidget) to support screen readers and improve accessibility. IncludedtextScalerfor text scaling based on device accessibility settings. - Platform Style Support: Added
PlatformStyleenum (material,cupertino) to allow default widgets to adapt to Material or Cupertino design systems based on theplatformStyleparameter. - Customizable Error Padding and Icon Size: Added
errorPaddinganderrorIconSizeparameters to allow customization of padding and icon size in error and network error states. - Comprehensive Documentation: Added detailed DartDoc comments for all constructor parameters of
BlocMorph, explaining their purpose, default behavior, and usage.
Changed #
- Refactored
BlocConsumerListener Logic: Simplified the listener logic in_BlocMorphStateto reduce code duplication and improve readability by consolidating theifandelsebranches for state handling. - Optimized
AnimatedSwitcherUsage: MovedAnimatedSwitcherlogic into_buildContentto apply animations only whendisableAnimationisfalse, reducing unnecessary widget tree complexity. - Improved Key Management: Ensured all branches in
_buildContentuse uniqueValueKeys forKeyedSubtreewidgets to prevent animation glitches inAnimatedSwitcher. - Enhanced Error Handling: Updated
errorBuilderto receive the actual error message from theMorphState.errorfield instead of an empty string, improving flexibility for custom error displays. - Renamed
_buildErrorWidgetIOS: Renamed to_buildErrorWidgetfor clarity and consistency, as it now supports both Material and Cupertino styles. - Fixed Documentation Example: Corrected a syntax error in the example code in the
BlocMorphdocumentation, fixing theonPressedcallback (yourFuctoyourFunction) and ensuring proper syntax.
Fixed #
- Null-Safety for Callbacks: Added null-safety checks for optional callbacks (
onNext,onState,onTry) using the?.operator to prevent runtime null pointer exceptions. - Animation Key Issues: Fixed potential animation glitches by ensuring all state widgets in
_buildContenthave unique keys, particularly for pagination and non-pagination cases.
0.1.4 2025-Sep-18 #
- Initial Commit
Built with ❤️ for the PuzzleTakX