LayoutId constructor Null safety

LayoutId(
  1. {Key? key,
  2. required Object id,
  3. required Widget child}
)

Marks a child with a layout identifier.

Both the child and the id arguments must not be null.

Implementation

LayoutId({
  Key? key,
  required this.id,
  required Widget child,
}) : assert(child != null),
     assert(id != null),
     super(key: key ?? ValueKey<Object>(id), child: child);