onTrigger method

  1. @override
void onTrigger()
override

Implementation

@override
void onTrigger() {
  if (entry == null) {
    WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
      entry = OverlayEntry(builder: (_) => ChannelObserver());
      Overlay.of(ctx!).insert(entry!);
    });
  } else {
    entry?.remove();
    entry = null;
  }
}