|
|
@ -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);
|
|
|
|
|
|
|
|
|
|
|
@ -23,21 +27,24 @@ class ASOptionTile extends StatelessWidget {
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Material(
|
|
|
|
return Padding(
|
|
|
|
color: kForegroundColor,
|
|
|
|
padding: this.padding ?? EdgeInsets.fromLTRB(10.w, 10.w, 10.w, 0),
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
child: Material(
|
|
|
|
borderRadius: BorderRadius.circular(5.w),
|
|
|
|
color: kForegroundColor,
|
|
|
|
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
|
|
|
|
borderRadius: BorderRadius.circular(5.w),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
child: item ??
|
|
|
|
|
|
|
|
Column(
|
|
|
|
|
|
|
|
children: List.generate(length * 2 - 1, (index) {
|
|
|
|
|
|
|
|
final displayIndex = index ~/ 2;
|
|
|
|
|
|
|
|
if (index.isEven)
|
|
|
|
|
|
|
|
return items[displayIndex];
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return ASDivider(indent: 14.w, endIndent: 14.w);
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
child: item ??
|
|
|
|
|
|
|
|
Column(
|
|
|
|
|
|
|
|
children: List.generate(length * 2 - 1, (index) {
|
|
|
|
|
|
|
|
final displayIndex = index ~/ 2;
|
|
|
|
|
|
|
|
if (index.isEven)
|
|
|
|
|
|
|
|
return items[displayIndex];
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
return ASDivider(indent: 14.w, endIndent: 14.w);
|
|
|
|
|
|
|
|
}),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|