responsiveLayout method
Widget
responsiveLayout({
- Key? key,
- Alignment alignment = Alignment.topCenter,
- Widget? background,
- Color? backgroundColor,
- List<
ResponsiveBreakpoint> ? breakpoints, - List<
ResponsiveBreakpoint> ? breakpointsLandscape, - bool debugLog = false,
- String? defaultName,
- String? defaultNameLandscape,
- bool defaultScale = true,
- ResponsiveDouble defaultScaleFactor = const ResponsiveDouble(s: 1, m: 1.15, xm: 1.2, l: 1.1),
- ResponsiveDouble? defaultScaleFactorLandscape,
- bool? defaultScaleLandscape = true,
- List<
ResponsiveTargetPlatform> ? landscapePlatforms, - MediaQueryData? mediaQueryData,
- bool shrinkWrap = true,
- bool useShortestSide = false,
- ResponsiveDouble? minWidth,
- ResponsiveDouble? maxWidth,
- ResponsiveDouble? minWidthLandscape,
- ResponsiveDouble? maxWidthLandscape,
Implementation
Widget responsiveLayout({
Key? key,
Alignment alignment = Alignment.topCenter,
Widget? background,
Color? backgroundColor,
List<ResponsiveBreakpoint>? breakpoints,
List<ResponsiveBreakpoint>? breakpointsLandscape,
bool debugLog = false,
String? defaultName,
String? defaultNameLandscape,
bool defaultScale = true,
ResponsiveDouble defaultScaleFactor = const ResponsiveDouble(
s: 1,
m: 1.15,
xm: 1.2,
l: 1.1,
),
ResponsiveDouble? defaultScaleFactorLandscape,
bool? defaultScaleLandscape = true,
List<ResponsiveTargetPlatform>? landscapePlatforms,
MediaQueryData? mediaQueryData,
bool shrinkWrap = true,
bool useShortestSide = false,
ResponsiveDouble? minWidth,
ResponsiveDouble? maxWidth,
ResponsiveDouble? minWidthLandscape,
ResponsiveDouble? maxWidthLandscape,
}) =>
Layout(builder: (layoutSize, context, boxConstraints) {
return ResponsiveWrapper(
alignment: alignment,
background: background,
backgroundColor: backgroundColor,
breakpoints: breakpoints ??
[
// ResponsiveBreakpoint.resize(LayoutSize.xl.value, name: "4K"),
],
breakpointsLandscape: breakpointsLandscape,
debugLog: debugLog,
defaultName: defaultName,
defaultNameLandscape: defaultNameLandscape,
defaultScale: defaultScale,
defaultScaleFactor: defaultScaleFactor.get(layoutSize),
defaultScaleFactorLandscape:
defaultScaleFactorLandscape?.getIfNotZero(layoutSize),
defaultScaleLandscape: defaultScaleLandscape,
key: key,
landscapePlatforms: landscapePlatforms,
mediaQueryData: mediaQueryData,
shrinkWrap: shrinkWrap,
useShortestSide: useShortestSide,
minWidth: (minWidth ??
ResponsiveDouble(
s: LayoutSize.xs.value,
xxs: LayoutSize.xxs.value + 150,
m: LayoutSize.m.value + 150,
xm: LayoutSize.xm.value + 150,
l: LayoutSize.l.value + 200,
xl: LayoutSize.xl.value + 300,
xxl: LayoutSize.xxl.value + 300,
h: LayoutSize.h.value + 250,
))
.getIfNotZero(layoutSize) ??
450,
maxWidth: maxWidth?.getIfNotZero(layoutSize),
minWidthLandscape: (minWidthLandscape ??
ResponsiveDouble(
s: LayoutSize.xs.value,
xxs: LayoutSize.xxs.value + 150,
m: LayoutSize.m.value + 150,
xm: LayoutSize.xm.value + 150,
l: LayoutSize.l.value + 200,
xl: LayoutSize.xl.value + 300,
xxl: LayoutSize.xxl.value + 300,
h: LayoutSize.h.value + 250,
))
.getIfNotZero(layoutSize),
maxWidthLandscape: maxWidthLandscape?.getIfNotZero(layoutSize),
child: this,
);
});