WillPopScope constructor Null safety

const WillPopScope(
  1. {Key? key,
  2. required Widget child,
  3. required WillPopCallback? onWillPop}
)

Creates a widget that registers a callback to veto attempts by the user to dismiss the enclosing ModalRoute.

The child argument must not be null.

Implementation

const WillPopScope({
  super.key,
  required this.child,
  required this.onWillPop,
}) : assert(child != null);