Overlay constructor Null safety

const Overlay(
  1. {Key? key,
  2. List<OverlayEntry> initialEntries = const <OverlayEntry>[],
  3. Clip clipBehavior = Clip.hardEdge}

Creates an overlay.

The initial entries will be inserted into the overlay when its associated OverlayState is initialized.

Rather than creating an overlay, consider using the overlay that is created by the Navigator in a WidgetsApp or a MaterialApp for the application.


const Overlay({
  Key? key,
  this.initialEntries = const <OverlayEntry>[],
  this.clipBehavior = Clip.hardEdge,
}) : assert(initialEntries != null),
     assert(clipBehavior != null),
     super(key: key);