Closed jakobleck closed 7 months ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
activity
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
activity
Accessibility text sizes in system settings are currently not really supported by
PinCodeTextField
: The field does not resize to accommodate very large text, which is thus clipped. Currently a workaround for this was to setfontSize
in thetextStyle
to the intended font size (20.0, usually) divided by thetextScaleFactor
, such that fontSize * textScaleFactor would yield 20.0. With the introduction ofTextScaler
and deprecation oftextScaleFactor
in the latest Flutter versions this is no longer a viable solution. (In mathematical terms: The mentioned workaround uses the multiplicative inverse oftextScaleFactor
, while with the potentially nonlineartextScaler
an inverse is difficult to find and not guaranteed to exist.)Thus, expose
textScaler
of thePinCodeTextField
to allow setting it toTextScaler.noScaling
. (This PR does not include a scaling for the validator as I'm not sure how to do this and do not need it.)To test, just add
in the
PinCodeTextField
of the example app and run on a device where in system settings you set font size to the maximum (preferrably iOS, which allows more radical sizes than Android, at least on the devices I tested). Tested with Flutter 3.16.0.P.S.: You may need to upgrade deployment targets or Gradle version for the example app.