maybeTextScaleFactorOf static method

  1. @Deprecated('Use maybeTextScalerOf 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? maybeTextScaleFactorOf(
  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 null, 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 maybeOf, because using this function will only rebuild the context when this specific attribute changes, not when any attribute changes.

Implementation

@Deprecated(
  'Use maybeTextScalerOf 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? maybeTextScaleFactorOf(BuildContext context) => _maybeOf(context, _MediaQueryAspect.textScaleFactor)?.textScaleFactor;