flutter 图文混合列表
import 'package:flutter/material.dart'; //基础样式 void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: "Imokdemo", home: Scaffold( appBar: AppBar( title: Text("LIST"), ), //body: new Text('ListView') body: ListView( padding: const EdgeInsets.all(10), children: <Widget>[ Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( margin: const EdgeInsets.only(top: 5, left: 0), padding: const EdgeInsets.fromLTRB(10, 10, 10, 5), child: const Text( "有网友询问反射给final修饰的字段设值,为啥设值会失败,之前也深入学习一下反射。", style: TextStyle(fontSize: 14, color: Colors.black)), ), Container( padding: const EdgeInsets.fromLTRB(5, 10, 5, 5), child: Container( alignment: Alignment.centerLeft, height: 200, decoration: BoxDecoration( shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(5), image: const DecorationImage( image: NetworkImage( 'https://pic2.zhimg.com/v2-639b49f2f6578eabddc458b84eb3c6a1.jpg'), fit: BoxFit.cover), ), )), Padding( padding: const EdgeInsets.fromLTRB(5, 10, 5, 5), child: Container( alignment: Alignment.centerLeft, height: 200, decoration: BoxDecoration( shape: BoxShape.rectangle, borderRadius: BorderRadius.circular(5), image: const DecorationImage( image: NetworkImage( 'https://pic2.zhimg.com/v2-639b49f2f6578eabddc458b84eb3c6a1.jpg'), fit: BoxFit.cover), ), )) ], ) ], ) // body:new ListView(), )); } }
来源:https://blog.csdn.net/a506602491/article/details/126917265

浙公网安备 33010602011771号