|
|
@ -14,19 +14,40 @@ class ASOptionTile extends StatelessWidget {
|
|
|
|
///内边距
|
|
|
|
///内边距
|
|
|
|
final EdgeInsetsGeometry padding;
|
|
|
|
final EdgeInsetsGeometry padding;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///标题
|
|
|
|
|
|
|
|
final dynamic leading;
|
|
|
|
|
|
|
|
|
|
|
|
///item 推荐使用`ASOptionTileItem`,`ASVerticalTileItem`,`ASListTile`
|
|
|
|
///item 推荐使用`ASOptionTileItem`,`ASVerticalTileItem`,`ASListTile`
|
|
|
|
ASOptionTile({Key key, this.items, this.item, this.padding})
|
|
|
|
ASOptionTile({Key key, this.items, this.item, this.padding, this.leading})
|
|
|
|
: super(key: key);
|
|
|
|
: super(key: key);
|
|
|
|
|
|
|
|
|
|
|
|
///单个子组件的Tile
|
|
|
|
///单个子组件的Tile
|
|
|
|
ASOptionTile.single({Key key, @required this.item, this.padding})
|
|
|
|
ASOptionTile.single(
|
|
|
|
|
|
|
|
{Key key, @required this.item, this.padding, this.leading})
|
|
|
|
: items = [],
|
|
|
|
: items = [],
|
|
|
|
super(key: key);
|
|
|
|
super(key: key);
|
|
|
|
|
|
|
|
|
|
|
|
int get length => items.length;
|
|
|
|
int get length => items.length;
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
|
|
|
if (this.leading != null) {
|
|
|
|
|
|
|
|
this.items.insert(
|
|
|
|
|
|
|
|
0,
|
|
|
|
|
|
|
|
Container(
|
|
|
|
|
|
|
|
padding: EdgeInsets.fromLTRB(10.w, 10.w, 10.w, 10.w),
|
|
|
|
|
|
|
|
alignment: Alignment.centerLeft,
|
|
|
|
|
|
|
|
child: this.leading is String
|
|
|
|
|
|
|
|
? Text(
|
|
|
|
|
|
|
|
this.leading,
|
|
|
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
|
|
|
color: kTextColor,
|
|
|
|
|
|
|
|
fontSize: 16.sp,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.bold),
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
: this.leading,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
return Material(
|
|
|
|
return Material(
|
|
|
|
color: kForegroundColor,
|
|
|
|
color: kForegroundColor,
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|