Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NavHost ¶
func NavHost( navController *NavController, startDestination string, builder func(*NavGraphBuilder), ) api.Composable
Types ¶
type BackStackEntry ¶
type BackStackEntry struct {
Route string
ID string
Arguments maybe.Maybe[NavArguments]
}
func NewBackStackEntry ¶ added in v0.1.45
func NewBackStackEntry(route string, opts ...BackStackEntryOption) BackStackEntry
NewBackStackEntry creates a new BackStackEntry with the given route
type BackStackEntryOption ¶ added in v0.1.45
type BackStackEntryOption func(*BackStackEntry)
BackStackEntryOption configures a BackStackEntry
func WithArguments ¶ added in v0.1.45
func WithArguments(args NavArguments) BackStackEntryOption
WithArguments sets the arguments for a BackStackEntry
type ComposableWithArgs ¶ added in v0.1.45
type ComposableWithArgs func(entry *BackStackEntry) api.Composable
ComposableWithArgs is a function that receives the back stack entry (with arguments)
type NavArgumentSpec ¶ added in v0.1.45
type NavArgumentSpec struct {
}
NavArgumentSpec defines the schema for a navigation argument (like Kotlin's NavArgument) This is the metadata/definition, not the runtime value
func NewNavArgumentSpec ¶ added in v0.1.45
func NewNavArgumentSpec(navType NavType, opts ...NavArgumentSpecOption) NavArgumentSpec
NewNavArgumentSpec creates a new argument spec with the given type and options
type NavArgumentSpecOption ¶ added in v0.1.45
type NavArgumentSpecOption func(*NavArgumentSpec)
NavArgumentSpecOption configures a NavArgumentSpec
func WithDefaultValue ¶ added in v0.1.45
func WithDefaultValue(value any) NavArgumentSpecOption
WithDefaultValue sets the default value for the argument
func WithNullable ¶ added in v0.1.45
func WithNullable(nullable bool) NavArgumentSpecOption
WithNullable sets whether the argument is nullable
type NavArguments ¶ added in v0.1.45
NavArguments holds the runtime argument values (like Kotlin's SavedState)
func (NavArguments) GetBool ¶ added in v0.1.45
func (a NavArguments) GetBool(key string) (bool, bool)
GetBool retrieves a boolean argument
type NavController ¶
type NavController struct {
// contains filtered or unexported fields
}
func NewNavController ¶
func NewNavController(backStack state.TypedMutableValue[[]BackStackEntry]) *NavController
func RememberNavController ¶
func RememberNavController(c api.Composer) *NavController
func (*NavController) CurrentEntry ¶
func (nc *NavController) CurrentEntry() *BackStackEntry
func (*NavController) Navigate ¶
func (nc *NavController) Navigate(route string)
Navigate to a route. Arguments are extracted in NavHost via pattern matching.
func (*NavController) PopBackStack ¶
func (nc *NavController) PopBackStack() bool
type NavGraphBuilder ¶
type NavGraphBuilder struct {
// contains filtered or unexported fields
}
func NewNavGraphBuilder ¶
func NewNavGraphBuilder() *NavGraphBuilder
func (*NavGraphBuilder) Argument ¶ added in v0.1.45
func (b *NavGraphBuilder) Argument(route, name string, spec NavArgumentSpec)
Argument registers an argument spec for a route pattern Example: b.Argument("details/{itemId}", "itemId", NewNavArgumentSpec(NavTypeString))
func (*NavGraphBuilder) Composable ¶
func (b *NavGraphBuilder) Composable(route string, content api.Composable)
Composable adds a destination without arguments (backward compatible)
func (*NavGraphBuilder) ComposableWithArgs ¶ added in v0.1.45
func (b *NavGraphBuilder) ComposableWithArgs(route string, content ComposableWithArgs)
ComposableWithArgs adds a destination that receives the back stack entry