flutter

kotlin中when的用法

when是什么 when用于在kotlin中实现类c语言中的switch关键字 when怎么用 when (x) { 1 -> print("x == 1") 2 -> print("x == 2") else -> { // Note the block print("x is neither 1 nor 2") } } 差不多是类C语言中这么个意思 swicth(x){ case 1: ....... break; case 2: ....... break; default: // kotlin else ....... break; } 帮助 https://kotlinlang.org/docs/reference/control-flow.html

gradle编译太慢的解决办法

gradle编译速度实在太慢,一个hello world竟然要15s。改用本文配置之后只要2.15s 解决方法 gradle.property文件 org.gradle.jvmargs=-Xmx1536m 改为 org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 org.gradle.daemon=true org.gradle.parallel=true org.gradle.configureondemand=true

flutter gesture空白区域不响应ontap解决方法

问题描述 Widget buildServerItem(BuildContext context, Server server){ return Column( children: <Widget>[ seperateLine, Container( padding: const EdgeInsets.only(top:15.0, left:20.0, right:20.0, bottom: 15.0), child: GestureDetector(![QQ截图20191030163401.png][1] onTap:() => print("say hello"), child: Row( children: <Widget>[ Expanded( child: Row( children: <Widget>[ Image.asset("assets/images/server.png"),//Icon(Icons.storage, color:Color(0xFF0...