title: can I send nullable data type as argument using safeargs ? if not what should I do?
body: <p>say I have 2 fragments. Login and Home. I set Home fragment as a global destination that has userData as arguments</p>
  
  <p><a href="https://i.stack.imgur.com/D9tyf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/D9tyf.png" alt="enter image description here"></a></p>
  
  <p>if the user is not logged in yet, then it will start from login fragment. after login and get userData from server then it will navigate to Home and pass userData using this code</p>
  
  <pre><code> val home = AuthenticationFragmentDirections.actionGlobalHomeFragment(userData)
   Navigation.findNavController(view).navigate(home, navOptions)
  </code></pre>
  
  <p>but the problem is when the user already login and open the app. in this situation they will directly open the home fragment. and I my app crash with error</p>
  
  <blockquote>
    <p>java.lang.IllegalArgumentException: Required argument "userData" is
    missing and does not have an android:defaultValue</p>
  </blockquote>
  
  <p>so I assume I can set nullable data type in arguments like <code>User?</code>  , so the Home fragment doesn't need userData if it doesn't come from Login</p>
  
  <p>after reading from <a href="https://stackoverflow.com/questions/53661394/how-to-set-null-as-the-default-value-for-a-nullable-argument-using-safeargs">here</a>, I set the argument like this to achieve <code>User?</code> </p>
  
  <pre><code>&lt;argument
      android:name="userData"
      android:defaultValue="@null"
      app:argType="User"
      app:nullable="true" /&gt;
  </code></pre>
  
  <p>but the problem is, it said that I have too many arguments when I put user data to be sent to home from Login fragment</p>
  
  <p>I use this in the gradle</p>
  
  <pre><code>implementation "androidx.navigation:navigation-fragment-ktx:2.3.0-alpha04"
      implementation "androidx.navigation:navigation-ui-ktx:2.3.0-alpha04"
  </code></pre>