ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、视频、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
下面有常见布局 ***** ![](https://img.kancloud.cn/31/1a/311aac5095e881321ea226a920d61718_956x1148.png) ~~~ import 'package:flutter/material.dart'; import 'res/listData.dart'; void main() => runApp(Myapp()); class Myapp extends StatelessWidget{ @override Widget build(BuildContext context) { // TODO: implement build return MaterialApp( title: 'home', home: Scaffold( appBar: AppBar( title: Text('home'), ), body: Home(), ), ); } } class Home extends StatelessWidget { @override Widget build(BuildContext context) { // TODO: implement build return Column( children: <Widget>[ Row( children: <Widget>[ Expanded( child: Container( height: 180, color: Colors.amberAccent, child: Text("你好,Flutter"), ) ) ], ), SizedBox(height: 10), Row( children: <Widget>[ Expanded( flex: 2, child: Container( height: 180, color: Colors.lightGreen, ) ), SizedBox( width: 10, ), Expanded( flex: 1, child: Container( height: 180, child: ListView( children: <Widget>[ Container( height: 85, color: Colors.pink, ), SizedBox( height: 10, ), Container( height: 85, color: Colors.black, ) ], ) ) ) ], ) ], ); } } ~~~ ***** ***** ![](https://img.kancloud.cn/f2/d9/f2d9107d1e0dc2841a22b648a9471880_2456x1456.png) ![](https://img.kancloud.cn/8c/76/8c76bcc646a1a02ea4abf06965a6090f_2374x1068.png) ~~~ 使盒子里面的东西垂直显示,如图片和文字如果用ListTile的时候,会横向布局 Column ~~~ ![](https://img.kancloud.cn/2d/b0/2db04b5c754d40f86ff5802b66c6e3c2_1826x1360.png) ~~~ 增加图中图片和文字都间距 SizedBox ~~~ ![](https://img.kancloud.cn/2d/b0/2db04b5c754d40f86ff5802b66c6e3c2_1826x1360.png) ~~~ 增加容器内边据(error示范) Padding ~~~ >四周都是10,但是中间是20。。 ![](https://img.kancloud.cn/92/a3/92a3dc22106b0ea21b66406e576618a2_2656x1458.png) ~~~ 增加容器内边据(success示范) Padding ~~~ ![](https://img.kancloud.cn/35/df/35df253b9d9fa1fb9d734d3363cc3897_2580x1014.png)