responsive_spacing_v2 1.3.0 copy "responsive_spacing_v2: ^1.3.0" to clipboard
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 SpacingSize Enum: Added SpacingSize (xs, sm, md, lg, xl, xxl) and helper constructors for ResponsiveSpacer (.vertical(), .horizontal(), .xs(), .sm(), .md(), .lg(), .xl(), .xxl(), .fromSize()).
  • Material 3 Adaptive Breakpoints & ScreenType: Added SpacingBreakpoints (compact, medium, expanded, large, extraLarge) and helper properties on ScreenType.
  • 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 corresponding ResponsiveMargin constructors with custom breakpoint support.
  • Slivers: Added SliverResponsivePadding and SliverResponsiveSpacer.
  • num Spacing Extensions: Added 16.verticalSpace and 8.horizontalSpace (.vSpace, .hSpace).
  • BuildContext Extensions: Added context.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, and xxl level to ResponsiveSpacing.

Improved #

  • Performance: Migrated ResponsivePadding and ResponsiveMargin from MediaQuery.of to MediaQuery.sizeOf to eliminate unnecessary rebuilds when non-size media query data changes.
  • Provider Safety & Reliability: ResponsiveSpacingProvider.of now throws an informative FlutterError in both debug and release modes, added ResponsiveSpacingProvider.maybeOf, and fixed dynamic theme updates via didUpdateWidget.
  • 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.3 - 2025-05-27 #

Fixed #

  • Improved documentation.

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 on BuildContext to access spacing values dynamically.

1.1.3 - 2025-05-09 #

Fixed #

  • Improved documentation.

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 smallScreenPadding and largeScreenPadding properties for easy customization.
    • ResponsiveMargin: A widget that automatically adjusts margin around a child widget based on the screen size.
      • Introduced smallScreenMargin and largeScreenMargin properties for flexible spacing control.
4
likes
160
points
90
downloads

Documentation

API reference

Publisher

verified publishernishanpradhan.com.np

Weekly Downloads

A simple Flutter package to add responsive padding and margin widgets for consistent, adaptive spacing across different screen sizes.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on responsive_spacing_v2