【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

相关推荐
新之助小锅1 小时前
java版连接汇川PLC,发送数据,读取数据,保持重新链接,适用安卓
android·java·python
2501_916007472 小时前
iOS性能调试工具终极指南,从系统底层到多端协同的全方位优化实践(2025版)
android·ios·小程序·https·uni-app·iphone·webview
2501_915921433 小时前
iOS崩溃日志深度分析与工具组合实战,从符号化到自动化诊断的完整体系
android·ios·小程序·uni-app·自动化·cocoa·iphone
浩星5 小时前
react的框架UmiJs(五米)
前端·javascript·react.js
执念WRD5 小时前
熊海CMS v1.0代码审计实战
android·nginx·安全·web安全·网络安全·系统安全
jllllyuz5 小时前
基于ThinkPHP实现动态ZIP压缩包的生成
android
Niyy_7 小时前
前端一个工程构建多个项目,记录一次工程搭建
前端·javascript
百***92028 小时前
【MySQL】MySQL库的操作
android·数据库·mysql
快乐非自愿8 小时前
常用设计模式:工厂方法模式
javascript·设计模式·工厂方法模式
十年磨一剑~9 小时前
html+js开发一个测试工具
javascript·css·html