我尝试在 {AbsorbPointer} (特别是 {GestureDetector} onPanEnd)调用的 'fling' 函数的 SetState() 内使用 'showGeneralDialog' 编写动画对话框脚本。我附加了简单的代码,我尝试用未来的异步等待等来完成它,但可能我不明白。
\n“child: EasyDialog”在我的代码中定义为 void 函数。\n这是我的调试控制台和附加的代码
\n如果有人能指导我如何在 setState 期间完成动画(pageBuilder),我会很高兴。
\n[38;5;248m\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90 Exception caught by widgets library \xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90[39;49m\n[38;5;244mThe following assertion was thrown building Builder(dirty, dependencies: [_LocalizationsScope-[GlobalKey#3e9b6]]):[39;49m\nsetState() or markNeedsBuild() called during build.\n\n[38;5;244mThis Overlay widget cannot be marked as needing to build because the framework is already in the process of building widgets. A widget can be marked as needing to be built during the build phase only if one of its …Run Code Online (Sandbox Code Playgroud) 我尝试编写生成数组随机值并显示在小部件卡上的代码(每次打开时都会显示 array{string} 中的另一个值)。实际上,代码从数组中选择一个单元格一次,每次我打开小部件它显示了与第一个选择的相同的小部件(没有更改)我使用 slimycard 包(https://pub.dev/packages/slimy_card)
// in 'homepage' class widget build
child: StreamBuilder(
initialData: false,
stream: slimyCard.stream,
builder: ((BuildContext context, AsyncSnapshot snapshot) {
return ListView(
padding: EdgeInsets.only(top: 150),
children: <Widget>[
// SlimyCard is being called here.
SlimyCard(
color: Colors.transparent.withOpacity(0.2),
topCardHeight: 450,
width: 400,
topCardWidget: topCardWidget(),
bottomCardWidget: bottomCardWidget(),
),
],
);
}),
)
// the widget I want to change his text every time he's opened.
Widget bottomCardWidget() {
return FutureBuilder(
future: _getfromlist(widget.mode),
initialData: 'loading..',
builder: (BuildContext context, AsyncSnapshot<String> …Run Code Online (Sandbox Code Playgroud)