更新时间:2023-11-13 07:57:16
(我假设 BusInformationScreen
应该是 SimpleClass
的构造函数)
(I'm gonna assume BusInformationScreen
is supposed to be the constructor for SimpleClass
)
问题是
var output = ID;
您要设置输出的值
在构建类之前。您可以在初始化列表中进行设置:
You're trying to set the value for output
before the class has been constructed. You can set it in the initializer list instead :
SimpleClass({this.ID}):
output= ID;