Views

作者: WRFranky | 来源:发表于2019-05-09 11:00 被阅读0次

,1.TextField:https://blog.csdn.net/yuzhiqiang_1993/article/details/88204031

2.Text:https://blog.csdn.net/chenlove1/article/details/84574651

3.自定义Icon:https://segmentfault.com/a/1190000017978633?utm_source=tag-newest

一,标准 widgets

Container:用在Text,TextField,Icon,Image,Row,Column等外层

添加 padding, margins, borders, background color, 或将其他装饰添加到widget.

GridView

将 widgets 排列为可滚动的网格.

ListView

将widget排列为可滚动列表

Stack

使用Stack来组织需要重叠的widget。widget可以完全或部分重叠底部widget。

Stack summary:

用于与另一个widget重叠的widget

子列表中的第一个widget是base widget; 随后的子widget被覆盖在基础widget的顶部

Stack的内容不能滚动

您可以选择剪切超过渲染框的子项

二,Material Components

Card

将相关内容放到带圆角和投影的盒子中。

ListTile

将最多3行文字,以及可选的行前和和行尾的图标排成一行

new ListTile(

title:new Text('CineArts at the Empire',

      style:new TextStyle(fontWeight: FontWeight.w500, fontSize:20.0)),

  subtitle:new Text('85 W Portal Ave'),

  leading:new Icon(

Icons.theaters,

    color: Colors.blue[500],//我们可以利用这个动态更改 系统提供的icon的颜色,太爽了

  ),

),

Container

许多布局会自由使用容器来使用padding分隔widget,或者添加边框(border)或边距(margin)。您可以通过将整个布局放入容器并更改其背景颜色或图片来更改设备的背景。

Container 概要 :

添加padding, margins, borders

改变背景颜色或图片

包含单个子widget,但该子widget可以是Row,Column,甚至是widget树的根

虽然Container很强大,可以定义margin和align,但是Flutter也有自己的Align,Padding和Center对象  而且都有个child属性就是为了给某些widget设置Align和Padding,功能比较针对性,虽然Container都能实现,但是复杂些,所以如果我们只是单一的需要Padding或者Align就可以用他们。

相关文章

  • Views - Text Views

    原文在这里Text Views[https://developer.apple.com/design/human-...

  • 04 - Views and templates

    Views and templates Writing more views# polls/views.py # ...

  • Writing my first Django app - 4

    1. Writing more views polls/views.py Wire these new views...

  • HIG:Views - Activity Views

    自上次参加完回音分享会后,我下定决心要洗心革面乖乖打基础,于是开启了这个part,争取两个月不间断更新,写完Mat...

  • Views

    View Basics iOS app的UI由View对象组成,一个对象: 1. 是UIView或其子类的一个实例...

  • Views

    1、类通讯录列表筛选组件(SaluLetterSortLayout) 1.1 XML示例 1.1.1 组件引用 1...

  • views

    if you always do everything like to the water over the du...

  • Views

    Class-based Views REST框架提供了一个APIView类,它是Django中View类的子类。A...

  • Views

    APIView是django的原生(View)[https://www.jianshu.com/p/327b404...

  • Views

    ViewsBecause view objects are the main way your applicati...

网友评论

      本文标题:Views

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