我会在扑朔迷离中创建和验证动态形式,但是当我更改页面并返回上一页时,我会遇到错误。我该如何解决
它在发行模式下工作,但我在调试模式下会出现错误
class UrunHizmetWidget extends StatefulWidget {
int index;
final state = _UrunHizmetWidgetState();
UrunHizmetWidget({Key? key, this.index = 0}) : super(key: key);
@override
State<UrunHizmetWidget> createState() => state;
bool isvalid() => state.validator();
}
**错误消息**
The following assertion was thrown building NotificationListener<KeepAliveNotification>:
The createState function for UrunHizmetWidget returned an old or invalid state instance: UrunHizmetWidget, which is not null, violating the contract for createState.
'package:flutter/src/widgets/framework.dart':
package:flutter/…/widgets/framework.dart:1
Failed assertion: line 4860 pos 7: 'state._widget == null'
It works in release mode but I get an error in debug mode
class UrunHizmetWidget extends StatefulWidget {
int index;
final state = _UrunHizmetWidgetState();
UrunHizmetWidget({Key? key, this.index = 0}) : super(key: key);
@override
State<UrunHizmetWidget> createState() => state;
bool isvalid() => state.validator();
}
**Error Message **
The following assertion was thrown building NotificationListener<KeepAliveNotification>:
The createState function for UrunHizmetWidget returned an old or invalid state instance: UrunHizmetWidget, which is not null, violating the contract for createState.
'package:flutter/src/widgets/framework.dart':
package:flutter/…/widgets/framework.dart:1
Failed assertion: line 4860 pos 7: 'state._widget == null'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我希望这可以帮助您解决问题
I hope this could help you to solve your problem