作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
=2.12.0 file; 最佳答案 这是第一个; (_formKey.currentState!.validate(-6ren">
我刚刚在 pubspec.yaml 中更新了我的最小 sdk;
sdk: ">=2.12.0 <3.0.0"
现在我必须通过声明 ?在所有字符串和整数上。
但是我应该用 formkey 做什么呢?
if (_formKey.currentState.validate())
这是 Android Studio 告诉我的内容,但我不确定将 ? 放在哪里
The method 'validate' can't be unconditionally invoked because the receiver can be 'null'. Try making the call conditional (using '?.') or adding a null check to the target ('!').
知道我应该如何将此行转换为空安全吗?
那这个呢?
Future<File> file;
最佳答案
这是第一个;
(_formKey.currentState!.validate())
还有下一个;
late Future<File> file;
关于_formKey.currentState.validate() 上的 Flutter/Dart Null 安全性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67592350/
我刚刚在 pubspec.yaml 中更新了我的最小 sdk; sdk: ">=2.12.0 file; 最佳答案 这是第一个; (_formKey.currentState!.validate(
我是一名优秀的程序员,十分优秀!