zoukankan      html  css  js  c++  java
  • Flutter Container 组件、Text 组件详解

    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 正常体)
     
    更多参数:https://docs.flutter.io/flutter/painting/TextStyle-class.html
     
    Container 组件
    alignment
    topCenter:顶部居中对齐
    topLeft:顶部左对齐
    topRight:顶部右对齐
    center:水平垂直居中对齐
    centerLeft:垂直居中水平居左对齐
    centerRight:垂直居中水平居右对齐
    bottomCenter 底部居中对齐
    bottomLeft:底部居左对齐
    bottomRight:底部居右对齐
    decoration
    decoration: BoxDecoration(
      color: Colors.blue,
      border: Border.all(
        color: Colors.red,
        2.0
      ),
      borderRadius: BorderRadius.all(
        Radius.circular(8.0)
      )
    )
    // 设置最大最小宽度 高度
      constraints: BoxConstraints(   
        minWidth: 180,
        minHeight: 50,
      ),
     
     
    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 容器子元素
    更多参数:https://api.flutter.dev/flutter/widgets/Container-class.html 
  • 相关阅读:
    excel 批量修改sql
    js select 改变当前选中option
    servlet 显示服务器上的图片
    @Security权限验证拦截参数
    签字 变成 图片 纯js+html实现
    web 的项目 搭乘war包,运行时候却找不到jar包
    jquery监听扫码枪获得值
    妹子的js 万一哪一天资源找不到了 记录下来
    react系列---【redux安装、创建仓库】
    react系列---【redux进阶】
  • 原文地址:https://www.cnblogs.com/zhaofeis/p/12326416.html
Copyright © 2011-2022 走看看