草庐IT

zii-widgets

全部标签

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

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

widget - 带有嵌套 TabBarView 的 Flutter ListView

我正在尝试布局我的flutter应用程序,使其看起来像:-ListView-WidgetA-DefaultTabBarController-Column-TabBar-Expanded-TabBarView-WidgetB-WidgetC使整个屏幕可滚动,WidgetsA、B、C的内容可以改变,屏幕高度不固定。我能够让它工作的唯一方法是做类似的事情:-ListView-WidgetA-Container(withfixedheight)-Column-Expanded-DefaultTabBarController-Column-TabBar-Expanded-TabBarView-W

widget - 带有嵌套 TabBarView 的 Flutter ListView

我正在尝试布局我的flutter应用程序,使其看起来像:-ListView-WidgetA-DefaultTabBarController-Column-TabBar-Expanded-TabBarView-WidgetB-WidgetC使整个屏幕可滚动,WidgetsA、B、C的内容可以改变,屏幕高度不固定。我能够让它工作的唯一方法是做类似的事情:-ListView-WidgetA-Container(withfixedheight)-Column-Expanded-DefaultTabBarController-Column-TabBar-Expanded-TabBarView-W

user-interface - 如何将Widget注入(inject)自定义子Widget并使用子Widgets迭代索引?

我正在构建一个flutter应用程序。我已经构建了一个带有构造函数的类。我制作了构造函数,因此我可以自定义我的ListTile,因为我将此类用于多个页面,每次我都需要更改文本颜色,有时甚至添加一个onTap函数。classAppListextendsStatefulWidget{@overrideAppListStatecreateState()=>AppListState();AppList({Keykey,this.child}):super(key:key);finalWidgetchild;}classAppListStateextendsState{Widgetchild;L

user-interface - 如何将Widget注入(inject)自定义子Widget并使用子Widgets迭代索引?

我正在构建一个flutter应用程序。我已经构建了一个带有构造函数的类。我制作了构造函数,因此我可以自定义我的ListTile,因为我将此类用于多个页面,每次我都需要更改文本颜色,有时甚至添加一个onTap函数。classAppListextendsStatefulWidget{@overrideAppListStatecreateState()=>AppListState();AppList({Keykey,this.child}):super(key:key);finalWidgetchild;}classAppListStateextendsState{Widgetchild;L