Merge branch 'master' of 192.168.2.201:aku_fe/ansu_ui

* 'master' of 192.168.2.201:aku_fe/ansu_ui:
  update list tile
  update list tile
  update list tile
null_safety
小赖 4 years ago
commit 3e291883f0

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

@ -14,12 +14,16 @@ class ASListTile extends StatefulWidget {
///332px
final double width;
///
final CrossAxisAlignment crossAxisAlignment;
ASListTile({
Key key,
this.title,
this.text,
this.trail,
this.width,
this.crossAxisAlignment,
}) : super(key: key);
@override
@ -30,10 +34,11 @@ class _ASListTileState extends State<ASListTile> {
@override
Widget build(BuildContext context) {
return Container(
margin: EdgeInsets.symmetric(vertical: 8.w),
margin: EdgeInsets.symmetric(vertical: 8.w,horizontal: 10.w),
alignment: Alignment.centerLeft,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment:
widget.crossAxisAlignment ?? CrossAxisAlignment.start,
children: [
Container(
width: 85.w,

@ -11,11 +11,15 @@ class ASOptionTile extends StatelessWidget {
///Widget
final Widget item;
///
final EdgeInsetsGeometry padding;
///item 使`ASOptionTileItem`,`ASVerticalTileItem`,`ASListTile`
ASOptionTile({Key key, this.items, this.item}) : super(key: key);
ASOptionTile({Key key, this.items, this.item, this.padding})
: super(key: key);
///Tile
ASOptionTile.single({Key key, @required this.item})
ASOptionTile.single({Key key, @required this.item, this.padding})
: items = [],
super(key: key);
@ -28,6 +32,8 @@ class ASOptionTile extends StatelessWidget {
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.w),
),
child: Padding(
padding: this.padding ?? EdgeInsets.zero,
child: item ??
Column(
children: List.generate(length * 2 - 1, (index) {
@ -35,9 +41,11 @@ class ASOptionTile extends StatelessWidget {
if (index.isEven)
return items[displayIndex];
else
return ASDivider(indent: 14.w, endIndent: 14.w);
return this.padding == null
? ASDivider(indent: 10.w, endIndent: 10.w)
: ASDivider();
}),
),
);
));
}
}

Loading…
Cancel
Save