The Android Developer Challenge is back! Submit your idea before December 2.

NavArgumentBuilder

class NavArgumentBuilder
kotlin.Any
   ↳ androidx.navigation.NavArgumentBuilder

DSL for constructing a new NavArgument

Summary

Public constructors

DSL for constructing a new NavArgument

Public methods

NavArgument

Builds the NavArgument by calling NavArgument.Builder.build.

Properties

Any?

An optional default value for this argument.

Boolean

Controls if this argument allows null values.

NavType<*>

Sets the NavType for this argument.

Public constructors

<init>

NavArgumentBuilder()

DSL for constructing a new NavArgument

Public methods

build

fun build(): NavArgument

Builds the NavArgument by calling NavArgument.Builder.build.

Properties

defaultValue

var defaultValue: Any?

An optional default value for this argument.

Any object that you set here must be compatible with type, if it was specified.

nullable

var nullable: Boolean

Controls if this argument allows null values.

type

var type: NavType<*>

Sets the NavType for this argument.

If you don't set a type explicitly, it will be inferred from the default value of this argument.