Skip to content

kite-runtime / jp.co.cyberagent.kite.runtime / androidx.fragment.app.Fragment / kiteDsl

kiteDsl

fun Fragment.kiteDsl(scopeModelStoreOwner:KiteScopeModelStoreOwner= this, kiteContext: KiteContext = KiteContext(), block: KiteDslScope.() ->Unit):Unit

Creates a KiteDslScope and calls the specified kite DSL block with this scope. Can only invoke this function inside Fragment.onViewCreated, otherwise IllegalStateException will be thrown.

Several element will be set into the KiteContext of the scope:

  • Context
  • Fragment
  • Activity
  • LifecycleOwner
  • SaveStateHandle

These elements can be retrieved via their type as the key.

Parameters

scopeModelStoreOwner - the scope of the KiteScopeModel. The default value if the fragment itself.

kiteContext - additional to context of the the scope.

block - the DSL that will be invoked in the scope.