Indexer constructor
Indexer({
- Key? key,
- AlignmentGeometry alignment = AlignmentDirectional.topStart,
- TextDirection? textDirection,
- bool reversed = false,
- StackFit fit = StackFit.loose,
- Clip clipBehavior = Clip.hardEdge,
- List<
Widget> children = const <Widget>[],
Implementation
Indexer({
super.key,
super.alignment,
super.textDirection,
this.reversed = false,
super.fit,
super.clipBehavior,
List<Widget> children = const <Widget>[],
}) : super(
children: children
..sort((Widget a, Widget b) {
int reverser = reversed ? -1 : 1;
int aIndex = 1;
int bIndex = 1;
if (a is IndexedInterface) {
aIndex = (a as IndexedInterface).index;
}
if (b is IndexedInterface) {
bIndex = (b as IndexedInterface).index;
}
return aIndex - bIndex * reverser;
}),
);