草庐IT

child_fspath

全部标签

flutter - 不确定数量的 child 的堆栈对齐

我正在flutter中构建一个应用程序,我正在做的部分工作是从服务器获取操作列表,然后为每个操作构建按钮。我试图在一个圆圈中显示按钮并生成一个凸起按钮小部件列表。然后我尝试使用Stack将此列表布置成一个圆圈,但是当我不知道我将拥有多少个对象(我知道它将在一个范围约为3-15)。这是我的堆栈的构建方法。假设所有方法、列表和变量都被正确定义并且有效。我只关心对齐@overrideWidgetbuild(BuildContextcontext){Listactions=[];for(varactioninwidget.actionsList){actions.add(RaisedButto

Flutter 列小部件 : childs with different heights

我正在尝试创建一个小型测试应用程序,其中有一个较大的中央区域,我将在该区域上渲染图像,而较小的底部区域将包含一个水平可滚动的小部件列表。这是代码:import'dart:convert';import'package:flutter/material.dart';import'package:http/http.dart'ashttp;import'dart:async';import'dart:isolate';import'package:fluttertoast/fluttertoast.dart';import'package:photo_app_ui_test/fxmanag

dart - 我正在尝试为每个 child 使用带有单独 MainAxisValues 的 flutter 行小部件,但它不起作用

Row(mainAxisAlignment:MainAxisAlignment.values[MainAxisAlignment.start,MainAxisAlignment.start,MainAxisAlignment.end],children:[Container(width:40,height:40,child:DecoratedBox(decoration:BoxDecoration(borderRadius:BorderRadius.all(Radius.circular(40.0)),color:Colors.teal,image:DecorationImage(im

flutter - 如何在没有错误的情况下缩小 parent 忽略 child 的大小

我想将容器设置为高度0的动画。我希望child缩小到它,但显然它会抛出溢出像素错误。而且我不知道如何让children无误地缩小。我尝试搜索一些像BoxContraints这样的小部件以使其忽略溢出或类似的东西,但我什至不确定该怎么做_topContainerHeight=_queryFieldHasFocus?0:MediaQuery.of(context).size.height/1.75;returnStreamBuilder(stream:_authService.userStream,builder:(context,snapshot){ConnectionStatestat

flutter - 使用 GestureDetector 捕捉 MaterialButton child 的手势

我想要一个MaterialButton来检测onTapDown、onTapUp和onTapCancel。不幸的是MaterialButtons只检测到onPressed。所以我用GestureDetector包裹它,但是对于MaterialButtons,onPressed是@required所以我将它设置为(){}。问题是,即使我将GestureDetector行为设置为半透明,如果我点击按钮,也只有Button的onPressed回调>将被触发,我失去了GestureDetector的onTapDown和onTapUp回调。如果我长按按钮,我只会触发onTapDown,当我松开按钮

dart - Flutter Positioned Transitioned to below other Stack child - 如何获得高度?

我正在执行类似于Codelabsflutterexamplehere的背景样式向下滑动.我希望前景部分停在背景内容的底部。我知道在布局之后才能直接获取高度。由于应用程序从顶部的前景部分开始,我想我可以在构建后获取高度并将其存储在状态中,但我不确定如何执行此操作。这就是我现在所拥有的,只是使用不考虑背景内容高度的预定义“悬垂”:Widget_buildForeground(BuildContextcontext,BoxConstraintsconstraints){AnimationrectAnimation=newRelativeRectTween(begin:newRelativeR

dart - 命名参数 'child' 未定义。在 Center() 构造函数中

我今天运行了flutterupgrade,现在我收到一条错误消息:[dart]Thenamedparameter'child'isn'tdefined.项目是新建的,默认代码没有动,但是还是一样的错误: 最佳答案 通过运行清理项目缓存fluttercleancache然后使缓存无效/重新启动AndroidStudio或VSCode。 关于dart-命名参数'child'未定义。在Center()构造函数中,我们在StackOverflow上找到一个类似的问题:

widget - 小部件库抛出的异常 '!children.any((Widget child) => child == null)' : is not true

您好,我在运行应用程序时遇到以下错误问题的可能原因是什么?══╡EXCEPTIONCAUGHTBYWIDGETSLIBRARY╞═══════════════════════════════════════════════════════════ThefollowingassertionwasthrownbuildingHome(dirty,state:_HomeState#f7a67):'package:flutter/src/widgets/framework.dart':Failedassertion:line1639:'!children.any((Widgetchild)=>

node.js - 从未使用redis在child_process.exec中调用回调

我正在尝试使用带有以下代码的child_process模块从Node启动redis:varchildProcess=require('child_process');childProcess.exec('redis-server--port6380',function(err,stdout,stderr){console.log(err,stdout,stderr);})当我运行它时,永远不会调用回调。我可以看到我的redis-server已经使用psauwx|在端口6380上启动了。grepredis-server所以我不明白为什么没有调用这个回调。请注意,当我在终端中运行redis

ios - Firebase 获取 child ID swift ios

我的Firebase看起来像这样。在Active_Orders下方,它显示childs,其名称根据其UID(用户ID)而不同。这是我用来获取childID(无论名字是什么)的代码。但它似乎根本不起作用。获取childID的正确方法是什么?谢谢databaseRef.child("Active_Orders").observeEventType(FIRDataEventType.Value,withBlock:{snapshotin//GetcustomerUIDletcustomerUID=snapshot.value!.objectForKey("username")as!Strin