The WhitelistingTextInputFormatter.digitsOnly is deprecated and should be replaced with FilteringTextInputFormatter.digitsOnly
Abhilash-Chandran opened this issue · comments
The WhitelistingTextInputFormatter
is deprecated in the flutter dev channel 1.21.0-9.0.pre, This will be case in the upcoming stable release of 1.21.0 which according to flutters release cycle be in November. So this should be handled alongside the respective flutter stable release.
https://github.com/Abhilash-Chandran/number_inc_dec/blob/master/lib/src/number_increment_decrement.dart#L619
Following is the current version of this part of code.
inputFormatters: <TextInputFormatter>[
widget.isInt
? WhitelistingTextInputFormatter.digitsOnly
: WhitelistingTextInputFormatter(
RegExp("[0-9.]"),
)
],
The above should be replaced with the respective FilteringTextInputFormatter
as the deprecation warning suggests.
Note this fix can only be released stable release in which this change
FilteringTextInputFormatter
is available. So it can't be release prior to that. A hotfix release can be made when the stable release is out earlier than expected(Novermber) 😄
Looks like this change is already in the stable release.
Will fix this in the next release itself.