【Flutter&Dart】 listView例子一(13 /100)

效果图

官方代码:

dart 复制代码
import 'package:flutter/material.dart';

class ListRoles extends StatelessWidget {
  const ListRoles({super.key});

  @override
  Widget build(BuildContext context) {
    return ListView(
      padding: const EdgeInsets.all(8),
      children: <Widget>[
        Container(
          height: 50,
          color: Colors.amber[600],
          child: const Center(child: Text('Entry A')),
        ),
        Container(
          height: 50,
          color: Colors.amber[500],
          child: const Center(child: Text('Entry B')),
        ),
        Container(
          height: 50,
          color: Colors.amber[100],
          child: const Center(child: Text('Entry C')),
        ),
      ],
    );
  }
}

简单实现一下

很多时候简单的技术点越简单越有利于排查问题,因为做减法有点反人性,但做加法容易让人迷失;

所以如果搞不清楚了从头开始,从一开始。。。。。。

========END

相关推荐
y***86697 小时前
TypeScript在Electron应用中的使用
javascript·typescript·electron
zy happy9 小时前
若依 vue3 报错:找不到模块“@/api/xxxx/xxxxx”或其相应的类型声明。。Vue 3 can not find mod
前端·javascript·vue.js
meichaoWen9 小时前
【Vue3】vue3的全面学习(一)
前端·javascript·学习
b***748811 小时前
Vue开源
前端·javascript·vue.js
zhaoyufei13311 小时前
Android13删除Taskbar
android
ByteCraze12 小时前
我整理的大文件上传方案设计
前端·javascript
前端小白۞12 小时前
vue2 md文件预览和下载
前端·javascript·vue.js
消失的旧时光-194313 小时前
Flutter 组件:Row / Column
flutter
6***B4813 小时前
存储过程(SQL)
android·数据库·sql
5***790013 小时前
Vue项目性能优化
前端·javascript·vue.js