android-studio - 尝试颤动的 Widget 时,抛出 NoSuchMethodError 说 The method '_debugTypesAreRight' was called on null
问题描述
我正在尝试一个简单的颤振飞镖程序。我指的是本教程,我该如何解决这个问题?
得到以下异常
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(),
),
),
);
}
}
解决方案
这是一个内部错误,而不是您的代码有问题。尝试以下操作:
flutter upgrade && # use latest version
flutter packages get && # pub_get all packages
flutter clean && # delete caches
flutter build # rebuild
推荐阅读
- javascript - 如何在 rd 谷歌地图插件中包含谷歌地图 API 密钥
- javascript - 如何在 React Material-ui 日期选择器中设置日期按钮的样式
- angularjs - 为什么 gulp-main-npm-files 看不到 angular-spinkit?
- c# - 如何使用 SQL 计数功能
- angular - 使用时无法提交值输入(更改)
- python - 如何解决django自定义用户登录错误:CSRF验证失败。请求中止
- sorting - Xslt:在利用数据之前重写树以对不同父母中的子属性进行排序
- excel - 从具有动态属性的单元格中提取字符
- wordpress - WordPress 网站中的标题图像不会显示在 iPhone 上
- vba - Word模板:覆盖书签信息