草庐IT

widget_type

全部标签

flutter - Scaffold.of 会找到远距离的 widget anestors 吗?

我正在尝试了解有关BuildContext和Scaffold.of()的更多信息。我了解到,当您显示SnackBar时,您通常需要添加一个Builder以获取您添加的脚手架“下”的上下文。因此:classMyScreenextendsStatelessWidget{build(BuildContextcontext){returnScaffold(body:Builder(builder:(context)=>RaisedButton(child:Text('pushme'),onPressed:()=>Scaffold.of(context).showSnackBar(SnackBa

【vue3 + vite】: Invalid VNode type: undefined (undefined)

在使用vue3注册全局组件的时候,使用 app.component注册组件在使用的时候会报:InvalidVNodetype:undefined(undefined)的错误。constcomponents=import.meta.glob("../components/form/*.vue");functionautoRegisterComponents(app:App){Object.entries(components).forEach(([file,module])=>{constname=file.split("/").pop()?.replace(/.vue/,"")asstring

exception - setState() 或 markNeedsBuild() 被调用 > 当 widget 树被锁定时。改变状态时

请看我的代码:classHomePageStateextendsState{bool_isLoading=false;.....@overrideWidgetbuild(BuildContextcontext){vardrawerOptions=[];......drawerOptions.add(newListTile(leading:newIcon(Icons.account_balance),title:newText(Strings.menu_change_city),onTap:()=>createDialog()));if(_isLoading)returnbuildBus

exception - setState() 或 markNeedsBuild() 被调用 > 当 widget 树被锁定时。改变状态时

请看我的代码:classHomePageStateextendsState{bool_isLoading=false;.....@overrideWidgetbuild(BuildContextcontext){vardrawerOptions=[];......drawerOptions.add(newListTile(leading:newIcon(Icons.account_balance),title:newText(Strings.menu_change_city),onTap:()=>createDialog()));if(_isLoading)returnbuildBus

http - 未处理的异常 : type 'List<String>' is not a subtype of type 'String' in type cast

我正在尝试在我的api中发布一个字符串列表。以下是我的网络代码classDashboardFeeCountApiProviderimplementsDashboardFeeCountSource{@overrideFuturegetDashboardFees(Stringtype,StringuserId,StringyearId,ListfeeCategoryId)async{finalresponse=awaithttp.post(DASHBOARD_FEE_URL,body:{"type":"1","userid":userId,"yearId":yearId,"fee_cat_

http - 未处理的异常 : type 'List<String>' is not a subtype of type 'String' in type cast

我正在尝试在我的api中发布一个字符串列表。以下是我的网络代码classDashboardFeeCountApiProviderimplementsDashboardFeeCountSource{@overrideFuturegetDashboardFees(Stringtype,StringuserId,StringyearId,ListfeeCategoryId)async{finalresponse=awaithttp.post(DASHBOARD_FEE_URL,body:{"type":"1","userid":userId,"yearId":yearId,"fee_cat_

firebase - flutter 问题 : type 'Timestamp' is not a subtype of type 'DateTime'

我正在为我和我的团队正在开发的应用程序寻求帮助。数周以来,我们一直面临以下问题:fluttertype'Timestamp'isnotasubtypeoftype'DateTime'我们想从CloudFirestore获取这些用户数据:出生[日期时间]性别[字符串]许可[日期时间]姓名[字符串]大小[字符串]重量[字符串]只有birth和license在CloudFirestore中存储为1681720252,因此我们将这些数据解析为[DateTime]。这是获取用户数据的代码:import'package:cloud_firestore/cloud_firestore.dart';c

firebase - flutter 问题 : type 'Timestamp' is not a subtype of type 'DateTime'

我正在为我和我的团队正在开发的应用程序寻求帮助。数周以来,我们一直面临以下问题:fluttertype'Timestamp'isnotasubtypeoftype'DateTime'我们想从CloudFirestore获取这些用户数据:出生[日期时间]性别[字符串]许可[日期时间]姓名[字符串]大小[字符串]重量[字符串]只有birth和license在CloudFirestore中存储为1681720252,因此我们将这些数据解析为[DateTime]。这是获取用户数据的代码:import'package:cloud_firestore/cloud_firestore.dart';c

flutter - Dismissible widget 动画与页面推送动画重叠

我在稳定channel中使用Flutter1.2.1,并且有一个ListView,其中包含使用Dismissible创建的项目小部件。每个项目都可以向右拖动以删除,向左拖动以进行编辑。为了确保在向左拖动进行编辑时项目不会被删除,我使用了构造函数参数confirmDismiss,它采用一个回调函数来确定Dismissible是否应该实际被解雇。在这个confirmDismiss回调中,我检查拖动方向是否向左,如果是,然后我导航到Edit页面以编辑项目.问题是当导航动画发生时(到Edit页面)将Dismissable项目移回列表的动画与它重叠,使它看起来有问题.发生这种情况是因为我的con

flutter - Dismissible widget 动画与页面推送动画重叠

我在稳定channel中使用Flutter1.2.1,并且有一个ListView,其中包含使用Dismissible创建的项目小部件。每个项目都可以向右拖动以删除,向左拖动以进行编辑。为了确保在向左拖动进行编辑时项目不会被删除,我使用了构造函数参数confirmDismiss,它采用一个回调函数来确定Dismissible是否应该实际被解雇。在这个confirmDismiss回调中,我检查拖动方向是否向左,如果是,然后我导航到Edit页面以编辑项目.问题是当导航动画发生时(到Edit页面)将Dismissable项目移回列表的动画与它重叠,使它看起来有问题.发生这种情况是因为我的con