title: How can a named route have URL parameters in flutter web?
body: <p>I'm building a web-app which needs to have a route that gets a post ID and then it will fetch the post using the ID.</p>
  <p>How can I have URL arguments let's say <code>/post/:id</code> so id is the argument</p>
  <p>My app looks like that currently:</p>
  <pre class="lang-dart prettyprint-override"><code>class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        // title: &quot;Paste&quot;,
        initialRoute: &quot;/&quot;,
        theme: ThemeData(
            primarySwatch: Colors.green,
            primaryColor: Colors.blue
        ),
        routes: {
          &quot;/&quot;: (context) =&gt; HomePage(),
          &quot;/post&quot;: (context) =&gt; PastieRoute()
        },
        debugShowCheckedModeBanner: false
      );
    }
  }
  </code></pre>
  <p>EDIT:
  This is what I tried according to @BloodLoss and for some reason I don't get anything to the console when accessing <code>localhost:8080/post?id=123</code></p>
  <pre class="lang-dart prettyprint-override"><code>class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        initialRoute: &quot;/&quot;,
        routes: {
          &quot;/&quot;: (context) =&gt; HomePage(),
          &quot;/post&quot;: (context) =&gt; PastieRoute()
        },
        onGenerateRoute: (settings) {
          if (settings.name == &quot;/post&quot;) {
            print(settings.arguments); // Doesn't fire :(
  
            return MaterialPageRoute(
              builder: (context) {
                // TODO
              }
            );
          }
        },
        debugShowCheckedModeBanner: false
      );
    }
  }
  </code></pre>