title: How to get route arguments of parent routes?
body: <p>A bit simplified, my app routes have three levels of nesting:</p>
  
  <pre><code>/profile
    /course
      /quiz
  </code></pre>
  
  <p>These are represented by named routes, <code>/profile</code>, <code>/profile/course</code> and <code>/profile/course/quiz</code>. These routes map to widgets: <code>ProfileScreen</code>, <code>CourseScreen</code> and <code>QuizScreen</code>. Each of these takes an argument: the <code>Profile</code>, <code>Course</code> and <code>Quiz</code> model objects, respectively.</p>
  
  <p>If I understand correctly, the <code>Navigator</code> will ensure that parent routes will always be on the stack before child routes, so when we're on the <code>/profile/course/quiz</code> route, we'll have <code>/profile/course</code> above that.</p>
  
  <p><strong>Now I'm inside the <code>QuizScreen</code> widget, and I want to access the current <code>Course</code>. How do I do that?</strong></p>
  
  <p>It's somewhere on the route stack, but <code>ModalRoute.of(context)</code> will of course give me the <code>/profile/course/quiz</code> route, not the <code>/profile/course</code> route, so <code>ModalRoute.of(context).settings.arguments</code> will be a <code>Quiz</code>.</p>
  
  <p>I tried wrapping the <code>CourseScreen</code> in a <code>Provider&lt;Course&gt;</code> widget (from the excellent <code>providers</code> package) which provides the <code>Course</code> down to child widgets, but sub-routes actually become sibling widgets, not children.</p>
  
  <p>Of course I could explicitly pass the <code>Course</code> down to the <code>/profile/course/quiz</code> route as a second argument (wrapped together with the <code>Quiz</code> in an array or object), but this seems needlessly convoluted and doesn't scale well.</p>
  
  <p>Is there a way to get the route arguments of a parent route? Or does this actually indicate that I'm doing it wrong and should be designing my app differently?</p>