responsive_metrics 0.0.4
responsive_metrics: ^0.0.4 copied to clipboard
A lightweight, dependency-free responsive design toolkit for Flutter — pixel scaling, breakpoint checks, and per-device values.
0.0.4 #
- Fixed: tablet's baseline used to be
shortestSideitself — the same value used as the scale ratio's own numerator for that class — so the ratio was always exactlyshortestSide / shortestSide = 1.0, regardless of the actual device size. Tablet now has a real fixed baseline (768×1024, matching the standard-iPad canvas this class was always documented against), so tablet scaling actually does something. - Changed:
.sp(text scaling) now uses a single, deliberately small0.95–1.15clamp on every device class — mobile, tablet, and desktop alike — replacing the old per-class ranges (mobile0.8–1.1, tablet0.85–1.2, desktop0.9–2.0). Dense application UI generally doesn't chase device-size variance with font size at all; this clamp exists to smooth out small differences within a device class, not to scale text up for a bigger screen. A value that should genuinely differ by class (e.g. a header that's bigger on desktop by design) belongs inRVinstead — this clamp then makes small adjustments within whichever class is active. The range is asymmetric on purpose (−5%/+15%): shrinking text hurts readability more than growing it does. ScreenScaler.init()now accepts an optionalscalingEnabledmaster switch. Passfalseto make.w.h.sp.rreturn raw, unscaled values everywhere, including mobile — for apps that only wantRV/pick()breakpoint-tier values and no proportional scaling at all. Defaults totrue, so existing behavior is unchanged. This is a single global switch, not per device class — a fixed-hardware app turns off scaling entirely rather than tuning it per tier.
0.0.2 #
- Added
homepagefield topubspec.yaml.
0.0.1 #
- Initial release.
ScreenScalersingleton for per-device-class pixel scaling..w.h.sp.rextensions onnum.ResponsiveContextextension onBuildContextwithisMobile/isTablet/isDesktop/isLandscape/pick().RVvalue holder for per-device-class constants.