草庐IT

dart-async

全部标签

dart - 无法在列中居中文本小部件

在我的MaterialApp中,我在水平ListView中有一个Column。在Column中是一个Text小部件。ListView(children:[Column(children:[Text('thisisthetextwidget'),//hereIhaveanotherwidgetplaced,justimaginearectangle],],)textAlign:TextAlign.center,或用Center包围它都不会改变Text的位置。Text将始终位于左上角。此外,我在类似问题的答案中看到了很多关于轴对齐的信息,但我尝试了我看到的所有轴设置,但都没有成功。如您所见

dart - WebView 进入 SizedBox Flutter

我想在flutter中将自定义webview添加到sizedBox中......我已经尝试这样做但是出现错误:代码:@overrideWidgetbuild(BuildContextcontext){SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom]);returnnewScaffold(key:_scaffoldKey,floatingActionButton:newRow(mainAxisSize:MainAxisSize.min,children:[newGestureDetector(child:ne

dart - Flutter:如何在英雄动画期间更改子元素的大小?

我有一个Hero,它有一个子元素,我想在英雄动画中更改大小(在本例中,我希望更改其纵横比)。这是我的(简化的)构建方法:Widgetbuild(BuildContextbuild){finalaspect=expanded?1.3:1.0;returnnewHero(child:Column(children:[newAspectRatio(aspect:aspect,child://Stuffthatcreatesaheader),newContainer(child://Generaldescriptions)],);}现在,纵横比在两个值之间跳跃。我的问题是,我能否将方面与英雄动

dart - Flutter 错误 - 内核二进制格式版本无效(找到 4 个,预期为 6 个)

在升级flutter后运行我的应用程序时出现此错误。错误:无效的内核二进制格式版本(找到4个,预期为6个)我目前在master,我尝试将分支切换到beta`。仍然没有帮助。这是堆栈跟踪。2018-05-2815:22:46.214821+0530Runner[579:57143]../../third_party/dart/runtime/vm/kernel_binary.cc:39:error:Invalidkernelbinaryformatversion(found4,expected6)2018-05-2815:22:46.214912+0530Runner[579:57143

dart - 在 flutter 中为 MapView 设置高度

我是flutter的新手,我尝试通过从Git引用以下示例来在flutter中实现MapView“flutter_google_map_view-master”通过点击静态View,mapView以全屏View加载,但我想为mapView设置高度和宽度。 最佳答案 它在flutterSDK中不可用。谷歌地图默认打开方式Flutter团队致力于自定义高度和宽度。 关于dart-在flutter中为MapView设置高度,我们在StackOverflow上找到一个类似的问题:

dart - flutter 中的导航器错误(抽屉按钮注销)

我有一个抽屉,我像这样在我所有的StatefulWidget中共享@overrideWidgetbuild(BuildContextcontext){returnnewScaffold(key:_scaffoldKey,drawer:SharedDrawer()...//Morecode在抽屉里,我放了一个注销按钮,将用户重定向到登录页面,像这样清理所有路由器堆栈。Navigator.of(context).pop();Navigator.of(context).pushNamedAndRemoveUntil('/',(Routeroute)=>false);但是当我尝试再次登录应用程

dart - 下载数据并保存在本地

我在将文件从可下载链接保存到手机本地存储时遇到问题。我的计划是创建一个将下载afile的Button.然后,我想将它保存到手机的内部存储,以便可以访问来自手机的文件存储系统。我尝试使用SharedPreferences来实现它,但这并不是我真正想要的。谁能告诉我如何执行此功能?非常感谢。 最佳答案 不需要使用SharedPreferences因为它是一个键/值数据库。在您的情况下,您正在尝试将文件写入磁盘,因此您需要一些库:HTTPclient这样你就可以发出网络请求dart:io库,以便您可以将文件写入磁盘path_provide

dart - 当 Child Widget 调用 Push Named 时,Widget 正在重建

这是我的主屏幕小部件构建@overrideWidgetbuild(BuildContextcontext){print("Rebuiltrootwidget");switch(authStatus){caseAuthStatus.notSignedIn:returnChild1(auth:widget.auth,onSignedIn:_signedIn,);caseAuthStatus.signedIn:returnChild2(auth:widget.auth,onSignedOut:_signedOut,);}}returnnull;}这是从我的“Child2”小部件调用的一段代码

dart - flutter ListView 中的无限高度

嗨,friend们,我是Flutter开发的新手,我正在使用ListView,请找到这张图片Pleasecheckthisimage我想删除图像上方和下方的空白区域,使它在这个空白区域上拉伸(stretch)我试图调整大小框但它给出的错误是double.infinity无法使用请找到下面的代码请帮助我friendnewSliverList(delegate:newSliverChildBuilderDelegate((BuildContextcontext,intindex){returnnewGestureDetector(onTap:(){Navigator.push(contex

dart - dart 中的流落后一步

我读了FilipHracek@filiph的一篇文章OnedisadvantagethatstemsfromtheasynchronicityofstreamsisthatwhenyoubuildaStreamBuilder,italwaysshowsinitialDatafirst(becauseitisavailablesynchronously)andonlythendoesitshowthefirsteventcomingfromtheStream.Thiscanleadtoaflash(oneframe)ofmissingdata.Therearewaystopreventt