../../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(項(xiàng)目路徑).
Command PhaseScriptExecution failed with a nonzero exit code
-
網(wǎng)上的解決方式:(不過蔬蕊,我試了好幾次都沒用...)截屏2022-03-03 下午1.51.05.png
解決方案:
只需更改
WhitelistingTextInputFormatter
為FilteringTextInputFormatter
原文
image.png
大概意思是我用的第三方插件使用的一個方法是已經(jīng)被放棄(已經(jīng)刪掉了)了肚菠,所以我們更改插件里面的那個方法就可以(進(jìn)入插件里面報錯的代碼里)
....
inputFormatters: [
// WhitelistingTextInputFormatter(RegExp("[0-9]")),//直接刪掉這行
FilteringTextInputFormatter.digitsOnly, //添加這個
],
...