update list tile

null_safety
张萌 4 years ago
parent 92da3f4da8
commit 2f4c29535f

@ -20,17 +20,13 @@ class _ExampleListTileState extends State<ExampleListTile> {
SizedBox( SizedBox(
height: 8.w, height: 8.w,
), ),
Container( ASOptionTile(
color: Color(0xFFFFFFFF), items: [
padding: EdgeInsets.symmetric(horizontal: 8.w),
child: Column(
children: [
ASListTile( ASListTile(
title: '转单号(UPS)', title: '转单号(UPS)',
text: 'DFADN2329TNAGA', text: 'DFADN2329TNAGA',
trail: Icon(Icons.ac_unit_rounded), trail: Icon(Icons.ac_unit_rounded),
), ),
ASDivider(),
ASListTile( ASListTile(
title: '订单编号', title: '订单编号',
text: text:
@ -39,7 +35,6 @@ class _ExampleListTileState extends State<ExampleListTile> {
), ),
], ],
), ),
),
20.hb, 20.hb,
ASOptionTile( ASOptionTile(
items: List.generate( items: List.generate(

@ -34,7 +34,7 @@ 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), margin: EdgeInsets.symmetric(vertical: 8.w,horizontal: 10.w),
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: Row( child: Row(
crossAxisAlignment: crossAxisAlignment:

@ -33,7 +33,7 @@ class ASOptionTile extends StatelessWidget {
borderRadius: BorderRadius.circular(5.w), borderRadius: BorderRadius.circular(5.w),
), ),
child: Padding( child: Padding(
padding: this.padding ?? EdgeInsets.fromLTRB(10.w, 10.w, 10.w, 0), padding: this.padding ?? EdgeInsets.zero,
child: item ?? child: item ??
Column( Column(
children: List.generate(length * 2 - 1, (index) { children: List.generate(length * 2 - 1, (index) {
@ -41,7 +41,9 @@ class ASOptionTile extends StatelessWidget {
if (index.isEven) if (index.isEven)
return items[displayIndex]; return items[displayIndex];
else else
return ASDivider(indent: 14.w, endIndent: 14.w); return this.padding == null
? ASDivider(indent: 10.w, endIndent: 10.w)
: ASDivider();
}), }),
), ),
)); ));

Loading…
Cancel
Save