responsiveLayout method

Widget responsiveLayout({
  1. Key? key,
  2. Alignment alignment = Alignment.topCenter,
  3. Widget? background,
  4. Color? backgroundColor,
  5. List<ResponsiveBreakpoint>? breakpoints,
  6. List<ResponsiveBreakpoint>? breakpointsLandscape,
  7. bool debugLog = false,
  8. String? defaultName,
  9. String? defaultNameLandscape,
  10. bool defaultScale = true,
  11. ResponsiveDouble defaultScaleFactor = const ResponsiveDouble(s: 1, m: 1.15, xm: 1.2, l: 1.1),
  12. ResponsiveDouble? defaultScaleFactorLandscape,
  13. bool? defaultScaleLandscape = true,
  14. List<ResponsiveTargetPlatform>? landscapePlatforms,
  15. MediaQueryData? mediaQueryData,
  16. bool shrinkWrap = true,
  17. bool useShortestSide = false,
  18. ResponsiveDouble? minWidth,
  19. ResponsiveDouble? maxWidth,
  20. ResponsiveDouble? minWidthLandscape,
  21. 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,
      );
    });