RestorationBucket.empty constructor

RestorationBucket.empty({
  1. required String restorationId,
  2. required Object? debugOwner,
})

Creates an empty RestorationBucket to be provided to adoptChild to add it to the bucket hierarchy.

Instantiating a bucket directly is rare, most buckets are created by claiming a child from a parent via claimChild. If no parent bucket is available, RestorationManager.rootBucket may be used as a parent.

Implementation

RestorationBucket.empty({
  required String restorationId,
  required Object? debugOwner,
}) : _restorationId = restorationId,
     _rawData = <String, Object?>{} {
  assert(() {
    _debugOwner = debugOwner;
    return true;
  }());
  if (kFlutterMemoryAllocationsEnabled) {
    _maybeDispatchObjectCreation();
  }
}