错误代码展示
jumpToPage(String itemNameList) {
switch(itemNameList){
case "AnimatedContainer":
Navigator.push(context, MaterialPageRoute(
builder: (context) => new AnimatedContainerPage()));
break;
}
修改为
jumpToPage(BuildContext context,String itemNameList) {
switch(itemNameList){
case "AnimatedContainer":
Future.delayed(Duration.zero, () {
Navigator.push(context, MaterialPageRoute(
builder: (context) => new AnimatedContainerPage()));
});
break;
}
解决问题