RestorationBucket.empty constructor Null safety

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.

The restorationId must not be null.

Implementation

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