草庐IT

WP_Widget

全部标签

android-studio - 当尝试 flutter 的 Widget 时,抛出 NoSuchMethodError 说 The method '_debugTypesAreRight' was called on null

我正在尝试一个简单的flutterdart程序。我指的是this教程,我该如何解决这个问题?获取以下异常I/flutter(4785):══╡EXCEPTIONCAUGHTBYWIDGETSLIBRARY╞═══════════════════════════════════════════════════════════I/flutter(4785):ThefollowingNoSuchMethodErrorwasthrownattachingtotherendertree:I/flutter(4785):Themethod'_debugTypesAreRight'wascalled

dart - 从 Flutter 中的 List<Widget> 中删除 Index wise CustomWidget

我最初在Column中有一个空的Widget列表。现在在其他小部件上单击我正在_contactItems中添加新的自定义小部件Column(children:_contactItems,)List_contactItems=newList();_contactItems.add(newCustomWidget(value));现在假设我有6条记录(列中有6个自定义小部件)。我正在尝试删除索引记录(示例。我先删除第3条记录,然后删除第1条记录。列小部件(动态小部件)应更新为_contactItems在setState()中更新)现在在CustomWidget上单击我正在从Column中删

dart - 从 Flutter 中的 List<Widget> 中删除 Index wise CustomWidget

我最初在Column中有一个空的Widget列表。现在在其他小部件上单击我正在_contactItems中添加新的自定义小部件Column(children:_contactItems,)List_contactItems=newList();_contactItems.add(newCustomWidget(value));现在假设我有6条记录(列中有6个自定义小部件)。我正在尝试删除索引记录(示例。我先删除第3条记录,然后删除第1条记录。列小部件(动态小部件)应更新为_contactItems在setState()中更新)现在在CustomWidget上单击我正在从Column中删

dart - 使用 Inherited Widget 时如何处理 bloc?

我使用bloc和InheritedWidget制作了一个简单的应用程序。以下是代码classBloc{finalStreamController_changeColor=PublishSubject();Function(bool)getchangeColour=>_changeColor.sink.add;Streamgetcolour=>_changeColor.stream;voiddispose(){_changeColor.close();}}classProviderextendsInheritedWidget{finalbloc=Bloc();Provider({Keyk

dart - 使用 Inherited Widget 时如何处理 bloc?

我使用bloc和InheritedWidget制作了一个简单的应用程序。以下是代码classBloc{finalStreamController_changeColor=PublishSubject();Function(bool)getchangeColour=>_changeColor.sink.add;Streamgetcolour=>_changeColor.stream;voiddispose(){_changeColor.close();}}classProviderextendsInheritedWidget{finalbloc=Bloc();Provider({Keyk

flutter - 错误 : Could not find the correct Provider above this widget

这个屏幕是一个抽屉屏幕,它采用authblock来为用户提供信息并使他能够注销。尽管我使用了正确的提供程序,但我还是收到了这个错误ThefollowingProviderNotFoundErrorwasthrownbuildingPets4allDrawer(dirty):I/flutter(32011):Error:CouldnotfindthecorrectProviderabovethisPets4allDrawerWidgetI/flutter(32011):Tofix,please:I/flutter(32011):*EnsuretheProviderisanancestor

flutter - 错误 : Could not find the correct Provider above this widget

这个屏幕是一个抽屉屏幕,它采用authblock来为用户提供信息并使他能够注销。尽管我使用了正确的提供程序,但我还是收到了这个错误ThefollowingProviderNotFoundErrorwasthrownbuildingPets4allDrawer(dirty):I/flutter(32011):Error:CouldnotfindthecorrectProviderabovethisPets4allDrawerWidgetI/flutter(32011):Tofix,please:I/flutter(32011):*EnsuretheProviderisanancestor

widget - 如何在 Card 对象上使用 Dismissible

如果我有一个Card对象,我如何在其上使用Dismissable小部件以便当用户刷卡时它执行onDismissed函数,我尝试了以下示例但它要求key的标识符:Widgetbuild(BuildContextcontext){returnnewDismissible(child:newCard(//somecode),key:/*howthisworks*/);}这是否可行? 最佳答案 如docs中所述一个Dismissible需要一个键来将它与其他Dismissible区分开来。IftheDismissibleisalistite

widget - 如何在 Card 对象上使用 Dismissible

如果我有一个Card对象,我如何在其上使用Dismissable小部件以便当用户刷卡时它执行onDismissed函数,我尝试了以下示例但它要求key的标识符:Widgetbuild(BuildContextcontext){returnnewDismissible(child:newCard(//somecode),key:/*howthisworks*/);}这是否可行? 最佳答案 如docs中所述一个Dismissible需要一个键来将它与其他Dismissible区分开来。IftheDismissibleisalistite

Flutter MaterialApp Widget 参数中的本地化

按照1上的教程进行操作和2我正在尝试为我的flutter应用程序设置本地化。效果很好,我可以使用I18n.of(context).trans()访问我的小部件中的翻译字符串。但是我不知道如何访问MaterialApp中的翻译顶部小部件:import'package:flutter/material.dart';import'package:flutter_app/i18n/i18n.dart';import'package:flutter_app/views/menu.dart';import'package:flutter\_localizations/flutter\_locali