responsive_builder
0.7.1, released 2 years ago by filledstacks.com
Widgets for responsive UI across device types and orientations
What it does
Provides builders that expose device screen type and orientation, allowing developers to return different widgets or values per breakpoint. Includes helpers for custom breakpoints and global sizing config.
AI-written summary of version 0.7.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- Need separate layouts for mobile, tablet, desktop, watch
- Want readable responsive code without manual MediaQuery checks
- Need to enforce orientation or custom breakpoints
- Want to use shorthand extensions for screen size percentages
Skip it when
- You only need a single layout for all devices
- You prefer manual MediaQuery logic over builder widgets
Strengths
- Easy to read and maintain responsive code
- Supports custom breakpoints and global config
- Includes helper functions like getValueForScreenType
- No code generation required
Weaknesses
- Limited to layout; no state management or networking features
- Requires adding provider dependency
- No built-in theming or advanced animations
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
Add responsive_builder: to pubspec, import package, wrap widgets with ResponsiveBuilder/ScreenTypeLayout/OrientationLayoutBuilder
ResponsiveBuilder(
builder: (context, sizing) {
if (sizing.deviceScreenType == DeviceScreenType.desktop) {
return Container(color: Colors.blue);
}
return Container(color: Colors.red);
},
);Alternatives
Packages that do the same job and could replace responsive_builder.
- responsive_framework
Similar responsive layout widgets with more features like breakpoints and orientation handling
50Compare - device_preview
Provides device preview and responsive testing but not layout widgets
84Compare
Works with
Packages commonly used together with responsive_builder: ones it builds on, ones built on it, and its own family.