ResponsiveFramework
Easily make Flutter apps responsive. Automatically adapt UI to different screen sizes. Responsiveness made simple. Demo: https://gallery.codelessly.com/flutterwebsites/minimal/
Install / Use
/learn @Codelessly/ResponsiveFrameworkREADME

Responsive Framework

Responsiveness made simple
The Responsive Framework includes widgets that help developers build responsive apps for mobile, desktop, and website layouts.
Demo
Minimal Website
A demo website built with the Responsive Framework. View Code
Flutter Website
The flutter.dev website recreated in Flutter. View Code
Pub.dev Website
The pub.dev website recreated in Flutter. View Code
Quick Start
Import this library into your project:
responsive_framework: ^latest_version
Add ResponsiveBreakpoints.builder to your MaterialApp or CupertinoApp. Define your own breakpoints and labels.
import 'package:responsive_framework/responsive_framework.dart';
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
builder: (context, child) => ResponsiveBreakpoints.builder(
child: child!,
breakpoints: [
const Breakpoint(start: 0, end: 450, name: MOBILE),
const Breakpoint(start: 451, end: 800, name: TABLET),
const Breakpoint(start: 801, end: 1920, name: DESKTOP),
const Breakpoint(start: 1921, end: double.infinity, name: '4K'),
],
),
initialRoute: "/",
);
}
}
Use the labels you defined for layouts and values.
// Example: if the screen is bigger than the Mobile breakpoint, build full width AppBar icons and labels.
if (ResponsiveBreakpoints.of(context).largerThan(MOBILE))
FullWidthAppBarItems()
// Booleans
ResponsiveBreakpoints.of(context).isDesktop;
ResponsiveBreakpoints.of(context).isTablet;
ResponsiveBreakpoints.of(context).isMobile;
ResponsiveBreakpoints.of(context).isPhone;
// Conditionals
ResponsiveBreakpoints.of(context).equals(DESKTOP)
ResponsiveBreakpoints.of(context).largerThan(MOBILE)
ResponsiveBreakpoints.of(context).smallerThan(TABLET)
ResponsiveBreakpoints.of(context).between(MOBILE, TABLET)
...
Customization
You can define your own breakpoint labels and use them in your conditionals.
For example, if you're building a Material 3 Navigation Rail and want to expand the menu to full width once there is enough room, you can add a custom EXPAND_SIDE_PANEL breakpoint.
breakpoints: [
...
const Breakpoint(start: 801, end: 1920, name: DESKTOP),
const Breakpoint(start: 900, end: 900, name: 'EXPAND_SIDE_PANEL') <- Custom label.
const Breakpoint(start: 1921, end: double.infinity, name: '4K'),
...
]
Then, in your code, show the Rail based on the breakpoint condition.
expand: ResponsiveBreakpoints.of(context).largerThan('EXPAND_SIDE_PANEL')
Responsive Framework Widgets
The ResponsiveFramework includes a few custom widgets that supplement Flutter's responsive capabilities. Their usages are showcased in the demo projects.
Legacy ReadMe (v0.2.0 and below)
ResponsiveWrapper Migration
The remainder of the legacy ReadMe is preserved below as the concepts are still useful and used by the new widgets. ResponsiveWrapper has been deprecated and removed.
The Problem
Supporting multiple display sizes often means recreating the same layout multiple times. Under the traditional Bootstrap approach, building responsive UI is time consuming, frustrating and repetitive. Furthermore, getting everything pixel perfect is near impossible and simple edits take hours.

The Solution
Use Responsive Framework to automatically scale your UI.
ResponsiveBreakpoint.autoScale(600);
AutoScale

AutoScale shrinks and expands your layout proportionally, preserving the exact look of your UI. This eliminates the need to manually adapt layouts to mobile, tablet, and desktop.
ResponsiveBreakpoint.autoScale(600);
Flutter's default behavior is resize which Responsive Framework respects. AutoScale is off by default and can be enabled at breakpoints by setting autoScale to true.
Breakpoints

Breakpoints control responsive behavior at different screen sizes.
ResponsiveWrapper(
child,
breakpoints: [
ResponsiveBreakpoint.resize(600, name: MOBILE),
ResponsiveBreakpoint.autoScale(800, name: TABLET),
ResponsiveBreakpoint.autoScale(1200, name: DESKTOP),
],
)
Breakpoints give you fine-grained control over how your UI displays.
Introductory Concepts
These concepts helps you start using the Responsive Framework and build an responsive app quickly.
Scale vs Resize
Flutter's default behavior is to resize your layout when the screen dimensions change. Resizing a layout stretches it in the direction of an unconstrained width or height. Any constrained dimension stays fixed which is why mobile app UIs look tiny on desktop. The following example illustrates the difference between resizing and scaling.

An AppBar widget looks correct on a phone. When viewed on a desktop however, the AppBar is too short and the title looks too small. Here is what happens under each behavior:
- Resizing (default) - the AppBar's width is double.infinity so it stretches to fill the available width. The Toolbar height is fixed and stays 56dp.
- Scaling - the AppBar's width stretches to fill the available width. The height scales proportionally using an aspect ratio automatically calculated from the nearest
ResponsiveBreakpoint. As the width increases, the height increases proportionally.
When scaled, the AppBar looks correct on desktop, up to a certain size. Once the screen becomes too wide, the AppBar starts to appear too large. This is where breakpoints come in.
Breakpoint Configuration
To adapt to a wide variety of screen sizes, set breakpoints to control responsive behavior.
ResponsiveWrapper(
child,
maxWidth: 1200,
minWidth: 480,
defaultScale: true,
breakpoints: [
ResponsiveBreakpoint.resize(480, name: MOBILE),
ResponsiveBreakpoint.autoScale(800, name: TABLET),
ResponsiveBreakpoint.resize(1000, name: DESKTOP),
ResponsiveBreakpoint.autoScale(2460, name: '4K'),
],
)
An arbitrary number of breakpoints can be set. Resizing/scaling behavior can be mixed and matched.
- below 480: resize on small screens to avoid cramp and overflow errors.
- 480-800: resize on phones for native widget sizes.
- 800-1000: scale on tablets to avoid elements appearing too small.
- 1000+: resize on desktops to use available space.
- 2460+: scale on extra large 4K displays so text is still legible and widgets are not spaced too far apart.
Additional Resources
Resocoder Tutorial
The wonderful people at Resocoder created a great tutorial video and article walking through the usage of
