Package:flutter/src/widgets/overlay.dart': Failed assertion: line 133 pos 12: '_overlay != null':

Question

Asked by Ravindra B on July 20, 2018 (source).

entry is a instance of OverlayEntry class

entry?.remove();

Error

Package:flutter/src/widgets/overlay.dart': Failed assertion: line 133 pos 12: '_overlay != null':

Answer

Question answered by Ravindra B (source).

Resolved

After lots of research a try I found below a simple solution.

entry?.remove();
entry = null;
DART FLUTTER
SHARE: