美文网首页
Flutter-4-Container(常用方法)

Flutter-4-Container(常用方法)

作者: 忆往昔Code | 来源:发表于2019-05-22 16:41 被阅读0次

Alignment:

  • bottomCenter:下部居中对齐。
  • botomLeft: 下部左对齐。
  • bottomRight:下部右对齐。
  • center:纵横双向居中对齐。
  • centerLeft:纵向居中横向居左对齐。
  • centerRight:纵向居中横向居右对齐。
  • topLeft:顶部左侧对齐。
  • topCenter:顶部居中对齐。
  • topRight: 顶部居左对齐。

宽高颜色
child:Container(
child:new Text('Hello ',style: TextStyle(fontSize: 40.0),),
alignment: Alignment.center,
width:500.0,
height:400.0,
color: Colors.lightBlue,
),

padding:内边距
padding:const EdgeInsets.all(10.0),
EdgeInsets.fromLTRB(value1,value2,value3,value4) LTRB分别代表左、上、右、下

margin:外边距同上

decoration:是 container 的修饰器,主要的功能是设置背景和边框。
decoration:new BoxDecoration(//渐变
gradient:const LinearGradient(
colors:[Colors.lightBlue,Colors.greenAccent,Colors.purple]
)
),

边框:
border:Border.all(width:2.0,color:Colors.red)

相关文章

  • Flutter-4-Container(常用方法)

    Alignment: bottomCenter:下部居中对齐。 botomLeft: 下部左对齐。 bottomR...

  • 集合

    1. 常用容器类 Collection 的常用方法 List 的常用方法 Set 的常用方法 Map 的常用方法 ...

  • Yii2速查手册

    Controller控制器常用方法 Request组件常用方法 Html助手常用方法 CRUD常用方法 一、Act...

  • AlertDialog 实用API及其示例

    本文将介绍常用AlertDialog Api及其常用AlertDialog示例 常用API 常用方法 方法定义方法...

  • java字符串String、StringBuilder、Stri

    String的常用方法 StringBuffer的常用方法 StringBuilder的常用方法 String、S...

  • 2017.6.13-14

    学习python总结python常用的方法string的常用方法dictionary的常用方法 python抽象,...

  • OC笔记

    1. NSString 常用方法 2. NSArray 常用方法 3. NSDictionary 常用方法 4. ...

  • Objective-C之NSDictionary学习笔记(IOS

    NSDictionary类简介 属性表(@property) 常用方法 常用类方法 词典对象的生成 常用实例方法 ...

  • JavaScript数组常用方法

    目录 JS 数组常用API常用属性常用方法常见方法语法解释from方法isArrayconcateveryfill...

  • XPath 用法总结

    xpath常用方法 常用定位元素的方法 一些常用函数

网友评论

      本文标题:Flutter-4-Container(常用方法)

      本文链接:https://www.haomeiwen.com/subject/drmuzqtx.html