|
|
@ -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);
|
|
|
|
|
|
|
|
|
|
|
@ -28,6 +32,8 @@ class ASOptionTile extends StatelessWidget {
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
shape: RoundedRectangleBorder(
|
|
|
|
borderRadius: BorderRadius.circular(5.w),
|
|
|
|
borderRadius: BorderRadius.circular(5.w),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
child: Padding(
|
|
|
|
|
|
|
|
padding: this.padding ?? EdgeInsets.zero,
|
|
|
|
child: item ??
|
|
|
|
child: item ??
|
|
|
|
Column(
|
|
|
|
Column(
|
|
|
|
children: List.generate(length * 2 - 1, (index) {
|
|
|
|
children: List.generate(length * 2 - 1, (index) {
|
|
|
@ -35,9 +41,11 @@ class ASOptionTile extends StatelessWidget {
|
|
|
|
if (index.isEven)
|
|
|
|
if (index.isEven)
|
|
|
|
return items[displayIndex];
|
|
|
|
return items[displayIndex];
|
|
|
|
else
|
|
|
|
else
|
|
|
|
return ASDivider(indent: 14.w, endIndent: 14.w);
|
|
|
|
return this.padding == null
|
|
|
|
|
|
|
|
? ASDivider(indent: 10.w, endIndent: 10.w)
|
|
|
|
|
|
|
|
: ASDivider();
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|