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,25 +20,20 @@ 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), ASListTile(
child: Column(
children: [
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:
'DDAWMFOAGNAIOWNGOANIWOGNAOWIDJAWIOHFA92474Y2798489TY892YH8G67TGT2UBF29GB8298H42897YH472H', 'DDAWMFOAGNAIOWNGOANIWOGNAOWIDJAWIOHFA92474Y2798489TY892YH8G67TGT2UBF29GB8298H42897YH472H',
// trail: Icon(Icons.ac_unit_outlined), // trail: Icon(Icons.ac_unit_outlined),
), ),
], ],
),
), ),
20.hb, 20.hb,
ASOptionTile( ASOptionTile(

@ -14,12 +14,16 @@ class ASListTile extends StatefulWidget {
///332px ///332px
final double width; final double width;
///
final CrossAxisAlignment crossAxisAlignment;
ASListTile({ ASListTile({
Key key, Key key,
this.title, this.title,
this.text, this.text,
this.trail, this.trail,
this.width, this.width,
this.crossAxisAlignment,
}) : super(key: key); }) : super(key: key);
@override @override
@ -30,10 +34,11 @@ 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.start, crossAxisAlignment:
widget.crossAxisAlignment ?? CrossAxisAlignment.start,
children: [ children: [
Container( Container(
width: 85.w, width: 85.w,

@ -11,11 +11,15 @@ class ASOptionTile extends StatelessWidget {
///Widget ///Widget
final Widget item; final Widget item;
///
final EdgeInsetsGeometry padding;
///item 使`ASOptionTileItem`,`ASVerticalTileItem`,`ASListTile` ///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 ///Tile
ASOptionTile.single({Key key, @required this.item}) ASOptionTile.single({Key key, @required this.item, this.padding})
: items = [], : items = [],
super(key: key); super(key: key);
@ -24,20 +28,24 @@ class ASOptionTile extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Material( return Material(
color: kForegroundColor, color: kForegroundColor,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(5.w), borderRadius: BorderRadius.circular(5.w),
), ),
child: item ?? child: Padding(
Column( padding: this.padding ?? EdgeInsets.zero,
children: List.generate(length * 2 - 1, (index) { child: item ??
final displayIndex = index ~/ 2; Column(
if (index.isEven) children: List.generate(length * 2 - 1, (index) {
return items[displayIndex]; final displayIndex = index ~/ 2;
else if (index.isEven)
return ASDivider(indent: 14.w, endIndent: 14.w); return items[displayIndex];
}), else
), return this.padding == null
); ? ASDivider(indent: 10.w, endIndent: 10.w)
: ASDivider();
}),
),
));
} }
} }

Loading…
Cancel
Save