@Override
  public void updateParameterInfo(@NotNull PsiElement place, UpdateParameterInfoContext context) {
    int parameterIndex = DartResolveUtil.getArgumentIndex(place);
    context.setCurrentParameter(parameterIndex);

    if (context.getParameterOwner() == null) {
      context.setParameterOwner(place);
    } else if (context.getParameterOwner()
        != PsiTreeUtil.getParentOfType(place, DartCallExpression.class, DartNewExpression.class)) {
      context.removeHint();
      return;
    }
    final Object[] objects = context.getObjectsToView();

    for (int i = 0; i < objects.length; i++) {
      context.setUIComponentEnabled(i, true);
    }
  }
 @Override
 public PsiElement findElementForUpdatingParameterInfo(UpdateParameterInfoContext context) {
   return context.getFile().findElementAt(context.getEditor().getCaretModel().getOffset());
 }