zoukankan      html  css  js  c++  java
  • flutter ListView例子

    例子1

    效果:

     

    代码:

    main.dart

    import 'package:flutter/material.dart';
    
    class MyApp extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        return MaterialApp(
          title: 'dasldjalsdjasldj',
          home: Scaffold(
            appBar: new AppBar(title: new Text('new texrdasdasd'),),
            body: new ListView(
              children: [
                new ListTile(
                  leading: new Icon(Icons.access_alarm),
                  title: new Text('access_alarm'),
                ),
                new ListTile(
                  leading: new Icon(Icons.ad_units),
                  title: new Text('ad_units'),
                ),
                new ListTile(
                  leading: new Icon(Icons.adb_rounded),
                  title: new Text('adb_rounded'),
                ),            
              ],
            ),
          ),
        );
      }
    }
    
    void main() {
      runApp(MyApp());
    }

    例子2

    效果:

    或者

    代码:

    main.dart

    import 'package:flutter/material.dart';
    
    class MyApp extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        return MaterialApp(
          title: 'dasldjalsdjasldj',
          home: Scaffold(
            appBar: new AppBar(title: new Text('new texrdasdasd'),),
            body: new ListView(
              children: [
                new Image.network('http://pic1.krmanhua.com:8001/krmh3/12/12136/v1.jpg'),
                new Image.network('http://pic1.krmanhua.com:8001/krmh3/12/12136/v1.jpg'),
                new Image.network('http://pic1.krmanhua.com:8001/krmh3/12/12136/v1.jpg'),
                new Image.network('http://pic1.krmanhua.com:8001/krmh3/12/12136/v1.jpg'),
              ],
            ),
          ),
        );
      }
    }
    
    void main() {
      runApp(MyApp());
    }
  • 相关阅读:
    单片机爬坑记-02-资源紧缺
    单片机爬坑记-01-内核差异
    操作系统-第6章习题解析
    操作系统-第5章习题解析
    操作系统-第4章习题解析
    操作系统-第3章习题解析
    操作系统-第2章习题解析
    操作系统-第1章习题解析
    BugKu之xxx二手交易市场
    BugKu之备份是个好习惯
  • 原文地址:https://www.cnblogs.com/xkxf/p/15477594.html
Copyright © 2011-2022 走看看