of static method
Find OverlayNotificationEntry by context.
The context should be the BuildContext which build a element in Notification.
Implementation
static OverlayNotificationEntry? of(BuildContext context) {
final animatedOverlay =
context.findAncestorWidgetOfExactType<_AnimatedOverlay>();
assert(() {
if (animatedOverlay == null) {
throw FlutterError('No KeyedOverlay widget found.\n'
'The [context] should be the BuildContext which build a element in Notification.\n'
'is that you called this method from the right scope? ');
}
return true;
}());
if (animatedOverlay == null) {
return OverlayNotificationEntry.empty();
}
return animatedOverlay.overlayNotificationState
.getEntry(key: animatedOverlay.overlayKey);
}