Files
FlutterUnit/lib/views/widgets/MultiChildRenderObjectWidget/ListBody/node1_base.dart
2021-03-27 16:38:32 +08:00

49 lines
1.6 KiB
Dart
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
/// create by 张风捷特烈 on 2020/8/2
/// contact me by email 1981462002@qq.com
/// 说明: 342 ListBody 列表体 将若干子组件按照轴向进行排列可设置的属性很少一般很少使用而选择使用ListVIew。
// {
// "widgetId": 342,
// "name": "ListView的基本使用",
// "priority": 1,
// "subtitle": "【mainAxis】 : 主轴方向 【Axis】\n"
// "【reverse】: 是否反向 【bool】\n"
// "【children】: 子组件集 【List<Widget>】",
// }
class ListBodyDemo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
height: 300,
child: ListView(
children: <Widget>[
ListBody(
mainAxis: Axis.vertical,
reverse: false,
children: <Widget>[
Container(color: Colors.red, height: 50.0,),
Container(color: Colors.orange, height: 50.0,),
Container(color: Colors.yellow, height: 50.0,),
],
),
Container(color: Colors.green, height: 80.0,),
ListBody(
mainAxis: Axis.vertical,
reverse: false,
children: <Widget>[
Container(color: Colors.blue, height: 50.0,),
Container(color: Colors.indigo, height: 50.0,),
Container(color: Colors.purple, height: 50.0,),
],
)
]
),
);
}
}