execute method

  1. @override
Future<bool?> execute(
  1. String caller,
  2. String propertyOrFunction,
  3. List arguments
)
override

Implementation

@override
Future<bool?> execute(
    String caller, String propertyOrFunction, List<dynamic> arguments) async {
  /// setter
  if (scope == null) return null;
  var function = propertyOrFunction.toLowerCase().trim();

  switch (function) {
    case "open":
      var view = findListenerOfExactType(TooltipViewState);
      if (view is TooltipViewState &&
          context != null &&
          view.overlayEntry == null) view.showOverlay(context!);
      return true;

    case "close":
      var view = findListenerOfExactType(TooltipViewState);
      if (view is TooltipViewState && view.overlayEntry != null) {
        view.hideOverlay();
      }
      return true;
  }
  return super.execute(caller, propertyOrFunction, arguments);
}