Android studio 在尝试颤振小部件时,抛出NoSuchMethodError,表示方法'_调试类型右';被调用为空

Android studio 在尝试颤振小部件时,抛出NoSuchMethodError,表示方法'_调试类型右';被调用为空,android-studio,dart,flutter,Android Studio,Dart,Flutter,我正在尝试一个简单的飞镖程序。我指的是教程,如何解决这个问题 获取以下异常 I/flutter ( 4785): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════ I/flutter ( 4785): The following NoSuchMethodError was thrown attaching to the render tree:

我正在尝试一个简单的飞镖程序。我指的是教程,如何解决这个问题

获取以下异常

I/flutter ( 4785): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
I/flutter ( 4785): The following NoSuchMethodError was thrown attaching to the render tree:
I/flutter ( 4785): The method '_debugTypesAreRight' was called on null.
I/flutter ( 4785): Receiver: null
I/flutter ( 4785): Tried calling: _debugTypesAreRight(Instance of 'RealWorldApp')
代码是:

import 'package:flutter/material.dart';

void main() => runApp(new RealWorldApp());

class RealWorldApp extends StatefulWidget {
  @override
  RealWorldState createState() => new RealWorldState();

}
 class RealWorldState extends State<RealWorldApp>
  {
  @override
  Widget build(BuildContext context) {
  return new MaterialApp(
    home: new Scaffold(
      appBar: new AppBar(
        title: new Text("First App"),
        actions: <Widget>[
          new IconButton(icon: new Icon(Icons.refresh),
          )
        ],
      ),
      body: new Center(
        child: new CircularProgressIndicator(),
      ),
    ),
  );
  }

  }
导入“包装:颤振/材料.省道”;
void main()=>runApp(新的RealWorldApp());
类RealWorldApp扩展了StatefulWidget{
@凌驾
RealWorldState createState()=>新的RealWorldState();
}
类RealWorldState扩展了状态
{
@凌驾
小部件构建(构建上下文){
返回新材料PP(
家:新脚手架(
appBar:新的appBar(
标题:新文本(“第一个应用”),
行动:[
新图标按钮(图标:新图标(图标.刷新),
)
],
),
正文:新中心(
子项:新的CircularProgressIndicator(),
),
),
);
}
}

这是一个内部错误,您的代码没有问题。请尝试以下操作:

flatter升级&&#使用最新版本
颤振包获得&&#pub#获得所有包
颤振清理和删除缓存
颤振建造#重建