title: null safety ON in Flutter ModalRoute breaks the args passed to RouteSettings arguments
body: <p>It drives me nuts that Flutter example on official <a href="https://flutter.dev/docs/cookbook/navigation/navigate-with-arguments" rel="nofollow noreferrer">documentation page</a> for passing arguments to a named route fails with null-safety turned ON.</p>
  <p>Here's the example I am trying to debug. There's a <code>Consumer</code> building a list view with <code>ListView.builder</code> which returns the following:</p>
  <pre class="lang-dart prettyprint-override"><code>return ListTile(
    title: Text(data.items[index].title),
    onTap: () {
      Navigator.push(
        context,
        MaterialPageRoute(
          builder: (context) =&gt; DetailsScreen(),
          settings: RouteSettings(
            // arguments: data.items[index] // &lt;- this does not work
            arguments: {
              'title': data.items[index].title,  // &lt;- read below
            }
          ),
        ),
      );
    },
  );
  
  </code></pre>
  <p>inside the DetailsScreen I am trying to get the arguments as following:</p>
  <pre class="lang-dart prettyprint-override"><code>final ScreenArguments args = ModalRoute.of(context)!.settings.arguments!;
  </code></pre>
  <p>just like as it is described in the official documentation <a href="https://flutter.dev/docs/cookbook/navigation/navigate-with-arguments" rel="nofollow noreferrer">here</a>. But debugger throws me an error:</p>
  <blockquote>
  <p>A value of type 'Object' can't be assigned to a variable of type 'ScreenArguments'.</p>
  </blockquote>
  <p>though I am just walking through the example and can't find the right way. The <code>print(args.runtimeType);</code> shows that suddenly my arguments are being transformed into unknown yet <code>_InternalLinkedHashMap&lt;String, String&gt;</code> and thus can't be casted as <code>ScreenArguments</code> in the example above. The only way I can get the args by not setting the type like this:</p>
  <pre class="lang-dart prettyprint-override"><code>final args = ModalRoute.of(context)!.settings.arguments!;
  </code></pre>
  <p>but again it's not possible to get anything from this Object since it does not implement getters of my custom object obviously.</p>
  <p>I also tried to convert the passed argument as a String from json-like object, but the arguments are still converted into <code>_InternalLinkedHashMap</code>. Don't understand where to go further from here...</p>
  <hr />
  <p>UPDATE</p>
  <p>So I do not know what happened exactly, but from what I see in the performance of Android Studio, it heavily depends on available CPU power as well as memory. I did not clean up the cache, but restarted the MacOS, accordingly all system garbage collectors should have cleaned up some system cache, then restarted the Android Studio and then tried to cast the</p>
  <pre class="lang-dart prettyprint-override"><code>arguments: {
    'title': menusData.menus[index].title.toString(),
  }
  </code></pre>
  <p>as Map like this:</p>
  <pre class="lang-dart prettyprint-override"><code>final args = ModalRoute.of(context)!.settings.arguments! as Map;
  </code></pre>
  <p>and suddenly printing the result in the child Widget like this</p>
  <pre class="lang-dart prettyprint-override"><code>print(args);
  print(args.runtimeType);
  print(args['title']);
  </code></pre>
  <p>yeilds the following result:</p>
  <pre class="lang-sh prettyprint-override"><code>I/flutter ( 8653): _InternalLinkedHashMap&lt;String, String&gt;
  I/flutter ( 8653): my custom string
  </code></pre>
  <p>which is not perfect, because I stull have to work with the `` class, yet I am able to get the passed String argument and use it in the child Widget. IMO this is still not how it is supposed to work...</p>