title: Flutter / Dart using Scoped Model with descendants and Navigator
body: <p>I've been struggling with this one since yesterday - I'm creating new ScopedModel obj in tab controller (ScreenTabs), and then passing it to multiple tabs in BottomNavigationBar (1st level descendants, for example: ScreenBook) by wrapping each tab as ScopedModelDescendant. So far so good - everything's working as expected.</p>
  
  <p>The problem arises, when in one of my tabs, I'd like to navigate to it's child (2nd level descendant, for example:  ScreenBookDetails) and use ScopedModel there. I've already tried using ScopedModelDescendant and ScopedModel.of(context) with no luck - getting Error: Could not find the correct ScopedModel everytime.</p>
  
  <p>My code (skipped some for brevity):</p>
  
  <h1>TabController</h1>
  
  <pre><code>...
  class ScreenTabsState extends State&lt;ScreenTabs&gt; {
  ModelTabs modelTabs = ModelTabs(); //new Model object
  var screens = [new ScreenHome(),new ScreenBook(),];
  
  @override
  Widget build(BuildContext context) {
  return ScopedModel&lt;ModelTabs&gt;(
  model: modelTabs, 
  child: Scaffold(...)
  body: Builder (builder: (context) =&gt; Container(child:  
  screens.elementAt(selectedIndex),)),
  bottomNavigationBar: BottomNavigationBar(
  currentIndex: selectedIndex,
  items: [...],
  onTap: onTabTapped,
  ),)...}
  </code></pre>
  
  <h1>ScreenBook (1st ddescendant - ScpodedModel works as expected)</h1>
  
  <pre><code>...
  class ScreenBookState extends State&lt;ScreenBook&gt; {
  
  @override
  Widget build(BuildContext context) {
  return new Scaffold(
  body: ScopedModelDescendant&lt;ModelTabs&gt;(builder: (context, child, model) {
  print(TAG + "model status:" +  model.status.toString());
  return model.status == Status.LOADING ? MyCircularProgressIndicator() :         
  Builder (builder: (context) =&gt; 
  Card(...
  child: InkWell(
  onTap: (){
  Navigator.of(context).pushNamed("/ScreenBookDetails");},))}}
  </code></pre>
  
  <h1>ScreenBookDetails (1st ddescendant - error)</h1>
  
  <pre><code>...
  class ScreenBookDetailsState extends State&lt;ScreenBookDetails&gt;{
  
  @override
  Widget build(BuildContext context) {
  return Scaffold(
  body: ScopedModelDescendant&lt;ModelTabs&gt;(builder: (context, child, model) {
  print(TAG + "scoped model status: " + model.status.toString()); //Error: Could not find the correct ScopedModel.
  return model.status == Status.LOADING ? MyCircularProgressIndicator() :     Builder(builder: (context) =&gt; Column(...)
  ...
  </code></pre>
  
  <p>can somebody point me the right way to fix thiis problem please? I'm new to Dart and Flutter, so there might be something that I did not understood clearly as I'm facing similar problem when creating ScopedModel obj in ScreenSplashScreen then navigating to ScreenLogIn and trying to use it there.</p>
  
  <p>Thank you! :)</p>