responsive_wrapper 2.0.0
responsive_wrapper: ^2.0.0 copied to clipboard
A Flutter package for building responsive UIs that adapt to different screen sizes, device types, and orientations with automatic detection.
2.0.0 #
Breaking Changes #
ResponsiveLayoutdefaults fortreatLandscapePhoneAsTabletandtreatPortraitTabletAsPhonechanged fromtrue→falseto be consistent with all other widgetsResponsiveOrientationLayoutBuildertypedef removed — useResponsiveLayoutBuilderinsteadResponsiveOrientationValuemoved fromresponsive_wrapper.darttosrc/screen_size_util.dart(still exported from the main entry point, no import changes needed)
Bug Fixes #
- Fixed
ResponsiveBreakpointsmissing==andhashCode, causing incorrectScreenInfoequality comparisons - Fixed inconsistent phone landscape fallback between
ResponsiveOrientationLayoutandResponsiveOrientationLayoutWith— both now explicitly fall back tophonePortrait - Eliminated duplicated device type resolution logic — extracted to shared
resolveDeviceTypehelper
New Features #
ResponsiveDataInheritedWidget —ResponsiveWrappernow propagatesScreenInfoto all descendants; access viaResponsiveData.of(context)orResponsiveData.maybeOf(context)ResponsiveVisibilitywidget — conditionally show/hide widgets by device type withvisibleOnPhone,visibleOnTablet,visibleOnDesktopflags- New extension methods on
BuildContext:context.screenInfo— getScreenInfofrom tree or MediaQuerycontext.deviceType— quickDeviceTypeaccesscontext.isPhone,context.isTablet,context.isDesktopcontext.isPortrait,context.isLandscape
ScreenInfoadditions:shortestSide,longestSide,aspectRatiogetters andcopyWithResponsiveBreakpointsadditions:copyWith, named presetsResponsiveBreakpoints.material(600/1240) andResponsiveBreakpoints.bootstrap(576/992)ResponsiveValue<T>.resolve(BuildContext)— resolve value directly from context- Comprehensive test suite with 4 test files covering core utilities, widgets, extensions, and visibility
Code Quality #
- Removed duplicate
ResponsiveOrientationLayoutBuildertypedef - Removed inline usage-example comment block from
screen_size_util.dart - Extension methods are now consistent with a parent
ResponsiveWrapper's resolvedScreenInfo
1.0.2 #
- Added repository url
- Updated topics
- Added convenient extension methods for BuildContext
- Added
context.getResponsiveValue<T>()for generic responsive values - Added
context.getResponsiveValueSimple<T>()for device-only values - Added
context.getResponsivePadding()for EdgeInsets values - Added
context.getResponsiveFontSize()for font size values - Improved developer experience with cleaner, more readable API
1.0.1 #
- Enhanced README documentation with comprehensive preBuilder examples
- Improved discoverability with additional pubspec.yaml tags
1.0.0 #
- Initial release of responsive_wrapper package
- Added ResponsiveWrapper widget for basic responsive layouts
- Added ResponsiveWrapperWith
- Added ResponsiveLayout for device-specific layouts
- Added ResponsiveLayoutWith
- Added ResponsiveOrientationLayout for orientation-aware layouts
- Added ResponsiveOrientationLayoutWith
- Added ResponsiveOrientationValue
- Added ResponsiveValue
- Added ResponsiveBreakpoints for custom breakpoint configuration
- Added ScreenInfo class with comprehensive screen information
- Added support for custom breakpoints and orientation handling
- Added comprehensive documentation with examples
- Added example app demonstrating all features
- Full API documentation with /// comments
- Support for pre-builders and state management integration
0.0.1 #
- Initial release.