ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

flutter 基础

2021-04-14 18:02:56  阅读:245  来源: 互联网

标签:10 颜色 color 基础 EdgeInsets 组件 flutter Alignment


入口标准代码

void main(){
      runApp(MyApp())
}

class MyApp extends StatelessWidget{
    @override
     Widget build(BuildContext context){
           return MaterialApp(
                home:Scaffold(
                    appBar:AppBar(title:Text("flutter demo"))
                ),
                body:Center(
                    child:Text("xxxx"),
                ) 
            );
     }
}          

Container 容器组件

  选项:值

  child:子组件

  height: dobule类型

  width:dobule类型

  padding:EdgeInsets.all(10) 四边边距  EdgeInsets.fromLTRB(10,10,10,10)左上右下

  margin:EdgeInsets.all(10) 四边边距  EdgeInsets.fromLTRB(10,10,10,10)左上右下

  transfom:Matrix4..translationVaues(100,0,0)  偏移 x,y,z

      Matrix4.rotationZ(0.3)  旋转

  alignment:Alignment.bottomLeft 内容对齐 /Alignment.bottomCenter /Alignment.topCenter  ........

  decoration:盒子装饰

    BoxDecoration()

    color:盒子背景颜色

    borderRadius:BorderRadius.all(   盒子圆角

      Radius:circular(8)

    )

    border: Border.all(

      color:边框颜色

      width:边框颜色

    )

      

 

text文本组件

  值

  textAlign:TextAlign.right 文字靠右     TextAlign.center 文字居中

  overflow:TextOverflow.ellipsis 超出省略

  textScaleFactor:2  字体放大

  maxLines:1  一行显示

  style:TextStyle:() 文字样式

    fontSize:16.0 文字大小

    color:文字颜色 Color.fromARGB(1,2,3,4)

    fontWeight:FontWeight.w300 字体加粗

    fontStyle:FontStyle.italic 字体倾斜

    decoration:TextDecoration.lineThrough  

    decorationColor:Color.white  穿过的线的颜色

    decorationStyle:TextDecorationStyle.dashed 虚线

    letterSpacing:5.0 字间距

  

标签:10,颜色,color,基础,EdgeInsets,组件,flutter,Alignment
来源: https://www.cnblogs.com/zs521/p/14659132.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有