title: Invalid radix-10 number index while generating route in flutter
body: <p>while I was trying to generate page route using onGenerateRouter, I was getting "Invalid radix-10 numberindex" error</p>
  
  <p>page url : /offer/3</p>
  
  <pre><code>onGenerateRoute: (RouteSettings settings){
        if(!_isAuthorized){
          return MaterialPageRoute&lt;bool&gt;(
            builder: (BuildContext context) =&gt; Login()
          );
        }
        final List&lt;String&gt; pathElements = settings.name.split('/');
        if(pathElements[0] !='') {
          return null;
        }
        if(pathElements[1] == 'offer') {
          final int offerId = int.parse(pathElements[2]);
          return MaterialPageRoute(
            builder: (BuildContext context) =&gt; OfferDetailsPage(offerId)
          );
        }
      }
  </code></pre>