init static method

void init(
  1. BoxConstraints constraints, {
  2. Size baseSize = const Size(390, 850),
  3. bool respectSystemFontScale = true,
  4. bool scaleLayoutWithFont = true,
  5. double factor = 0.5,
  6. double textScaleFactor = 1.0,
  7. CustomScaleFunction? customScale,
})

Implementation

static void init(
  BoxConstraints constraints, {
  Size baseSize = const Size(390, 850),
  bool respectSystemFontScale = true,
  bool scaleLayoutWithFont = true,
  double factor = 0.5,
  double textScaleFactor = 1.0,
  CustomScaleFunction? customScale,
}) {
  final screenShort = math.min(constraints.maxWidth, constraints.maxHeight);
  final baseShort = math.min(baseSize.width, baseSize.height);

  _instance._shortRatio = screenShort / baseShort;
  _instance._factor = factor;
  _instance._customScale = customScale;
  _instance._screenWidth = constraints.maxWidth;
  _instance._screenHeight = constraints.maxHeight;

  _instance._effectiveTextScaleFactor =
      (respectSystemFontScale && scaleLayoutWithFont) ? textScaleFactor : 1;
}