草庐IT

mobile_navigation

全部标签

mobile - 如何从 Dart 中的异步数据中提取?

我正在尝试读取文件(异步)并返回数据列表。然后,我想在每个给定的数字都是线高时使用CustomPainter画线(我想画多条线)classBarChartPainterextendsCustomPainter{@overridepaint(Canvascanvas,Sizesize){finalpaint=newPaint()..color=AppColors.primaryColor..style=PaintingStyle.fill;varfuturePath=run();futurePath.then((height){print('1:$height');for(varline

mobile - Flutter Tabs 抛出空指针异常 -> Material.of(context).color 计算为 null

我正在关注找到的flutter画廊中提供的示例expansiona_panels_demo.darthere.我的目标是在扩展面板主体中引入TabBar和TabBarView。截至目前,这正在中断,因为在tabs.dart中抛出了一个空指针异常。这是在_TabBarState中,它正在与widget.indicatorColor进行比较。如果您要查看演示,我将尝试在第251行调用newBookTabs()。if(color.value==Material.of(context).color.value)这里Material.of(context).color为空为了整合代码,我将选项卡

mobile - Flutter Tabs 抛出空指针异常 -> Material.of(context).color 计算为 null

我正在关注找到的flutter画廊中提供的示例expansiona_panels_demo.darthere.我的目标是在扩展面板主体中引入TabBar和TabBarView。截至目前,这正在中断,因为在tabs.dart中抛出了一个空指针异常。这是在_TabBarState中,它正在与widget.indicatorColor进行比较。如果您要查看演示,我将尝试在第251行调用newBookTabs()。if(color.value==Material.of(context).color.value)这里Material.of(context).color为空为了整合代码,我将选项卡

mobile - 卡片布局 - Flutter

我正在尝试使用flutter构建一张卡片,看起来像下面显示的概念,但我得到的却是这个。这是Dart中的卡片小部件代码:@overrideWidgetbuild(BuildContextcontext){returnCenter(child:Card(margin:EdgeInsets.symmetric(horizontal:14.0),color:Colors.white,elevation:6.0,child:InkWell(splashColor:Colors.blue.withAlpha(30),onLongPress:(){_copy();},onTap:(){},child

mobile - 卡片布局 - Flutter

我正在尝试使用flutter构建一张卡片,看起来像下面显示的概念,但我得到的却是这个。这是Dart中的卡片小部件代码:@overrideWidgetbuild(BuildContextcontext){returnCenter(child:Card(margin:EdgeInsets.symmetric(horizontal:14.0),color:Colors.white,elevation:6.0,child:InkWell(splashColor:Colors.blue.withAlpha(30),onLongPress:(){_copy();},onTap:(){},child

flutter/Dart : Customize Bottom Navigation Bar height

有没有办法自定义BottomNavigationBar的高度?我目前有一个BottomNavigationBar,带有用于点击/滑动导航的选项卡,但是默认高度(即使在减少文本和图标之后)还是太高了。@overrideWidgetbuild(BuildContextcontext){returnScaffold(appBar:AppBar(backgroundColor:Colors.blue,title:Text('RefLog',style:Styles.headerLarge),actions:[newIconButton(icon:Icon(Icons.list),onPress

flutter/Dart : Customize Bottom Navigation Bar height

有没有办法自定义BottomNavigationBar的高度?我目前有一个BottomNavigationBar,带有用于点击/滑动导航的选项卡,但是默认高度(即使在减少文本和图标之后)还是太高了。@overrideWidgetbuild(BuildContextcontext){returnScaffold(appBar:AppBar(backgroundColor:Colors.blue,title:Text('RefLog',style:Styles.headerLarge),actions:[newIconButton(icon:Icon(Icons.list),onPress

android - 未放置在第一个 Activity 中时,Flutter Navigation push Replacement 不起作用

我有几个页面。1.起始页2.第2页3.第3页4.主菜单从1->2.和2->3.我用它来导航:Navigator.of(context).push(newMaterialPageRoute(builder:(BuildContextcontext){returnnewMyPage();},));对于3->4。我想使用它(PushReplacement,不会返回),但它不起作用并且像普通Push一样工作:Navigator.of(context).pushReplacement(newMaterialPageRoute(builder:(BuildContextcontext){retur

android - 未放置在第一个 Activity 中时,Flutter Navigation push Replacement 不起作用

我有几个页面。1.起始页2.第2页3.第3页4.主菜单从1->2.和2->3.我用它来导航:Navigator.of(context).push(newMaterialPageRoute(builder:(BuildContextcontext){returnnewMyPage();},));对于3->4。我想使用它(PushReplacement,不会返回),但它不起作用并且像普通Push一样工作:Navigator.of(context).pushReplacement(newMaterialPageRoute(builder:(BuildContextcontext){retur

Flutter BLoC : Navigator. 在 build() 方法中弹出 StreamBuilder

我正在遵循BLoC模式并订阅流,并对构建方法中的状态变化使用react。加载数据后,我想关闭屏幕。@overrideWidgetbuild(BuildContextcontext){returnScaffold(appBar:AppBar(title:constText('Bloc'),),body:SafeArea(child:StreamBuilder(stream:_userBloc.user,initialData:UserInitState(),builder:(context,snapshot){if(snapshot.dataisUserInitState){return