- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
来源 1 "View2"-> 来源 2 "View3"-> 包含列表的表格 TL +--6ren">
我有一个列出一些结果的“表格列表”小部件,我想从 2 个不同的来源重用这个小部件。这是方法:
+--------------------+
| Source 1| |
+---------+ +----v-----+
|Table with|
|results |
+---------+ +----+-----+
| Source 2| ^
+--------------------+
每个源都有一个路由,在 TL 中传递信息。
这是 TL 的 build
函数:
@override
Widget build(BuildContext context) {
return CupertinoPageScaffold(
navigationBar: CupertinoNavigationBar(middle: Text('Post Recenti')),
child: PostsTableList(showPostForCategoryID)
);
}
但是当显示 TL 时,我得到了以下错误:
flutter: ══╡ EXCEPTION CAUGHT BY SCHEDULER LIBRARY ╞═════════════════════════════════════════════════════════
flutter: The following assertion was thrown during a scheduler callback:
flutter: There are multiple heroes that share the same tag within a subtree.
flutter: Within each subtree for which heroes are to be animated (typically a PageRoute subtree), each Hero
flutter: must have a unique non-null tag.
flutter: In this case, multiple heroes had the following tag: Default Hero tag for Cupertino navigation bars
flutter: with navigator NavigatorState#090ce(tickers: tracking 2 tickers)
flutter: Here is the subtree for one of the offending heroes:
flutter: # Hero(tag: Default Hero tag for Cupertino navigation bars with navigator NavigatorState#090ce(tickers: tracking 2 tickers), state: _HeroState#4dc1f)
flutter: # └KeyedSubtree-[GlobalKey#9d61d]
flutter: # └_TransitionableNavigationBar-[GlobalKey#f21fd Navigation bar render box]
flutter: # └ClipRect(renderObject: RenderClipRect#5922f relayoutBoundary=up1)
flutter: # └BackdropFilter(renderObject: RenderBackdropFilter#ca8c7 relayoutBoundary=up2)
flutter: # └DecoratedBox(bg: BoxDecoration(color: Color(0xccf8f8f8), border: Border(bottom: BorderSide(Color(0x4c000000), 0.0, BorderStyle.solid))), renderObject: RenderDecoratedBox#0c666 relayoutBoundary=up3)
flutter: # └AnnotatedRegion<SystemUiOverlayStyle>(renderObject: RenderAnnotatedRegion<SystemUiOverlayStyle>#21621 relayoutBoundary=up4)
flutter: # └_PersistentNavigationBar
flutter: # └SizedBox(height: 64.0, renderObject: RenderConstrainedBox#826b3 relayoutBoundary=up5)
flutter: # └SafeArea(avoid left padding, avoid top padding, avoid right padding, avoid bottom padding)
flutter: # └Padding(padding: EdgeInsets(0.0, 20.0, 0.0, 0.0), renderObject: RenderPadding#bebdd)
flutter: # └MediaQuery(MediaQueryData(size: Size(375.0, 667.0), devicePixelRatio: 2.0, textScaleFactor: 1.0, padding: EdgeInsets(0.0, 0.0, 0.0, 50.0), viewInsets: EdgeInsets.zero, alwaysUse24HourFormat: false, accessibleNavigation: falsedisableAnimations: falseinvertColors: falseboldText: false))
flutter: # └NavigationToolbar
flutter: # └CustomMultiChildLayout(renderObject: RenderCustomMultiChildLayoutBox#18992)
flutter: # └LayoutId-[<_ToolbarSlot.middle>](id: _ToolbarSlot.middle)
flutter: # └DefaultTextStyle(inherit: true, color: Color(0xff000000), family: .SF UI Text, size: 17.0, weight: 600, letterSpacing: -0.1, softWrap: wrapping at box width, overflow: clip)
flutter: # └Semantics(container: false, properties: SemanticsProperties, label: null, value: null, hint: null, hintOverrides: null, renderObject: RenderSemanticsAnnotations#abf4c relayoutBoundary=up1)
flutter: # └KeyedSubtree-[GlobalKey#0daf7 Middle]
flutter: # └Text("Categorie")
flutter: # └RichText(softWrap: wrapping at box width, maxLines: unlimited, text: "Categorie", renderObject: RenderParagraph#ad5eb relayoutBoundary=up2)
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #0 Hero._allHeroesFor.visitor.<anonymous closure> (package:flutter/src/widgets/heroes.dart:210:15)
flutter: #1 Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:220:12)
flutter: #2 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3755:14)
flutter: #3 Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:225:15)
flutter: #4 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3755:14)
flutter: #5 Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:225:15)
flutter: #6 MultiChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4948:16)
flutter: #7 Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:225:15)
flutter: #8 SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4848:14)
flutter: #9 Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:225:15)
flutter: #10 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3755:14)
flutter: #11 Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:225:15)
flutter: #12 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3755:14)
flutter: #13 Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:225:15)
flutter: #14 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3755:14)
flutter: #15 Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:225:15)
flutter: #16 SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4848:14)
flutter: #17 Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:225:15)
flutter: #18 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3755:14)
flutter: #19 Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:225:15)
flutter: #20 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3755:14)
flutter: #21 Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:225:15)
flutter: #22 SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4848:14)
flutter: #23 Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:225:15)
flutter: #24 MultiChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4948:16)
flutter: #25 Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:225:15)
flutter: #26 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3755:14)
flutter: #27 Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:225:15)
flutter: #28 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3755:14)
flutter: #29 Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:225:15)
flutter: #30 MultiChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4948:16)
flutter: #31 Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:225:15)
flutter: #32 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3755:14)
flutter: #33 Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:225:15)
flutter: #34 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3755:14)
flutter: #35 Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:225:15)
flutter: #36 SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4848:14)
flutter: #37 Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:225:15)
flutter: #38 ComponentElement.visitChildren (package:flutter/src/widgets/framework.dart:3755:14)
flutter: #39 Hero._allHeroesFor.visitor (package:flutter/src/widgets/heroes.dart:225:15)
flutter: #40 SingleChildRenderObjectElement.visitChildren (package:flutter/src/widgets/framework.dart:4848:14)
flutter: #41 Element.visitChildElements (package:flutter/src/widgets/framework.dart:2686:5)
flutter: #42 Hero._allHeroesFor (package:flutter/src/widgets/heroes.dart:227:13)
flutter: #43 HeroController._startHeroTransition (package:flutter/src/widgets/heroes.dart:655:53)
flutter: #44 HeroController._maybeStartHeroTransition.<anonymous closure> (package:flutter/src/widgets/heroes.dart:630:11)
flutter: #45 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:990:15)
flutter: #46 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:938:9)
flutter: #47 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:842:5)
flutter: #48 _invoke (dart:ui/hooks.dart:154:13)
flutter: #49 _drawFrame (dart:ui/hooks.dart:143:3)
flutter: ════════════════════════════════════════════════════════════════════════════════════════════════════
由于我是 Flutter 的新手,有什么我忘了的吗?是不是我用错了什么?
Searching around我也发现了这个,但是老实说我不知道这是否与它无关:
By default, only one [CupertinoNavigationBar] or [CupertinoSliverNavigationBar]
/// should be present in each [PageRoute] to support the default transitions.
/// Use [transitionBetweenRoutes] or [heroTag] to customize the transition
/// behavior for multiple navigation bars per route.
最佳答案
如错误所述 -
multiple heroes had the following tag: Default Hero tag for Cupertino navigation bars
当您使用 - CupertinoNavigationBar
两次时 - 没有定义 Hero 标签值,因此它选择默认值。默认
。
这里的技巧是将一些唯一的值传递给每个 CupertinoNavigationBar
heroTag:
CupertinoNavigationBar(middle: Text('Post Recenti'),
heroTag: 'uniquevalue',), // Pass different unique value for each
Every source has a route that pass the information inside the TL.
也为 CupertinoNavigationBar heroTag:
传递 Unique 值:
关于flutter - 重复使用内部带有 cupertino 导航栏的小部件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54802114/
这是我的测试用例。 http://tobeythorn.com/isi/dummy2.svg http://tobeythorn.com/isi/isitest.html 如果我自己打开 svg,内部
这是我的测试用例。 http://tobeythorn.com/isi/dummy2.svg http://tobeythorn.com/isi/isitest.html 如果我自己打开 svg,内部
我正在尝试做类似的事情: SELECT SUM( CASE WHEN ( AND EXISTS(SELECT 1
我想问如何在外部 ng-repeat 内部正确使用内部 ng-repeat: 这意味着你想使用这样的东西: {{milestone.id}} {{
我希望在 wordpress 的仪表板内编辑 css 样式并且如果可能的话不必编辑 php 文件。 我知道至少可以编辑一些属性,所以我希望我可以直接在仪表板中编辑所有属性。 更具体地说如何更改自定义类
我在安装在 windows10 上的 vmware 中的 Ubuntu 上安装了伪分布式独立 hadoop 版本。 我从网上下载了一个文件,复制到ubuntu本地目录/lab/data 我在 ubun
我有一个如下所示的 WHERE 语句: WHERE ((@Value1 IS NULL AND [value1_id] IS NULL) OR [value1_id] = ISNULL(@Va
我有一个如下所示的 WHERE 语句: WHERE ((@Value1 IS NULL AND [value1_id] IS NULL) OR [value1_id] = ISNULL(@Va
在我的一些测试帮助程序代码中,我有一个名为 FakeDbSet(Of T) 的 IDbSet(Of T) 实现,它模拟了许多 EF 行为,但没有实际的数据库。我将类声明为 Friend ,因为我想强制
我正在寻找 Cassandra/CQL 的常见 SQL 习语 INSERT INTO ... SELECT ... FROM ... 的表亲。并且一直无法找到任何以编程方式或在 CQL 中执行此类操作
如何防止内部 while 循环无限运行?问题是,如果没有外部 while 循环,内部循环将毫无问题地运行。我知道它必须对外循环执行某些操作,但我无法弄清楚是什么导致了问题。 import java.u
我正在努力学习更多有关 C++ 的知识,但在国际象棋程序中遇到了一些代码,需要帮助才能理解。我有一个 union ,例如: union b_union { Bitboard b; st
这是我项目网页中的代码片段。这里我想显示用户选择的类别,然后想显示属于该类别的主题。在那里,用户可以拥有多个类别,这没有问题。我可以在第一个 while 循环中打印所有这些类别。问题是当我尝试打印主题
我想知道如何在 swing 中显示内部框架。这意味着,当需要 JFrame 时,通常我所做的是, new MyJFrame().setVisible(true); 假设之前的表单也应该显示。当显示这个
我最近发现了一些有趣的行为,这让我想知道对象如何知道存在哪些全局变量。例如,假设我有一个文件“test.py”: globalVar = 1 toDelete = 2 class Test(objec
我知道它已经在这里得到回答: google maps drag and drop objects into google maps from outside the Map ,但这并不完全是我所需要的
我目前正在学习Javascript DOM和innerHTML,发现在理解innerHTML方面存在一些问题。 这是我的代码:http://jsfiddle.net/hphchan/bfjx1w70/
我构建了一个布局如下的库: lib/ private_class_impl.cc private_class_decl.h public_class_impl.cc include/
我有一个使用 bootstrap 3 的组合 wordpress 网站。它基本上是一个图像网格。当屏幕展开时,它会从三列变为四列。移动时它是一列。 我想出了如何调整图像的顶部和底部边距,但我希望图像的
我正在试用 MSP-EXP430G2 的教程程序,使用 Code Composer Studio 使 LED 闪烁。最初,它有一个闪烁的无限循环: for(;;) // This emp
我是一名优秀的程序员,十分优秀!