init static method
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,
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;
}