num indexOf(ViewRef viewRef)

Returns the index of the View, specified via ViewRef, within the current container or -1 if this container doesn't contain the View.

Source

num indexOf(ViewRef viewRef) =>
    _element.nestedViews.indexOf((viewRef as ViewRefImpl).appView);