zoukankan      html  css  js  c++  java
  • flutter ListView

    代码:

    import 'package:flutter/material.dart';
    void main() => runApp(MyTestApp());

    class MyTestApp extends StatelessWidget{
    Widget build(BuildContext context){
    return MaterialApp(
    title: 'Flutter test',
    home: Scaffold(
    appBar: new AppBar(title: new Text('ListView'),),
    body: new ListView(
    children: <Widget>[
    new ListTile(
    leading: new Icon(Icons.ac_unit),
    title: new Text('图标'),

    ), new ListTile(
    leading: new Icon(Icons.access_alarm),
    title: new Text('闹钟'),

    ), new ListTile(
    leading: new Icon(Icons.access_time),
    title: new Text('时间'),

    ),
     
    new Container(
    child: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,
    ),
    300.0,
    height: 200.0,
    padding: const EdgeInsets.all(10.0),
    color: Colors.greenAccent,
    ),new Image.network(
    'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1578317300003&di=5c3292475c58134de976eca46a0dd82f&imgtype=0&src=http%3A%2F%2Fn.sinaimg.cn%2Fsinacn08%2F183%2Fw1024h759%2F20180801%2F8da9-hhacrce6850409.jpg',
    100.0,
    height: 50.0,
    )

    ],
    )
     
    ),
    );
    }
    }
     
     
    总结:

    listView 

    children: <widget>[//list 里的控件

    new listTitle(//左图 右文字

    leading:new Icon(Icons.xxx)//flutter 自带的图标

    title :new Text(‘xxx’)//文字

     

    new Image.network(

    ‘http://xxxx

    )

     

    )

    还可以添加contain 在区域里添加图片设置图片位置 样式

     

  • 相关阅读:
    CSS3圆圈动画放大缩小循环动画效果
    php将多个值的数组去除重复元素
    .net 图片压缩
    关于FFmpegInterop项目的编译
    Axure Beta 7.0 汉化版下载
    axure 6.5 汉化正式版软件及注册码
    HTML基础复习(八)表单
    HTML基础复习(七)布局-div间距
    Android+GPS轨迹跟踪器(一)
    HTML基础复习(六)布局-居中
  • 原文地址:https://www.cnblogs.com/pp-pping/p/12157892.html
Copyright © 2011-2022 走看看