Fork me on GitHub

Flutter 学习 ---- Contain、Text

Flutter Contain、Text组件

Text组件是在编写界面中使用频率算是靠前的一个

Flutter Text

名称 功能
textAlign 文本对齐方式(center居中,left左 对齐, right右对齐, justfy两端对齐
textDirection 文本方向(ltr从左至右,rtl从右至 左)
overflow 文字超出屏幕之后的处理方式(clip裁剪,fade渐隐,ellipsis省略号)
textScaleFactor 字体显示倍率
maxLines 文字显示最大行数
style 字体的样式设置

TextStyle参数:

名称 功能
decoration 文字装饰线(none没有线,lineThrough删 除线,overline上划线,underline下划线)
decorationColor 文字装饰线颜色
decorationStyle 文字装饰线风格([dashed,dotted]虚线, double两根线,solid一根实线,wavy波浪 线)
wordSpacing 单词间隙(如果是负值,会让单词变得更紧 凑)
letterSpacing 字母间隙(如果是负值,会让字母变得更紧 凑)
fontStyle 文字样式(italic斜体,normal正常体
fontSize 文字大小
color 文字颜色
fontWeight 字体粗细(bold粗体,normal正常体)

Flutter Container

名称 功能
alignment topCenter:顶部居中对齐topLeft:顶部左对齐topRight:顶部右对齐center:水平垂直居中对齐centerLeft:垂直居中水平居左对齐centerRight:垂直居中水平居右对齐bottomCenter底部居中对齐bottomLeft:底部居左对齐bottomRight:底部居右对齐
decoration decoration: BoxDecoration( color: Colors.blue, border: Border.all( color: Colors.red, width: 2.0, ), borderRadius: BorderRadius.all( Radius.circular(8.0) ))
margin margin属性是表示Container与外部其他 组件的距离。 EdgeInsets.all(20.0)
padding padding就是Container的内边距,指Container边缘与Child之间的距离padding: EdgeInsets.all(10.0)
transform Container容易进行一些旋转之类的transform: Matrix4.rotationZ(0.2)
height 容器高度
width 容器宽度
child 容器子元素
posted @   Banana_Fish  阅读(643)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 零经验选手,Compose 一天开发一款小游戏!
· 通过 API 将Deepseek响应流式内容输出到前端
· 因为Apifox不支持离线,我果断选择了Apipost!
点击右上角即可分享
微信分享提示