草庐IT

construct_at

全部标签

flutter : SharedPreferences not fetching value at app start

我正在尝试存储一个值,并根据该值导航到LandinPage或HomePage。但是,当我的应用程序加载时,我无法获得SharedPreferences值。目前,该值是在单击着陆页中的按钮以及关闭/最小化应用程序时设置的。我什至看不到来自main.dart的打印消息,也无法获取值。我究竟做错了什么?这是我的代码:import'package:credit/src/pages/landing.dart';import'package:flutter/material.dart';import'package:credit/src/pages/credit/home.dart';import

flutter - if condition to run Widget at Container flutter

if条件whenpost.text==1我设置了名为exteranews的小部件Widgetexteranews(BuildContextcontext){doublesiz11=15.0*MediaQuery.of(context).size.width/414.0;}如何在容器中使用ifContainer(if(checkothers)child:exteranews(context),),我设置Stringcheckothers=post.text;我读到我必须设置Widget才能使用runexteranews()但是如何使用if条件 最佳答案

firebase - flutter/FirebaseAuth : How can I autologin a user at app launch?

我有以下方法来查看用户是否已经登录,在这种情况下我确实登录了并且getCurrentUser()函数起作用,因为在控制台中它确实返回“USERISNOTNULL”,但home小部件仍然为null,给我“WIDGETSLIBRARY捕获的异常”,表示home不能为null之类的东西。用户API.dartFuturegetCurrentUser()async{FirebaseUseruser=awaitFirebaseAuth.instance.currentUser();if(user!=null){returnuser;}else{returnnull;}}主.dartclassApp

docker - 删除所有停止的容器 : "docker rm" requires at least 1 argument

我正在读一本关于docker的书。几年了。我会引用:Ifyouwanttogetridofallyourstoppedcontainers,youcanusetheoutputofdockerps-aq-fstatus=exited,whichgetstheIDsofallstoppedcontainers.Forexample:$dockerrm-v$(dockerps-aq-fstatus=exited)当我运行它时,我得到:michael@michael-desktop:~$sudodockerrm-v$(dockerps-aq-fstatus=exited)Gotpermiss

docker - 删除所有停止的容器 : "docker rm" requires at least 1 argument

我正在读一本关于docker的书。几年了。我会引用:Ifyouwanttogetridofallyourstoppedcontainers,youcanusetheoutputofdockerps-aq-fstatus=exited,whichgetstheIDsofallstoppedcontainers.Forexample:$dockerrm-v$(dockerps-aq-fstatus=exited)当我运行它时,我得到:michael@michael-desktop:~$sudodockerrm-v$(dockerps-aq-fstatus=exited)Gotpermiss

http - Flutter 内置值反序列化'由于 : Tried to build class but nested builder for field threw: Tried to construct class with null field 而失败

我正在为我的PODO类使用构建值以下是我的代码librarymobile_login_model;import'package:built_value/built_value.dart';import'package:built_value/serializer.dart';part'mobile_login_model.g.dart';abstractclassMobileLoginModelimplementsBuilt{MobileLoginModel._();factoryMobileLoginModel([updates(MobileLoginModelBuilderb)])

Redis messagebus vs. d-bus : what is happening at a low level? 基本上是一样的东西?

老实说,我很惊讶以前没有看到有人讨论过这个问题。我的印象是Redis使用普通的互联网数据包交换到服务器并取回结果,但d-bus使用unix套接字(管道)并叠加一个分布式系统。我想我有一个常见的问题,即哪个更快,但我真的很想知道当我用这两个中的任何一个传递消息时到底发生了什么。两者可能都有优势。有人可以透露一点吗? 最佳答案 这就像讨论MQTT与COM或SOAP与QNX-IPC。D-Bus也有一个基于TCP的网络模式。所以在低层次上它可能是同一件事。但是在本地使用D-Bus时,不涉及网络栈。Redis从普通套接字和弱结构数据库、D-B

python - Tornado -redis : Why the 'listen' and the 'brpop' of tornado-redis can't work at the same time

代码如下:fromtornadoredisimportClientfromtornado.ioloopimportIOLoopfromtornado.genimportcoroutine,Taskrds=Client()@coroutinedeflisten_pub():defhandle(msg):printmsgyieldTask(rds.subscribe,channels='pub')rds.listen(handle)@coroutinedeflisten_list():whileTrue:res=yieldTask(rds.brpop,keys='list')printre

swift - 忽略标志指针 0x10ef76ec0 : no flag found at that address in Xcode 的 RegisterValidateFunction()

我该如何解决这个问题?W072113:54:19.1059281commandlineflags.cc:1503]IgnoringRegisterValidateFunction()forflagpointer0x10ef76ec0:noflagfoundatthataddress 最佳答案 出现此问题是因为您的代码尝试在cocoapod中使用不存在的指针。您可以使用使用cocoapod的框架并在主项目上安装所需的pod。解决方案是使框架和项目中的cocoapods版本相似,在框架和项目中从终端运行podupdate或指定每个pod

iOS swift : How to overlay two images that zoom in at same time without loosing coordinates of overlaying image

我的问题真的很简单......想象一张代表您家周围的街道和建筑物的背景图片,请注意这是专门制作的图片。此图像(View)是可缩放的,到目前为止一切都很好。类似于map,但使用图像代替。现在图像上绘制的街道顶部有代表汽车的标记。这些将随着时间的推移而移动,因此将动态移动。我已经成功地将汽车放置在图像上的正确位置,但是当我放大/缩小时,汽车移出了位置。请注意,我不希望汽车的尺寸发生变化,它们将始终保持不变。本质上,与谷歌地图顶部的map标记非常相似,但我有一张背景图片而不是map,我有其他图像(汽车)而不是标记。现在开始实现...我有一个简单的ScrollableView,其中包含一个Im