class NavArgument


NavArgument denotes an argument that is supported by a NavDestination.

A NavArgument has a type and optionally a default value, that are used to read/write it in a SavedState. It can also be nullable if the type supports it.

Summary

Nested types

A builder for constructing NavArgument instances.

Public functions

open operator Boolean
equals(other: Any?)
open Int
open String

Public properties

Any?

The default value of this argument or null if it doesn't have a default value.

Boolean

Used to distinguish between a default value of null and an argument without an explicit default value.

Boolean

Whether this argument allows passing a null value.

NavType<Any?>

The type of this NavArgument.

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

defaultValue

Added in 1.0.0
val defaultValueAny?

The default value of this argument or null if it doesn't have a default value. Use isDefaultValuePresent to distinguish between null and absence of a value.

Returns
Any?

The default value assigned to this argument.

isDefaultValuePresent

Added in 1.0.0
val isDefaultValuePresentBoolean

Used to distinguish between a default value of null and an argument without an explicit default value.

Returns
Boolean

true if this argument has a default value (even if that value is set to null), false otherwise

isNullable

Added in 1.0.0
val isNullableBoolean

Whether this argument allows passing a null value.

Returns
Boolean

true if null is allowed, false otherwise

type

Added in 1.0.0
val typeNavType<Any?>

The type of this NavArgument.

Returns
NavType<Any?>

the NavType object denoting the type that can be help in this argument.