textScaleFactorOf static method

  1. @Deprecated('Use textScalerOf instead. ' 'Use of textScaleFactor was deprecated in preparation for the upcoming nonlinear text scaling support. ' 'This feature was deprecated after v3.12.0-2.0.pre.')
double textScaleFactorOf(
  1. BuildContext context
)

Deprecated. Will be removed in a future version of Flutter. Use maybeTextScalerOf instead.

Returns MediaQueryData.textScaleFactor for the nearest MediaQuery ancestor or 1.0, if no such ancestor exists.

Use of this method will cause the given context to rebuild any time that the MediaQueryData.textScaleFactor property of the ancestor MediaQuery changes.

Prefer using this function over getting the attribute directly from the MediaQueryData returned from of, because using this function will only rebuild the context when this specific attribute changes, not when any attribute changes.

Implementation

@Deprecated(
  'Use textScalerOf instead. '
  'Use of textScaleFactor was deprecated in preparation for the upcoming nonlinear text scaling support. '
  'This feature was deprecated after v3.12.0-2.0.pre.',
)
static double textScaleFactorOf(BuildContext context) => maybeTextScaleFactorOf(context) ?? 1.0;