Skip to main content

responsive_metrics 0.0.4 copy "responsive_metrics: ^0.0.4" to clipboard
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 shortestSide itself — the same value used as the scale ratio's own numerator for that class — so the ratio was always exactly shortestSide / 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 small 0.95–1.15 clamp on every device class — mobile, tablet, and desktop alike — replacing the old per-class ranges (mobile 0.8–1.1, tablet 0.85–1.2, desktop 0.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 in RV instead — 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 optional scalingEnabled master switch. Pass false to make .w .h .sp .r return raw, unscaled values everywhere, including mobile — for apps that only want RV/pick() breakpoint-tier values and no proportional scaling at all. Defaults to true, 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 homepage field to pubspec.yaml.

0.0.1 #

  • Initial release.
  • ScreenScaler singleton for per-device-class pixel scaling.
  • .w .h .sp .r extensions on num.
  • ResponsiveContext extension on BuildContext with isMobile / isTablet / isDesktop / isLandscape / pick().
  • RV value holder for per-device-class constants.
1
likes
160
points
256
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A lightweight, dependency-free responsive design toolkit for Flutter — pixel scaling, breakpoint checks, and per-device values.

Homepage

License

MIT (license)

Dependencies

flutter

More

Packages that depend on responsive_metrics