Flutter笔记-There are multiple heroes that share the same tag within a subtree
在使用FloatingActionButton时报错了
floatingActionButton: Row(mainAxisAlignment: MainAxisAlignment.center,crossAxisAlignment: CrossAxisAlignment.center,children: <Widget>[FloatingActionButton(onPressed: () => _addItem(),child: Icon(Icons.add),),SizedBox(width: 60,),FloatingActionButton(onPressed: () => _removeItem(),child: Icon(Icons.remove),),],),
报错内容:
════════ Exception caught by scheduler library ═════════════════════════════════
The following assertion was thrown during a scheduler callback:
There are multiple heroes that share the same tag within a subtree.Within each subtree for which heroes are to be animated (i.e. a PageRoute subtree), each Hero must have a unique non-null tag.
In this case, multiple heroes had the following tag: <default FloatingActionButton tag>
Here is the subtree for one of the offending heroes: Herotag: <default FloatingActionButton tag>state: _HeroState#2520e
主要问题是在使用多个FloatingActionButton
时heroTag
需是唯一的。
解决方案:
floatingActionButton: Row(mainAxisAlignment: MainAxisAlignment.center,crossAxisAlignment: CrossAxisAlignment.center,children: <Widget>[FloatingActionButton(heroTag: 'first',onPressed: () => _addItem(),child: Icon(Icons.add),),SizedBox(width: 60,),FloatingActionButton(heroTag: 'second',onPressed: () => _removeItem(),child: Icon(Icons.remove),),
Flutter笔记-There are multiple heroes that share the same tag within a subtree相关推荐
- Flutter: There are multiple heroes that share the same tag within a subtree异常
今天写Demo的时候遇到了下面的错误: I/flutter: ══╡ EXCEPTION CAUGHT BY SCHEDULER LIBRARY ╞══════════════════════════ ...
- Flutter典型错误:There are multiple heroes that share the same tag within a subtree.
这段错误信息描述通常如下:'Within each subtree for which heroes are to be animated (i.e. a PageRoute subtree), ea ...
- Flutter报错总结:There are multiple heroes that share the same tag within a subtree.
最近在项目中遇到了问题:点击每个页面都显示黑屏,并且控制台报错:There are multiple heroes that share the same tag within a subtree. ...
- There are multiple heroes that share the same tag within a subtree.
There are multiple heroes that share the same tag within a subtree. 情况一:报错由于FloatingActionButton的her ...
- Another exception was thrown: There are multiple heroes that share the same tag w
报错: I/flutter (18994): Another exception was thrown: There are multiple heroes that share the same t ...
- flutter笔记:使用flutter webvie
flutter笔记:使用flutter webvie 作者: jcLee95 CSDN 主页:https://blog.csdn.net/qq_28550263?spm=1001.2101.3001. ...
- flutter笔记1 VScode安装dart code插件踩坑记录
新手菜鸟一枚,想从产品转入技术坑,目标:移动端APP开发.最近听技术达人 飞狐 说flutter beta发布了,于是乎零基础入坑~话说想提高英文水平的同学,请移步flutter官网,从知道flutt ...
- flutter笔记4:使用material原生控件开发一个APP
接着上一篇,我们做一个这样的APP: 开始之前,我发现了一个好玩的东西,每次我们在终端中输入命令: flutter run 终端里会有这个东西: 按照上图所示,我们的进入这个网页看看是个啥: 好高大上 ...
- Flutter 笔记 | Flutter 文件IO、网络请求、JSON、日期与国际化
文件IO操作 Dart的 IO 库包含了文件读写的相关类,它属于 Dart 语法标准的一部分,所以通过 Dart IO 库,无论是 Dart VM 下的脚本还是 Flutter,都是通过 Dart I ...
最新文章
- 重磅!公开课|四旋翼飞行器:算法与实战
- .中英文系统底层编码导致乱码问题
- malloc、calloc、realloc和free
- python pip安装失败vtk_安装最新的VTK库验证安装出错该怎么解决
- P4852-yyf hates choukapai【单调队列优化dp】
- ffmpeg图片缩放
- ubuntu mysql 多硬盘_ubuntu下磁盘空间不足导致mysql无法启动的解决方法
- oracle语法和sql的区别吗,ORACLE和SQL语法区别归纳
- 浅析tomcat原理
- 【java】面向程序员的 10 大 Java 书籍 — 历久弥新
- docker快速搭建http服务器
- 一文搞懂 UndeclaredThrowableException
- 计算机网络:第四章 网络层
- Excel 入门基础
- 浅谈如何使用Google reCAPTCHA进行人机验证
- Unity 用什么IDE比较好?
- 民间秘术——可怕的死亡诅咒
- 路飞学城-Python爬虫实战密训-第1章
- CMakeLists学习二、链接库搜索路径与ld
- 爬虫实战入门级教学(数据爬取->数据分析->数据存储)
热门文章
- soot代码分析框架的基础知识(一)
- mysql餐饮管理系统设计_酒店餐饮管理系统的设计与实现(MySQL)(含录像)
- pythonjava有什么区别_python,java,go语言之间的区别!
- 画论92 张大千《画论》
- 既然知道失去才觉得美好,为什么不珍惜现在
- 《乔布斯传》英文原著重点词汇笔记(一)【 Introduction 】
- 亲手实践图片木马之捆绑工具(BD2.Net Injector By BD2)
- Alcohol 120%刻录教程:制作镜像文件
- 提高睡眠质量的助眠好物,双十一值得买的助眠好物
- 滴滴开源的深度与温度——滴滴开源委员会秘书长吴国斌专访