Hero constructor Null safety

const Hero(
  1. {Key? key,
  2. required Object tag,
  3. CreateRectTween? createRectTween,
  4. HeroFlightShuttleBuilder? flightShuttleBuilder,
  5. HeroPlaceholderBuilder? placeholderBuilder,
  6. bool transitionOnUserGestures = false,
  7. required Widget child}
)

Create a hero.

The tag and child parameters must not be null. The child parameter and all of the its descendants must not be Heroes.

Implementation

const Hero({
  super.key,
  required this.tag,
  this.createRectTween,
  this.flightShuttleBuilder,
  this.placeholderBuilder,
  this.transitionOnUserGestures = false,
  required this.child,
}) : assert(tag != null),
     assert(transitionOnUserGestures != null),
     assert(child != null);