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
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.
- responsive_framework
Provides a more comprehensive responsive layout system with breakpoints and adaptive widgets
50Compare - responsive_builder
Offers similar screen size based widgets and helpers
50Compare - sizer
Simpler API for sizing widgets based on screen dimensions
63Compare
Works with
Packages commonly used together with responsive_property: ones it builds on, ones built on it, and its own family.
- flutter_class_parserresponsive_property depends on itSerialize and deserialize common Flutter UI data classes and widgets.
- dimensionSame familyMimics CSS length units (px, percentage, vw, vh, vmin, vmax) for responsive Flutter layouts.
- morphable_shapeSame familyCreate responsive shapes and morph between them in Flutter.
- animated_styled_widgetSame familySerializable CSS-inspired styles with implicit and explicit animations for custom widgets.