isSystemTextScaler function

Matcher isSystemTextScaler({
  1. double? withScaleFactor,
})

Asserts that the object is a TextScaler that reflects the user's font scale preferences from the platform's accessibility settings.

This matcher is useful for verifying the text scaling within a widget subtree respects the user accessibility preferences, and not accidentally being shadowed by a MediaQuery with a different type of TextScaler.

In widget tests, the value of the system font scale preference can be changed via TestPlatformDispatcher.textScaleFactorTestValue.

If withScaleFactor is specified and non-null, this matcher also asserts that the TextScaler's' textScaleFactor equals withScaleFactor.

Implementation

Matcher isSystemTextScaler({double? withScaleFactor}) {
  return _IsSystemTextScaler(withScaleFactor);
}