update list tile

null_safety
张萌 4 years ago
parent f62363848d
commit cb89a82819

@ -23,16 +23,31 @@ class _ExampleListTileState extends State<ExampleListTile> {
ASOptionTile(
items: [
ASListTile(
title: '转单号(UPS)',
text: 'DFADN2329TNAGA',
trail: Placeholder(),
title: '转单号(UPS)',
text: 'DFADN2329TNAGA',
trail: InkWell(
onTap: () {},
child: SizedBox(
width: 20.w,
height: 20.w,
child: Placeholder(),
),
),
ASListTile(
title: '订单编号',
text:
'DDAWMFOAGNAIOWNGOANIWOGNAOWIDJAWIOHFA92474Y2798489TY892YH8G67TGT2UBF29GB8298H42897YH472H',
// trail: Icon(Icons.ac_unit_outlined),
),
ASListTile(
title: '订单编号',
text:
'DDAWMFOAGNAIOWNGOANIWOGNAOWIDJAWIOHFA92474Y2798489TY892YH8G67TGT2UBF29GB8298H42897YH472H',
// trail: Icon(Icons.ac_unit_outlined),
),
ASListTile.option(
title: '分类管理',
text: '分类管理',
trail: InkWell(
onTap: () {},
child: SizedBox(width: 20.w,height: 32.w,),
),
),
],
),
20.hb,

@ -12,8 +12,8 @@ class ASListTile extends StatefulWidget {
///
final Widget trail;
///332px
final double width;
///32px
final double height;
///
final CrossAxisAlignment crossAxisAlignment;
@ -22,10 +22,17 @@ class ASListTile extends StatefulWidget {
this.title,
this.text,
this.trail,
this.width,
this.height,
this.crossAxisAlignment,
}) : super(key: key);
ASListTile.option({
Key key,
this.title,
this.text,
this.trail,
}) : height = 32.w,
crossAxisAlignment = CrossAxisAlignment.center,
super(key: key);
@override
_ASListTileState createState() => _ASListTileState();
}
@ -34,7 +41,10 @@ class _ASListTileState extends State<ASListTile> {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.symmetric(vertical: 8.w, horizontal: 10.w),
margin: widget.height == null
? EdgeInsets.symmetric(vertical: 8.w, horizontal: 10.w)
: EdgeInsets.symmetric(horizontal: 10.w),
height: widget.height,
alignment: Alignment.centerLeft,
child: Row(
crossAxisAlignment:

Loading…
Cancel
Save