我正在尝试导航到相机屏幕,当我触发导航时,我收到错误消息 Another exception was thrown: type 'Future<dynamic>' is not a subtype of type 'Widget'
Another exception was thrown: setState() or markNeedsBuild() called during build. 该错误指向我所在的上一个页面的导航。 我也在那里看到了这个错误 The AnimationController notifying status listen
我在小工具开始时加载指示器有问题。在我的例子中,我异步下载了一些initState格式的数据,然后setState将_loading设置为false。
我想用导航器对话框来控制它的显示和消失。
错误:
The following assertion was thrown building NotificationView(dirty, dependencies: [_LocalizationsScope-[GlobalKey#e97a5], _InheritedTheme], state: _NotificationStateView#5dbc7):
setState() or markNee
我有一个简单的测试,谁打开新的页后,4000毫秒从init。但是我有这个UI错误
following _TypeError was thrown building WithPages(dirty, dependencies: [MediaQuery], state: _WithPages#6c08e):
type 'Future<dynamic>' is not a subtype of type 'Widget'
这是我的密码
@override
void initState() {
Future.delayed(const Du
我是Flutter的新手。我在构造函数中调用future方法时遇到了问题。我创建了一个方法,它返回一个依赖于所选项目的小部件类。问题是我需要多次调用这个方法,第一次是构建body,第二次是更新body。但是我看到错误"type ' Future‘is not a subtype of type 'Widget'“如果我添加了void类型而不是Future类型,它将被执行一次来创建一个主体。代码片段:
class DataPageState extends State<DataPage> {
....
_tables() async {
我已经建立了一个主屏幕与正在使用ListView.builder渲染卡。这些卡有一个确认按钮,可以从firestore获取确认状态。当我点击confirm按钮时,会出现一个底部的页面,询问我是否确定。点击底部页面上的Yes后,我希望重建homepage上的卡,并将按钮从confirm更改为confirm。 我在onPressed事件中使用setState更改了值,它成功地更改了该值,但是确认按钮没有更改为confirmed。 任何关于如何解决这个问题的线索都将不胜感激。 主页卡片布局 class HomepageCards extends StatefulWidget {
final F
我面临着滚动条的问题,数据加载列表在底部,而不是在顶部显示。我已经使代码动态,这是根据条件加载。我是新手,我已经从不同的角度写了代码,并且还在学习中,如果你想给我建议用更好的方式写,请继续让我知道我可以做的变化。
class EventsPageState extends State<EventsPage>
with SingleTickerProviderStateMixin {
int theirGroupValue = 0;
List data = List();
String url = 'https://e19f7c9d.ngrok.io/