我正在尝试制作一个简单的聊天应用程序,所以我创建了一个脚手架,然后将身体作为消息,bottomNavigationBar将其作为输入字段和发送图标。
我添加了一个文本字段,但键入时导航栏被键盘隐藏了。
这是我的代码BottomNavigationBar:
bottomNavigationBar: new Container(
height: ScreenSize.height/12,
/*color: Colors.red,*/
child: new Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
new Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
new Container(
child: new Icon(Icons.send),
width:ScreenSize.width/6,
),
],
),
new Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Material(
child: new Container(
child: new TextField(
autofocus: false,
decoration: InputDecoration(
contentPadding: EdgeInsets.all(9.0),
border: InputBorder.none,
hintText: 'Please enter a search term',
),
),
width:ScreenSize.width*4/6,
),
elevation: 4.0,
/*borderRadius: new BorderRadius.all(new Radius.circular(45.0)),*/
clipBehavior: Clip.antiAlias,
type: MaterialType.card,
)
],
), …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 pino 登录到我的节点应用程序服务器,并且我确实收到了一些大型日志,因此每天轮换文件对于以后读取日志会更有用。
我可以使用摩根做到这一点,但使用皮诺我找不到办法做到这一点。我尝试根据当前日期动态分配文件夹,但在主 app.js 文件中这样做意味着它只会运行一次,循环日期意味着停止并重新运行服务器。
这是我的代码:
var date = d.getFullYear()+'-'+(d.getMonth()+1)+'-'+d.getDate();
const fileLogger = pino(
pino.destination({
dest: './log/userLog '+date, sync: false
})
);
Run Code Online (Sandbox Code Playgroud) 我正在做一个带有角度2和打字稿的离子2应用程序,我不得不使用离子/ Cordova提供的全球化插件.在第二次加载应用程序时确定首选语言时,插件始终会遇到错误.
因此错误情况是这样的:我将手机的语言从英语更改为法语并运行我的应用程序.该应用程序完美无瑕,该插件检测到我使用的是法语.我关闭应用程序并再次重新打开它然后插件检测到错误并捕获它然后以警报的形式显示它.
这事儿常常发生.
这是我用来检测语言的代码:
let ln='';
this.globalization.getPreferredLanguage()
.then(res => {ln =res.value;
console.log(ln);
if(ln.substring(0,2) ==='fr'){
this.translate.setDefaultLang('fr');
this.translate.reloadLang('fr');
localStorage.setItem("lang","1");
}else{
if(ln.substring(0,2)==="en"){
this.translate.setDefaultLang('en');
this.translate.reloadLang('en');
localStorage.setItem("lang","2");
}else{
this.translate.setDefaultLang('en');
this.translate.reloadLang('en');
localStorage.setItem("lang","2");
}
}
})
.catch(e => {
console.log(e);
this.translate.setDefaultLang('en');
this.translate.reloadLang('en');
localStorage.setItem("lang","2");
let altert= this.AlertC.create({
title: "Language selection problem" ,
message: "We have encountered an error in identifying your preferred language, so we put it to english as default.",
buttons: [
{
text: 'OK',
handler: () => {
console.log('Cancel clicked');
}
},
]
});
altert.present(); …Run Code Online (Sandbox Code Playgroud) Zen Archlinux我正在尝试在我的内核版本上运行 hashcat 4.15.4-1-zen。我有一个 NVIDIA Geforce 920MX 和一个 Intel i6189DU。我安装了最新的nvidia-dkms驱动程序和opencl-nvidia软件包。我还安装了最新的 Hashcat 版本。
当我运行 hashcat 命令时,我收到此错误:clGetPlatformIDs(): CL_PLATFORM_NOT_FOUND_KHR。我使用一个工具来确定可用的 openCL 平台clinfo,输出仅显示我的 CPU 平台,而不显示我的 GPU,但该hashcat命令仍然输出相同的错误。
有什么帮助吗?
我在手势检测器内使用 listView 时遇到问题。我试图根据 listView 的拖动方向执行一个函数。它不起作用,事件甚至没有被触发,因为显然拖动事件正在由列表视图处理。
我如何告诉 listView 不要这样做并忽略拖动事件,因为我只是希望我的项目位于彼此之下,实际上没有列表。
我是否只是切换到其他小部件并忘记列表,或者有解决方案吗?
这是我的代码:
return new GestureDetector(
child: Material(
elevation: 12.0,
borderRadius: widget.frontLayerBorderRadius,
child: Stack(
children: <Widget>[
new ListView(
children: <Widget>[
widget.enableAddingInactiveAreaToPanelWhenOpened?isTopPanelVisible?InactiveAreaWidget:new Container():new Container(),
widget.frontLayer,
],
),
_buildInactiveLayer(context,InactiveAreaWidget),
],
),
),
onVerticalDragEnd: (details) {
print(details);
if(details.velocity.pixelsPerSecond.dy>0.0){
showBackLayer();
}
},
);
Run Code Online (Sandbox Code Playgroud) 我目前正在做一个带有离子2 angular2和Typescript的应用程序.在启动我的应用程序的速度时,我有一个很大的问题.当我为dev或prod环境构建应用程序并将其安装在任何设备上时,需要花费大量时间来加载.
当我启动应用程序时,它显示一个长时间停留的白色屏幕,这真的很烦人,因为用户不会等待那么长时间.
我确实删除了splashscreen cordova插件,并在config.xml中将splashscreen延迟更改为0,但仍然需要花费很多时间才能加载.
在启动我的应用程序时,只会执行几个Get请求.这是我目前的Config.xml
<widget id="com.ionicframework.comvltapp596066" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>com.vlt.app</name>
<description>An awesome Ionic/Cordova app.</description>
<author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>
<content src="index.html" />
<access origin="*" />
<allow-navigation href="http://ionic.local/*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
<preference name="webviewbounce" value="false" />
<preference name="UIWebViewBounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
<preference name="android-minSdkVersion" value="16" />
<preference name="BackupWebStorage" value="none" />
<preference name="SplashMaintainAspectRatio" value="true" />
<preference name="FadeSplashScreenDuration" value="2" />
<preference name="SplashShowOnlyFirstTime" value="true" /> …Run Code Online (Sandbox Code Playgroud) 更新具有多个子级的单个父级小部件与单独更新每个子级小部件之间的性能差异是什么?
哪个性能更高以及性能提高了多少:
StreamBuilder(
stream:sameStream,
builder(ctx,snapshot){
return Column(
children:[
Text("1"),
Text("2"),
Text("3")
]
)
}
)
Run Code Online (Sandbox Code Playgroud)
或者
Column(
children:[
StreamBuilder(
stream:sameStream,
builder(ctx,snapshot){
return Text("1"):
}
),
StreamBuilder(
stream:sameStream,
builder(ctx,snapshot){
return Text("2"):
}
),
StreamBuilder(
stream:sameStream,
builder(ctx,snapshot){
return Text("3"):
}
)
]
)
Run Code Online (Sandbox Code Playgroud)
另一个问题:如果我们将子窗口部件缩放到 100 会发生什么?性能有变化吗?
我正在使用离子3和文件插件做一个应用程序,我试图写一个json字符串到我的资产文件夹下的json文件,这个层次结构:-assets - > mock - > msg-list.json,资产为来自离子文件的文件夹.
使用文件插件时:
this.file.writeExistingFile("file://android_asset/www/assets/mock/","msg-list.json",JSON.stringify(data))
.catch(
error => {
console.log(error);
}
);
Run Code Online (Sandbox Code Playgroud)
我总是得到代码1000的错误,这是坏网址的一个,我确实删除文件后的"/":(已经有3)仍然得到1000代码错误.
我该怎么办 ?
我最近发现在显示小部件列表时,stack并listView没有以相同的方式工作。这是一个例子:
使用此代码,我得到了两个listData小部件(一个自定义小部件)的列表
new ListView(
children: <Widget>[
new Container(
child: ListData(
margin: EdgeInsets.all(4.0),
width: screenSize.width,
title: "Breakfast with Harry",
subtitle: "9 - 10am ",
image: DecorationImage(image: AssetImage('assets/avatar-1.jpg'),
fit: BoxFit.cover,))
),
new Container(
child: ListData(
margin: EdgeInsets.all(4.0),
width: screenSize.width,
title: "Breakfast with Harry",
subtitle: "9 - 10am ",
image: DecorationImage(image: AssetImage('assets/avatar-1.jpg'),
fit: BoxFit.cover,))
),
],
)
Run Code Online (Sandbox Code Playgroud)
当替换ListView为stack
new Stack(
children: <Widget>[
new Container(
child: ListData(
margin: EdgeInsets.all(4.0),
width: screenSize.width,
title: "Breakfast with Harry", …Run Code Online (Sandbox Code Playgroud)