Package 

Interface ResultBackNavigator


  • @Stable() 
    public interface ResultBackNavigator<R extends Object>
    
                        

    Navigator that allows navigating back while passing a result of type R.

    If declared as a parameter of a @Destination annotated Composable, Compose Destinations will provide a correct implementation.

    If you're manually calling that Composable, then you can use com.ramcosta.composedestinations.scope.resultBackNavigator extension function to get a correctly typed implementation. To get a correctly typed com.ramcosta.composedestinations.navargs.DestinationsNavType in this case, check what the generated Destination object uses.

    Type safety related limitations (compile time enforced):

    • R must be a valid navigation argument type.

    • Each annotated Composable can have at most one parameter of type ResultBackNavigator

    • Method Summary

      Modifier and Type Method Description
      abstract Unit navigateBack(R result) Goes back to previous destination sending result.
      abstract Unit navigateBack() Goes back to previous destination sending the last result set with setResult or just navigating if no result was set.
      abstract Unit setResult(R result) Sets a result to be sent on the next navigateBack call.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait