visual-studio-code - 我收到错误,例如超出最大调用大小它可以正常运行,但是当调用 resultscreen 时,它会在模拟器中出现此错误
问题描述
导入“包:测验/result.dart”;
类 quizscreen 扩展 StatefulWidget { quizscreen(int i, {Key?key}) : super(key: key);
@override _quizscreenState createState() => _quizscreenState(); }
类 _quizscreenState 扩展状态 { var i = 1;
var colorofbutton = '白色'; 变量分数 = 0;
of(context).pushReplacement(MaterialPageRoute(builder: (context) => resultscreen(score), )); } setState(() { i++; }); 打印(分数);},孩子:文本(数据[1][i.toString()][“a”],样式:TextStyle(颜色:Colors.white,fontSize:16.0,),maxLines:1,),颜色:Colors.grey [900],splashColor:Colors.grey,形状:RoundedRectangleBorder(borderRadius:BorderRadius.circular(20.0)),),),容器(填充:EdgeInsets.fromLTRB(50,0,50,20),孩子:MaterialButton(onPressed : () { if (data[2][i.toString()] == data[1][i.toString()]["b"]) { score += 5; } else if (i > 5) { Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (context) => resultscreen(score), )); } setState(() { i++; }); print(score); }, child: Text(data [1][i.toString()]["b"],样式:TextStyle(颜色:Colors.white,fontSize:16.0,),() { if (data[2][i.toString()] == data[1][i.toString()]["d"]) { score += 5; } setState(() { if (i < 10) { i++; } else { Navigator.of(context) .pushReplacement(MaterialPageRoute( builder: (context) => resultscreen(score), )); } }); 打印(分数);},子:文本(数据[1][i.toString()][“d”],样式:TextStyle(颜色:Colors.white,fontSize:16.0,),maxLines:1,),颜色:Colors.grey [900],splashColor:Colors.grey,形状:RoundedRectangleBorder(borderRadius:BorderRadius.circular(20.0)),),),]));} }), ); } } TextStyle(颜色:Colors.white,fontSize:16.0,),maxLines:1,),颜色:Colors.grey[900],splashColor:Colors.grey,形状:RoundedRectangleBorder(borderRadius:BorderRadius.circular(20.0)),) , ), ])); } }), ); } } TextStyle(颜色:Colors.white,fontSize:16.0,),maxLines:1,),颜色:Colors.grey[900],splashColor:Colors.grey,形状:RoundedRectangleBorder(borderRadius:BorderRadius.circular(20.0)),) , ), ])); } }), ); } }
解决方案
推荐阅读
- node.js - 如何在猫鼬中为模式类型日期分配日期值
- algorithm - Big-o 复杂性问题 - 线性累积功率
- node.js - NodeJS 执行一个提示键盘输入的 bash 脚本
- java - 如何在 `var` 关键字上抑制此警告?
- mysql - 调用未定义的方法 PDO::last_Insert_Id()
- python - python在检查文件夹时如何跳过符号链接
- windows - 如何获取与 PNPDeviceID ("SWD\MyEnumerator\MyInstance") 对应的 DeviceName ("\\.\DISPLAY1")?
- react-native - 反应原生平面列表如何强制列表项具有相同的高度?
- reactjs - 如何设置具有多个选项的 Material UI Select 组件的 size 属性?
- javascript - Firebase 实时数据库中的云函数