setDefault static method

dynamic setDefault({
  1. double xs = kXSMaxWidth,
  2. double sm = kSMMaxWidth,
  3. double md = kMDMaxWidth,
  4. double lg = kLGMaxWidth,
  5. double xl = kXLMaxWidth,
})

Sets the default values for the AdaptiveSettings class.

This method must be called before the AdaptiveSettings class is used.

The default values are:

If any of the values are not provided, the default values will be used.

The values must satisfy the following constraints:

  • xl > lg
  • lg > md
  • md > sm
  • sm > xs
  • xs > 0

Implementation

static setDefault({
  final double xs = kXSMaxWidth,
  final double sm = kSMMaxWidth,
  final double md = kMDMaxWidth,
  final double lg = kLGMaxWidth,
  final double xl = kXLMaxWidth,
}) {
  assert(xl > lg, 'XL must be greater than LG');
  assert(lg > md, 'LG must be greater than MD');
  assert(md > sm, 'MD must be greater than SM');
  assert(sm > xs, 'SM must be greater than XS');
  assert(xs > 0, 'XS must be greater than 0');
  _adaptive = AdaptiveSettings(xs: xs, sm: sm, md: md, lg: lg, xl: xl);
}