Indexer.shadow constructor
Indexer.shadow({
- Key? key,
- AlignmentGeometry alignment = AlignmentDirectional.topStart,
- TextDirection? textDirection,
- bool reversed = false,
- StackFit fit = StackFit.loose,
- Clip clipBehavior = Clip.hardEdge,
- List<
Widget> children = const <Widget>[], - List<
int> shadow = const <int>[],
use shadow list to sort items
Implementation
Indexer.shadow({
super.key,
super.alignment,
super.textDirection,
this.reversed = false,
super.fit,
super.clipBehavior,
List<Widget> children = const <Widget>[],
List<int> shadow = const <int>[],
}) : assert(shadow.length == children.length),
super(
children: children
..sort((Widget a, Widget b) {
int reverser = reversed ? -1 : 1;
return shadow[children.indexOf(a)] -
shadow[children.indexOf(b)] * reverser;
}),
);