build method Null safety

  1. @override
Widget? build(
  1. BuildContext context,
  2. int index
)
override

Return the child at the given index. If the child at the given index does not exist, return null.

Implementation

@override
Widget? build(BuildContext context, int index) {
  if (index < 0 || index >= children.length) {
    return null;
  }
  return IndexedSemantics(index: index, child: children[index]);
}