mirror of
https://github.com/alibaba/flutter-go.git
synced 2025-05-24 00:33:29 +08:00

# Conflicts: # lib/widgets/components/Bar/AppBar/index.dart # lib/widgets/components/Bar/BottomAppBar/demo.dart # lib/widgets/components/Bar/BottomAppBar/index.dart # lib/widgets/components/Bar/ButtonBar/index.dart # lib/widgets/components/Bar/FlexibleSpaceBar/index.dart # lib/widgets/components/Bar/SliverAppBar/index.dart # lib/widgets/components/Bar/SnackBar/index.dart # lib/widgets/components/Bar/SnackBarAction/index.dart # lib/widgets/components/Card/Card/index.dart # lib/widgets/components/LIst/ListBody/index.dart # lib/widgets/components/LIst/ListView/index.dart # lib/widgets/elements/Form/Button/DropdownButton/index.dart # lib/widgets/elements/Form/Button/FlatButton/index.dart # lib/widgets/elements/Form/Button/PopupMenuButton/index.dart # lib/widgets/elements/Form/CheckBox/Checkbox/index.dart # lib/widgets/elements/Form/CheckBox/CheckboxListTile/index.dart # lib/widgets/elements/Frame/Axis/crossAxis/index.dart # lib/widgets/elements/Frame/Axis/flipAxis/index.dart # lib/widgets/elements/Frame/Axis/mainAxis/index.dart # lib/widgets/elements/Media/Image/precacheImage/index.dart
73 lines
2.0 KiB
Dart
73 lines
2.0 KiB
Dart
/**
|
|
* Created with Android Studio.
|
|
* User: ryan
|
|
* Date: 2018/12/31
|
|
* Time: 下午2:42
|
|
* email: zhu.yan@alibaba-inc.com
|
|
* tartget: ListBody 的示例
|
|
*/
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
/*
|
|
* Checkbox 默认ListBody的实例
|
|
* */
|
|
class ListBodyFullDefault extends StatefulWidget {
|
|
const ListBodyFullDefault() : super();
|
|
|
|
@override
|
|
State<StatefulWidget> createState() => _ListBodyFullDefault();
|
|
}
|
|
|
|
/*
|
|
* ListBody 默认的实例,有状态
|
|
* */
|
|
class _ListBodyFullDefault extends State {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return ListBody(
|
|
// ... // 如果没有,就是不需要有状态的 StatefulWidget
|
|
);
|
|
}
|
|
}
|
|
|
|
/*
|
|
* ListBody 默认的实例,无状态
|
|
* */
|
|
class ListBodyLessDefault extends StatelessWidget {
|
|
final widget;
|
|
final parent;
|
|
|
|
const ListBodyLessDefault([this.widget, this.parent])
|
|
: super();
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return ListBody(
|
|
mainAxis: Axis.vertical, // 排列的主轴方向
|
|
reverse: false, // 是否反向
|
|
children: <Widget>[
|
|
Container(color: Colors.red,
|
|
width: 50.0,
|
|
height: 150.0,
|
|
child: Text('标题1', style: TextStyle(color: Color(0xffffffff)))),
|
|
Container(color: Colors.yellow,
|
|
width: 50.0,
|
|
height: 50.0,
|
|
child: Text('标题2', style: TextStyle(color: Color(0xffffffff)))),
|
|
Container(color: Colors.green,
|
|
width: 50.0,
|
|
height: 50.0,
|
|
child: Text('标题3', style: TextStyle(color: Color(0xffffffff)))),
|
|
Container(color: Colors.blue,
|
|
width: 50.0,
|
|
height: 50.0,
|
|
child: Text('标题4', style: TextStyle(color: Color(0xffffffff)))),
|
|
Container(color: Colors.black,
|
|
width: 50.0,
|
|
height: 50.0,
|
|
child: Text('标题5', style: TextStyle(color: Color(0xffffffff))))
|
|
],
|
|
);
|
|
}
|
|
} |