|
|
@ -17,6 +17,10 @@ class ASListTile extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
|
|
///对齐方式
|
|
|
|
///对齐方式
|
|
|
|
final CrossAxisAlignment? crossAxisAlignment;
|
|
|
|
final CrossAxisAlignment? crossAxisAlignment;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///是否显示
|
|
|
|
|
|
|
|
final bool visible;
|
|
|
|
|
|
|
|
|
|
|
|
ASListTile({
|
|
|
|
ASListTile({
|
|
|
|
Key? key,
|
|
|
|
Key? key,
|
|
|
|
this.title,
|
|
|
|
this.title,
|
|
|
@ -24,51 +28,56 @@ class ASListTile extends StatelessWidget {
|
|
|
|
this.trail,
|
|
|
|
this.trail,
|
|
|
|
this.height,
|
|
|
|
this.height,
|
|
|
|
this.crossAxisAlignment,
|
|
|
|
this.crossAxisAlignment,
|
|
|
|
|
|
|
|
this.visible = true,
|
|
|
|
}) : super(key: key);
|
|
|
|
}) : super(key: key);
|
|
|
|
|
|
|
|
|
|
|
|
ASListTile.option({
|
|
|
|
ASListTile.option({
|
|
|
|
Key? key,
|
|
|
|
Key? key,
|
|
|
|
this.title,
|
|
|
|
this.title,
|
|
|
|
this.text,
|
|
|
|
this.text,
|
|
|
|
this.trail,
|
|
|
|
this.trail,
|
|
|
|
|
|
|
|
this.visible = true,
|
|
|
|
}) : height = 32.w,
|
|
|
|
}) : height = 32.w,
|
|
|
|
crossAxisAlignment = CrossAxisAlignment.center,
|
|
|
|
crossAxisAlignment = CrossAxisAlignment.center,
|
|
|
|
super(key: key);
|
|
|
|
super(key: key);
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Container(
|
|
|
|
return Offstage(
|
|
|
|
margin: height == null
|
|
|
|
offstage: !visible,
|
|
|
|
? EdgeInsets.symmetric(vertical: 8.w, horizontal: 10.w)
|
|
|
|
child: Container(
|
|
|
|
: EdgeInsets.symmetric(horizontal: 10.w),
|
|
|
|
margin: height == null
|
|
|
|
height: height,
|
|
|
|
? EdgeInsets.symmetric(vertical: 8.w, horizontal: 10.w)
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
: EdgeInsets.symmetric(horizontal: 10.w),
|
|
|
|
child: Row(
|
|
|
|
height: height,
|
|
|
|
crossAxisAlignment:
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
crossAxisAlignment ?? CrossAxisAlignment.start,
|
|
|
|
child: Row(
|
|
|
|
children: [
|
|
|
|
crossAxisAlignment: crossAxisAlignment ?? CrossAxisAlignment.start,
|
|
|
|
Container(
|
|
|
|
children: [
|
|
|
|
width: 85.w,
|
|
|
|
Container(
|
|
|
|
child: Text(
|
|
|
|
width: 85.w,
|
|
|
|
title!,
|
|
|
|
child: Text(
|
|
|
|
maxLines: 1,
|
|
|
|
title!,
|
|
|
|
overflow: TextOverflow.visible,
|
|
|
|
maxLines: 1,
|
|
|
|
softWrap: false,
|
|
|
|
overflow: TextOverflow.visible,
|
|
|
|
style: TextStyle(color: kTextColor, fontSize: 14.sp),
|
|
|
|
softWrap: false,
|
|
|
|
|
|
|
|
style: TextStyle(color: kTextColor, fontSize: 14.sp),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
Expanded(
|
|
|
|
|
|
|
|
child: text == null
|
|
|
|
|
|
|
|
? Text('')
|
|
|
|
|
|
|
|
: text is String
|
|
|
|
|
|
|
|
? Text(
|
|
|
|
|
|
|
|
text,
|
|
|
|
|
|
|
|
maxLines: 2,
|
|
|
|
|
|
|
|
style: TextStyle(color: kTextSubColor, fontSize: 14.sp),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
: text,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
trail ?? SizedBox()
|
|
|
|
Expanded(
|
|
|
|
],
|
|
|
|
child: text == null
|
|
|
|
),
|
|
|
|
? Text('')
|
|
|
|
|
|
|
|
: text is String
|
|
|
|
|
|
|
|
? Text(
|
|
|
|
|
|
|
|
text,
|
|
|
|
|
|
|
|
maxLines: 2,
|
|
|
|
|
|
|
|
style: TextStyle(color: kTextSubColor, fontSize: 14.sp),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
: text,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
trail ?? SizedBox()
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|