../../flutter/.pub-cache/hosted/pub.flutter-io.cn/flutter_verification_box-2.0.0/lib/src/verification_box.dart:196:9: Error: The method 'WhitelistingTextInputFormatter' isn't defined for the class '_VerificationBox'.
- '_VerificationBox' is from 'package:flutter_verification_box/src/verification_box.dart' ('../../flutter/.pub-cache/hosted/pub.flutter-io.cn/flutter_verification_box-2.0.0/lib/src/verification_box.dart').
Try correcting the name to the name of an existing method, or defining a method named 'WhitelistingTextInputFormatter'.
WhitelistingTextInputFormatter(RegExp("[0-9]")),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Failed to package /Users/imac/XXX/XXX(项目路径).
Command PhaseScriptExecution failed with a nonzero exit code
- 网上的解决方式:(不过,我试了好几次都没用...) 截屏2022-03-03 下午1.51.05.png
解决方案:
image.png只需更改
WhitelistingTextInputFormatter
为FilteringTextInputFormatter
原文
大概意思是我用的第三方插件使用的一个方法是已经被放弃(已经删掉了)了,所以我们更改插件里面的那个方法就可以(进入插件里面报错的代码里)
....
inputFormatters: [
// WhitelistingTextInputFormatter(RegExp("[0-9]")),//直接删掉这行
FilteringTextInputFormatter.digitsOnly, //添加这个
],
...
网友评论