RepaintBoundaryModifier.wrap constructor

  1. @override
RepaintBoundaryModifier.wrap(
  1. Widget child,
  2. int childIndex
)

Wraps the given child in a RepaintBoundary.

The key for the RepaintBoundary is derived either from the child's key (if the child has a non-null key) or from the given childIndex.

Implementation

@override
factory RepaintBoundaryModifier.wrap(Widget child, int childIndex) {
  final Key key = child.key != null ? ValueKey<Key>(child.key!) : ValueKey<int>(childIndex);
  return RepaintBoundaryModifier(modifierKey: key, child: child);
}