我有一个小部件,当点击时,保存一个ID号,覆盖1000ms的CircularProgressIndicator,然后弹出进度指示器,并将用户路由到另一个页面。
这个带有ProgressIndicator和计时器的位是新的,它破坏了我的单元测试,现在给出了以下错误:
The following assertion was thrown running a test:
'package:flutter_test/src/binding.dart': Failed assertion: line 574 pos 12: '() {
'A Timer is
我有一个小部件,它需要访问外部的RestorableBool。在我的应用程序中,我可以使用提供对该属性的小部件访问。这是因为RestorableBool是RestorableProperty的一个(间接)子类,它是一个ChangeNotifier。
示例:
class _MyWidgetState extends State<MyWidget> with RestorationMixin {
final RestorableBool _importantState = RestorableBool(false);
@override
String? get resto
在我的例子中,当我使用ExpansionPanelList时,我需要检查面板内的小部件是否可见。 如果不可见,tester.tap(find.text('More Info'))将抛出异常: Warning: A call to tap() with finder "exactly one widget with text "More Info" (ignoring offstage widgets): Text("More Info", dependencies: [MediaQuery, DefaultTextStyle])"
我正在尝试使用Sliver来实现可折叠的列表头。当我将小部件从普通窗口小部件更改为小窗口窗口小部件时,我经常会出现这样的错误:
I/flutter ( 3141): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
I/flutter ( 3141): The following assertion was thrown building NotificationListener<ScrollNotification>():
I/f