[英]Flutter constructor error on android studio. It keeps showing error
enter image description here When I try to create a new class in the library of flutter, inside the class the constructor shows error在此处输入图像描述当我尝试在 flutter 的库中创建一个新的 class 时,在 class 中,构造函数显示错误
The problem is that you have your parameters as optionally named, which means the caller can decide not to pass q
or a
, but you also marked them as non-nullable.问题是您的参数是可选命名的,这意味着调用者可以决定不传递q
或a
,但您也将它们标记为不可为空。 Add the required
keyword before your parameters to make sure they're passed in and are non-null, or add a default.在您的参数之前添加required
关键字以确保它们已传入并且不为空,或者添加默认值。
Also, in the future:另外,未来:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.