maybeSnapshotChild method

  1. @protected
Widget maybeSnapshotChild(
  1. Widget child
)
inherited

Wraps child in a SnapshotWidget if another sheet route with snapshotting is stacked on top of this one.

Call this in buildTransitions around the content that should be snapshotted when covered by another sheet. Returns child unchanged when no snapshotting is active.

Implementation

@protected
Widget maybeSnapshotChild(Widget child) {
  final controller = _coveredBySnapshotController;
  if (controller == null) return child;
  return SnapshotWidget(
    controller: controller,
    mode: SnapshotMode.permissive,
    autoresize: true,
    child: child,
  );
}