GranularLayout constructor

GranularLayout(
  1. double size, {
  2. int xxLarge = 1600,
  3. int xLarge = 1200,
  4. int large = 769,
  5. int medium = 481,
  6. int small = 321,
})

Creates a GranularLayout with the respective breakpoint sizes, each representing a Breakpoint instance of value type GranularBreakpoint.

Implementation

GranularLayout(
  double size, {
  int xxLarge = 1600,
  int xLarge = 1200,
  int large = 769,
  int medium = 481,
  int small = 321,
})  : assert(xxLarge > xLarge),
      assert(xLarge > large),
      assert(large > medium),
      assert(medium > small),
      super(
        size: size,
        breakpoints: [
          Breakpoint(xxLarge, value: GranularBreakpoint.xxLarge),
          Breakpoint(xLarge, value: GranularBreakpoint.xLarge),
          Breakpoint(large, value: GranularBreakpoint.large),
          Breakpoint(medium, value: GranularBreakpoint.medium),
          Breakpoint(small, value: GranularBreakpoint.small),
          // Note that the last breakpoint is always created from a `null` value, representing the smallest possible
          // size, which in this case is [GranularBreakpoint.xSmall], and this occurs to be the [breakpointValue]
          // when the [size] argument is smaller than the [small] breakpoint.
          const Breakpoint(null, value: GranularBreakpoint.xSmall),
        ],
      );