zoukankan      html  css  js  c++  java
  • gridView

    代码:
    new GridView(
    gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
    crossAxisCount: 3,
    crossAxisSpacing: 2.0,
    mainAxisSpacing: 2.0,
    childAspectRatio: 1.0,
    ),
    children: <Widget>[
    // new Text('aaaaaa'),
    new Image.network('https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1578312966654&di=09a975b6c05a1447fc6f8aeae463cf41&imgtype=0&src=http%3A%2F%2Fp2.qhimgs4.com%2Ft0128307802c64fd817.jpg',fit: BoxFit.cover),
    new Image.network('https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1578312966654&di=09a975b6c05a1447fc6f8aeae463cf41&imgtype=0&src=http%3A%2F%2Fp2.qhimgs4.com%2Ft0128307802c64fd817.jpg',fit: BoxFit.cover),
    new Image.network('https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1578312966654&di=09a975b6c05a1447fc6f8aeae463cf41&imgtype=0&src=http%3A%2F%2Fp2.qhimgs4.com%2Ft0128307802c64fd817.jpg',fit: BoxFit.cover),
    new Image.network('https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1578312966654&di=09a975b6c05a1447fc6f8aeae463cf41&imgtype=0&src=http%3A%2F%2Fp2.qhimgs4.com%2Ft0128307802c64fd817.jpg',fit: BoxFit.cover),
    new Image.network('https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1578312966654&di=09a975b6c05a1447fc6f8aeae463cf41&imgtype=0&src=http%3A%2F%2Fp2.qhimgs4.com%2Ft0128307802c64fd817.jpg',fit: BoxFit.cover),
    new Image.network('https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1578312966654&di=09a975b6c05a1447fc6f8aeae463cf41&imgtype=0&src=http%3A%2F%2Fp2.qhimgs4.com%2Ft0128307802c64fd817.jpg',fit: BoxFit.cover)
    ],
    )
     
    总结:

    GirdView

    老式写法

    GirdView.count(

    padding:内间距

    crossAxisSpacing:列与列之间的间距

    crossAxisCount:列数

    children:<widget>[

    const Text(‘xxxx’)//文本

    const Text(‘xxxx’)

    const Text(‘xxxx’)

    const Text(‘xxxx’)

     

    ]

     

    )

    新式写法

     

    GirdView(

     

    SliverGridDelegateWithMaxCrossAxisExtent //根据里面内容来扩展

     

    一般使用 SliverGridDelegateWithFixedCrossAxisCount

     

    gridDelegate:SliverGridDelegateWithFixedCrossAxisCount

    crossAxisCount:列数

    mainAxisSpacing:行间距

    crossAxisSpacing:列间距

    childAspectRatio:宽高比

     

     

     

     

    )

    children : <widget>{

     

    }

  • 相关阅读:
    纯线性同余随机数生成器
    读书笔记之:C语言参考手册(第5版)
    读书笔记之:C语言函数库
    读书笔记之:C/C++程序员实用大全—C/C++最佳编程指南
    C++中重要关键字总结
    读书笔记之:C++参考大全
    读书笔记之:C++大学教程(第2版)
    C语言中函数参数入栈的顺序
    ANSI设备驱动器
    可以输出自己的源程序代码(quine)
  • 原文地址:https://www.cnblogs.com/pp-pping/p/12162241.html
Copyright © 2011-2022 走看看