px_responsive 0.1.0
px_responsive: ^0.1.0 copied to clipboard
A powerful tri-tier responsive design system for Flutter. Automatically scales UI elements across mobile, tablet, and desktop based on your Figma/XD design specifications.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.1.0 - 2026-03-21 #
Added #
- Orientation support —
isLandscape,isPortrait,orientationgetters andorientationValue<T>()on bothPxResponsiveand as global helpers PxOrientationenum —portrait/landscapevalues- Landscape design sizes — optional
mobileLandscape,tabletLandscape,desktopLandscapeinPxResponsiveConfig; the active base size switches automatically when the device rotates - Safe area awareness —
safeAreaTop,safeAreaBottom,safeAreaLeft,safeAreaRight,safeScreenHeightonPxResponsive; populated automatically fromMediaQuery.paddinginsidePxResponsiveWrapper PxResponsiveMediaQueryWrapper— alternative toPxResponsiveWrapperthat reads screen size fromMediaQueryinstead ofLayoutBuilder; useful when the wrapper is placed inside a constrained subtreeBuildContextextensions (PxResponsiveContextExtension) —context.isMobile,context.isTablet,context.isDesktop,context.deviceType,context.screenWidth,context.screenHeight,context.isLandscape,context.isPortraitTextStyle.responsive— scalesfontSizebyscaleSp,letterSpacingandwordSpacingbyscaleWIcon.responsive— scales iconsizebyscaleSp- Spacing extensions (
PxResponsiveSpacingExtension) —num.verticalSpace→SizedBox(height: value.h),num.horizontalSpace→SizedBox(width: value.w) - Radius clamping —
.rMin(min),.rMax(max),.rClamp(min, max)onnum(mirrors existing.wClamp/.hClamp/.spClamp) PxResponsiveDebug— overlay widget that displays device type, screen dimensions, orientation, active base size and all scale factors; controlled by anenabledflagPxResponsivePadding— widget that selects device-specificEdgeInsetswith an optionalscale: trueflag to apply.scaledautomaticallyPxResponsiveGrid—GridView-based widget with per-devicemobileColumns,tabletColumns,desktopColumns; configurablespacing,runSpacing,childAspectRatio,shrinkWrap, andphysicsAnimatedPxResponsiveBuilder— wraps layouts inAnimatedSwitcherso desktop window resizes transition smoothly between device types; supports custom duration, curves and transition buildersPxPlatformTypeenum —android,ios,web,macos,windows,linux,fuchsia- Platform detection helpers —
platformType,isNativeMobile,isNativeDesktop,isPlatformWebtop-level getters orientationValue<T>()global function — mirror ofPxResponsive().orientationValue()- Greatly expanded test suite: orientation tests, safe area tests, clamping tests,
TextStyle.responsivetests, spacing tests, plus a newpx_responsive_widget_test.dartcovering all widgets
Changed #
PxResponsive.init()now accepts an optionalsafeAreaPaddingparameter (defaults toEdgeInsets.zero— fully backward-compatible)PxResponsiveWrappernow passesMediaQuery.paddingassafeAreaPaddingtoinit()PxResponsive.reset()now resetssafeAreaPaddingtoEdgeInsets.zeroPxResponsive.toString()now includes orientation and safe area in outputPxResponsiveConfig.copyWith()gainsdesktopLandscape,tabletLandscape,mobileLandscapeparameters- SDK constraint kept at
<4.0.0(pub.dev does not accept constraints that allow non-existent Dart versions) - Supported platforms expanded: added
macos,linux,windowstopubspec.yaml - Version bumped to
0.1.0
0.0.4 - 2025-01-15 #
- Updated the license
0.0.3 - 2025-01-15 #
- Updated the documentation
0.0.2 - 2025-01-15 #
Added #
maxWidthparameter inPxResponsiveConfigto constrain maximum screen width- Maximum width limiting to prevent UI elements from becoming too large on ultra-wide displays
- Automatic width capping when screen exceeds
maxWidththreshold - Documentation for
maxWidthusage and best practices
Changed #
- Scale factor calculations now respect
maxWidthconstraint when specified - Improved handling of ultra-wide screen scenarios (4K, ultrawide monitors)
0.0.1 - 2025-01-10 #
Added #
- Initial release of px_responsive
PxResponsiveConfig— configuration class for design baselines and breakpointsPxResponsive— singleton core for calculating scale factorsPxResponsiveWrapper— widget wrapper for initializing the responsive system- Numeric extensions (
.w,.h,.sp,.r,.wf,.hf) - Parent-relative extensions (
.wr(),.hr()) - Clamping methods (
.wMin(),.wMax(),.wClamp(),.hMin(),.hMax(),.hClamp(),.spMin(),.spMax(),.spClamp()) EdgeInsetsextensions (.w,.scaled,.r)Sizeextensions (.scaled,.w,.r)BorderRadiusextensions (.r)PxResponsiveBuilder— widget for device-specific layoutsPxResponsiveValue— widget for device-specific valuesPxResponsiveVisibility— widget for conditional visibility- Scale factor clamping to prevent extreme UI scaling
- Separate text scale factor limit (
maxTextScaleFactor) - Full documentation for all public APIs