- 博客(18)
- 收藏
- 关注
原创 Flutter RichText换行问题(未解决)
Container( width: 100, child: RichText( text: TextSpan(children: [ TextSpan( text: '你好: ', style: CommonTextStyle.text16, ), TextSpan( text: _str, .
2022-05-22 22:33:01
2189
1
原创 Flutter Wrap换行,平均间距
Wrap( runSpacing: 10, spacing: ret, children: [ for (int i = 0; i < 20; i++) Container(width: 110, height: 40, color: Colors.red); ]);类似这样一个数组排列,超出屏幕的换行,又想水平间隔相等。没有研究透Wrap的使用,所以自己写了一个计算逻辑。有直接设置W.
2022-03-02 12:27:39
2861
原创 Flutter 嵌套两个ListView时滚动失效
两个ListView嵌套使用导致滚动失效, 试一下把child的ListView的physics改成ClampingScrollPhysics会有意想不到的效果.
2022-02-22 12:54:54
2982
原创 Flutter里ListView.builder和ListView区别
在使用ListView时,ListView.builder和ListView(children:[])都可以实现列表滚动,两者的区别在于ListView.builder并不是初始化时把所有的children都创建出来,而是等用户滚动到了要创建的位置才会创建出来;ListView构造方法添加children在初始化时就把所有的children都创建出来...
2021-09-18 20:18:27
1401
原创 Flutter开发三端App如何导入各个平台需要的库
文件app.dartimport 'package:frontend/mobile.dart' if (dart.library.html) 'package:frontend/web.dart';abstract class App { void init(); factory App() => getApp();}文件mobile.dartimport 'package:frontend/app.dart';class MobileApp impleme
2021-09-18 06:16:23
1369
1
原创 shell脚本修改xcode项目的包名、app名字
用到PlistBuddy工具, mac自带,请自行百度;设置环境变量后直接使用packname='com.xxx.xx'#先修改Info.plist文件PlistBuddy -c "Set :'CFBundleDisplayName' $title" demo/Info.plistPlistBuddy -c "Set :'CFBundleName' $title" demo/Info.plistPlistBuddy -c "Set :'CFBundleIdentifier' $packn
2021-09-15 02:21:54
1272
原创 Flutter videoplayer适配
Center( child: SizedBox.expand( child: FittedBox( fit: BoxFit.cover, child: SizedBox( height: 16, width: 9, child: VideoPlayer(player.controller.
2021-09-01 22:58:24
1500
原创 el-table 在safari显示位置错乱
网络上看到有很多解决办法1. 列的宽度统一使用width或者min-width, 不要交叉使用2.修改cssbody .el-table th.gutter { display: table-cell !important;}body .el-table colgroup.gutter { display: table-cell !important;}table { width: 100% !important;}.el-table__body { width...
2021-08-30 02:24:06
1319
1
原创 vue 隐藏el-table的滚动条
在vue文件内加上以下代码<style lang="scss"> .el-table__body-wrapper::-webkit-scrollbar { /*width: 0;宽度为0隐藏*/ width: 0px; } .el-table__body-wrapper::-webkit-scrollbar-thumb { border-radius: 2px; height: 50px; backgrou
2021-08-26 21:18:28
5935
2
原创 Flutter json转换
必须依赖dependencies: json_annotation: ^4.0.1dev_dependencies: build_runner: ^2.1.1 json_serializable: ^4.1.3千万别把dev_dependencies里面的依赖写到了dependencies里面,没有效果import 'package:json_annotation/json_annotation.dart';part 'User.g.dart'; //必须跟类名、文件
2021-08-26 13:31:23
261
原创 Flutter 设置按钮禁用
MaterialButton( child: Text( def_zh.quantize_history_btn_subscribe, style: TextStyle(color: Colors.white, fontSize: 16), ), color: Colors.red, disabledColor: Colors.gray, onPressed: null),),
2021-08-21 02:00:51
2121
原创 Flutter TextButton设置圆角、边框
TextButton( style: ButtonStyle( //圆角 shape: MaterialStateProperty.all( RoundedRectangleBorder( borderRadius: BorderRadius.circular( 18.67))), //边框 .
2021-08-18 00:13:17
9541
原创 Flutter ListView添加到Flex下报错
把ListView添加到Flex下报错:════════ Exception caught by rendering library ═════════════════════════════════RenderBox was not laid out: RenderViewport#c8fb1 NEEDS-PAINT'package:flutter/src/rendering/box.dart':Failed assertion: line 1930 pos 12: 'hasSize'
2021-08-15 23:41:35
573
原创 球球作战大冒险中球球和障碍物碰撞后球球的运动向量计算
引用:www.h10game.com/** * 计算球碰到圆形方块后的向量 * 方程式如下 * 方程1: (x0 * (xa - xb) + y0 * (ya - yb)) / x1 * (x1 * (xa - xb) + y1 * (ya - yb)) = -1 * 方程2: cosA = (x0 * (xa - xb) + y0 * (ya - yb)) ...
2018-07-18 18:02:37
559
原创 typescript保留小数位
引用:www.h10game.com东西太简单,就像1+1一样,百度都查不到答案,做个笔记,可能也有刚入门的人要用到let num: number = 100.001;let str: string = num.toFixed(2);...
2018-07-10 10:20:02
20608
1
原创 LayaBox 不让子节点的鼠标事件穿透到父节点
引用:www.h10game.com/*A是父节点,B是子节点A和B都添加了鼠标监听当点击子节点B的时候,不让鼠标事件穿透到A,那么在B的监听回调函数参数调用stopPropagation函数*/this.on(Laya.Event.CLICK, this, (e: Laya.Event)=>{ e.stopPropagation();})...
2018-07-09 23:54:57
3287
1
原创 LayaBox动画队列
引用:www.h10game.comlet cleanAnimation = (target, onEvtFinish)=> { let timeLine = new TimeLine(); timeLine.addLabel("hide1", 0).to(target, {alpha: 0}, 100) .addLabel("show1", 100).to(...
2018-07-08 16:14:23
1422
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人