showAnchoredHelper method

Future showAnchoredHelper(
  1. String anchorKeyId,
  2. AnchoredHelper helper, {
  3. HelperAlignment? align,
  4. bool isInModal = false,
})

This shows an AnchoredHelper above your page as overlay

requires anchorKeyId that must have been generated within a widget using

HelperOrchestrator.of(context).generateKey('myKeyId')

Implementation

Future showAnchoredHelper(
  String anchorKeyId,
  AnchoredHelper helper, {
  HelperAlignment? align,
  bool isInModal = false,
}) async {
  try {
    //final key = getAnchorKey(anchorKeyId) as ValueKey<String>;
    final anchor =
        await findAnchor(anchorKeyId, align: align, isInModal: isInModal);
    if (anchor == null) {
      debugPrint("anchor cannot be found. show anchored failed");
      return;
    }
    _overlayHelper.showHelper(
      context,
      (context) => AnchorHelperWrapper(
        anchor: anchor,
        child: helper,
      ),
    );
  } catch (e, s) {
    debugPrint("show anchored helper failed: $e $s");
  }
}