createOverlayEntries method
Creates the overlay entries for this route.
Subclasses must implement this to define what layers the route contributes to the overlay stack.
Implementation
@override
Iterable<OverlayEntry> createOverlayEntries() {
return [
// Barrier entry
_createBarrierEntry(),
// Content entry
OverlayEntry(
opaque: false,
maintainState: true,
builder: (context) {
Widget content = builder(context);
// Apply size constraints if specified.
if (width != null || height != null) {
content = SizedBox(width: width, height: height, child: content);
}
return Align(alignment: alignment, child: content);
},
),
];
}