wrap static method

Widget wrap(
  1. BuildContext context,
  2. RouteQueueEntry entry,
  3. Widget child
)

Implementation

static Widget wrap(
    BuildContext context, RouteQueueEntry entry, Widget child) {
  if (entry.isErrorEntry) return child;

  final bucket = RouteRestorable.maybeOf(context)?.bucket;
  if (bucket == null) return child;

  return UnmanagedRestorationScope(
    bucket: bucket,
    child: RestorationScope(
      restorationId: entry.restorationId,
      child: child,
    ),
  );
}