responsive_spacing_v2 1.3.0
responsive_spacing_v2: ^1.3.0 copied to clipboard
A simple Flutter package to add responsive padding and margin widgets for consistent, adaptive spacing across different screen sizes.
1.3.0 - 2026-08-19 #
Added #
- Type-Safe
SpacingSizeEnum: AddedSpacingSize(xs,sm,md,lg,xl,xxl) and helper constructors forResponsiveSpacer(.vertical(),.horizontal(),.xs(),.sm(),.md(),.lg(),.xl(),.xxl(),.fromSize()). - Material 3 Adaptive Breakpoints &
ScreenType: AddedSpacingBreakpoints(compact,medium,expanded,large,extraLarge) and helper properties onScreenType. ResponsiveValue<T>: Declarative responsive resolver for arbitrary properties (columns, font sizes, colors) based on screen width breakpoints.- Granular Padding & Margin Constructors: Added
ResponsivePadding.symmetric(),ResponsivePadding.only(),ResponsivePadding.directional(), and correspondingResponsiveMarginconstructors with custom breakpoint support. - Slivers: Added
SliverResponsivePaddingandSliverResponsiveSpacer. numSpacing Extensions: Added16.verticalSpaceand8.horizontalSpace(.vSpace,.hSpace).BuildContextExtensions: Addedcontext.spaceXs,context.spaceSm,context.spaceMd,context.spaceLg,context.spaceXl,context.spaceXxl,context.screenType,context.isCompact,context.isTablet,context.isDesktop.- Fluid Spacing Engine: Added
ResponsiveSpacing.fluid()clamped linear interpolation between screen size limits. - Model Enhancements: Added
copyWith,==,hashCode,toString, andxxllevel toResponsiveSpacing.
Improved #
- Performance: Migrated
ResponsivePaddingandResponsiveMarginfromMediaQuery.oftoMediaQuery.sizeOfto eliminate unnecessary rebuilds when non-size media query data changes. - Provider Safety & Reliability:
ResponsiveSpacingProvider.ofnow throws an informativeFlutterErrorin both debug and release modes, addedResponsiveSpacingProvider.maybeOf, and fixed dynamic theme updates viadidUpdateWidget. - 100% Backward Compatibility: All legacy signatures and default behaviors remain fully intact.
- Test Suite: Added complete unit and widget tests covering all components and features.
1.2.0 - 2025-05-27 #
Added #
- ResponsiveSpacingProvider: Provides a global spacing scale based on a base unit and scaling factor.
- ResponsiveSpacer: A widget to insert vertical or horizontal space using a responsive scale (
xs,sm,md,lg,xl). context.spacing: Extension onBuildContextto access spacing values dynamically.
1.1.2 - 2024-11-04 #
Initial Release #
- Released the Responsive Spacing package with the following features:
- ResponsivePadding: A widget that automatically adjusts padding around a child widget based on the screen size.
- Introduced
smallScreenPaddingandlargeScreenPaddingproperties for easy customization.
- Introduced
- ResponsiveMargin: A widget that automatically adjusts margin around a child widget based on the screen size.
- Introduced
smallScreenMarginandlargeScreenMarginproperties for flexible spacing control.
- Introduced
- ResponsivePadding: A widget that automatically adjusts padding around a child widget based on the screen size.