@@ -16,7 +16,7 @@ Supporting multiple display sizes often means recreating the same layout multipl
1616### The Solution
1717Use Responsive Framework to automatically scale your UI.
1818
19- > ResponsiveBreakpoint(breakpoint: 600, ** autoScale: true ** );
19+ > ** ResponsiveBreakpoint.autoScale (breakpoint: 600); **
2020
2121## Demo
2222
@@ -42,14 +42,12 @@ class MyApp extends StatelessWidget {
4242 return MaterialApp(
4343 builder: (context, widget) => ResponsiveWrapper.builder(
4444 maxWidth: 1200,
45- minWidth: 450 ,
45+ minWidth: 480 ,
4646 defaultScale: true,
4747 breakpoints: [
48- ResponsiveBreakpoint(breakpoint: 450, name: MOBILE),
49- ResponsiveBreakpoint(breakpoint: 800, name: TABLET, scale: true),
50- ResponsiveBreakpoint(breakpoint: 1000, name: TABLET, scale: true),
51- ResponsiveBreakpoint(breakpoint: 1200, name: DESKTOP),
52- ResponsiveBreakpoint(breakpoint: 2460, name: "4K", scale: true),
48+ ResponsiveBreakpoint.resize(breakpoint: 480, name: MOBILE),
49+ ResponsiveBreakpoint.autoScale(breakpoint: 800, name: TABLET),
50+ ResponsiveBreakpoint.resize(breakpoint: 1000, name: DESKTOP),
5351 ],
5452 background: Container(color: Color(0xFFF5F5F5))),
5553 initialRoute: "/",
@@ -67,7 +65,7 @@ AutoScale shrinks and expands your layout *proportionally*, preserving the exact
6765This eliminates the need to manually adapt layouts to mobile, tablet, and desktop.
6866
6967` ` ` dart
70- ResponsiveBreakpoint(breakpoint: 600, autoScale: true );
68+ ResponsiveBreakpoint.autoScale (breakpoint: 600);
7169` ` `
7270
7371Flutter'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`.
@@ -82,9 +80,9 @@ Breakpoints control responsive behavior at different screen sizes.
8280ResponsiveWrapper(
8381 child,
8482 breakpoints: [
85- ResponsiveBreakpoint(breakpoint: 600, name: MOBILE, autoScale: false ),
86- ResponsiveBreakpoint(breakpoint: 800, name: TABLET, autoScale: true ),
87- ResponsiveBreakpoint(breakpoint: 1200, name: DESKTOP, autoScale: false ),
83+ ResponsiveBreakpoint.resize (breakpoint: 600, name: MOBILE),
84+ ResponsiveBreakpoint.autoScale (breakpoint: 800, name: TABLET),
85+ ResponsiveBreakpoint.autoScale (breakpoint: 1200, name: DESKTOP),
8886 ],
8987)
9088` ` `
@@ -115,23 +113,22 @@ To adapt to a wide variety of screen sizes, set breakpoints to control responsiv
115113ResponsiveWrapper(
116114 child,
117115 maxWidth: 1200,
118- minWidth: 450 ,
116+ minWidth: 480 ,
119117 defaultScale: true,
120118 breakpoints: [
121- ResponsiveBreakpoint(breakpoint: 450, name: MOBILE),
122- ResponsiveBreakpoint(breakpoint: 800, name: TABLET, scale: true),
123- ResponsiveBreakpoint(breakpoint: 1000, name: TABLET, scale: true),
124- ResponsiveBreakpoint(breakpoint: 1200, name: DESKTOP),
125- ResponsiveBreakpoint(breakpoint: 2460, name: "4K", scale: true),
119+ ResponsiveBreakpoint.resize(breakpoint: 480, name: MOBILE),
120+ ResponsiveBreakpoint.autoScale(breakpoint: 800, name: TABLET),
121+ ResponsiveBreakpoint.resize(breakpoint: 1000, name: DESKTOP),
122+ ResponsiveBreakpoint.autoScale(breakpoint: 2460, name: '4K'),
126123 ],
127124)
128125` ` `
129126
130127An arbitrary number of breakpoints can be set. Resizing/scaling behavior can be mixed and matched.
131- - below 450 : resize on small screens to avoid cramp and overflow errors.
132- - 800-450 : resize on phones for native widget sizes.
133- - 1000- 800 : scale on tablets to avoid elements appearing too small.
134- - 1200- 1000 : resize on desktops to use available space.
128+ - below 480 : resize on small screens to avoid cramp and overflow errors.
129+ - 480-800 : resize on phones for native widget sizes.
130+ - 800-1000 : scale on tablets to avoid elements appearing too small.
131+ - 1000+ : resize on desktops to use available space.
135132- 2460+ : scale on extra large 4K displays so text is still legible and widgets are not spaced too far apart.
136133
137134# # About
0 commit comments