Skip to content
pubscout

responsive_property

0.0.8, released 3 weeks ago by wenkaifan.com

Responsive values and widgets based on screen size using ScreenScope and Responsive classes

WASM-ready
$ flutter pub add responsive_property
Source repository

What it does

It lets you map screen scopes to values or widgets and resolve the appropriate one at runtime. It also provides a ScreenBuilder helper for quick widget switching.

AI-written summary of version 0.0.8, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need responsive values for non-widget types (int, double, TextStyle, etc.)
  • You want a single source of truth for screen size based values
  • You prefer a declarative API over manual MediaQuery checks

Skip it when

  • You only need a few breakpoints and prefer hardcoded values
  • You need complex stateful logic that changes outside of screen size

Strengths

  • Simple API, works with any design system
  • Supports any type via generics
  • Provides JSON serialization
  • No extra dependencies beyond Flutter widgets

Weaknesses

  • No built‑in theming or layout helpers beyond screen size
  • Limited to screen width/height and orientation only
  • Requires manual map ordering for breakpoint precedence

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
1
final responsive = Responsive<int>({
  mobileScreenScope: 2,
  tabletScreenScope: 4,
  desktopScreenScope: 6,
});
int count = responsive.resolve(context) ?? 6;

Alternatives

Packages that do the same job and could replace responsive_property.

Works with

Packages commonly used together with responsive_property: ones it builds on, ones built on it, and its own family.