update list tile

null_safety
张萌 4 years ago
parent f62363848d
commit cb89a82819

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

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

Loading…
Cancel
Save