title: Flutter - InheritedModel still update child even if it does not match an aspect
body: <p>Good day. I've watched a video about Flutter's InheritedModel and got interested on it. Unfortunately, I can't seems to make it work properly.</p>
  
  <hr>
  
  <p>Summary: Need help how to properly implement InheritedModel.</p>
  
  <p><strong>Expected Code Output:</strong> Widget <code>CountText</code> should not be updated when updating <code>count</code> parameter in <code>CountModel</code>.</p>
  
  <p><strong>Actual Code Output</strong>: <code>CountText</code> still updates (I think this is due to that the parent widget is a <code>StatefulWidget</code>)</p>
  
  <hr>
  
  <h1><strong>Details</strong></h1>
  
  <p>I am trying to implement a <code>Counter</code> app using <code>InheritedModel</code>. Code below is my code</p>
  
  <pre><code>import 'package:flutter/material.dart';
  
  class CountModel extends InheritedModel&lt;String&gt; {
  
    final int count;  
  
    CountModel({ this.count, child }) : super(child: child);
  
    @override
    bool updateShouldNotify(CountModel oldWidget) {
      if (oldWidget.count != count) {
        return true;
      }
      return false;
    }
  
    @override
    bool updateShouldNotifyDependent(InheritedModel&lt;String&gt; oldWidget, Set&lt;String&gt; dependencies) {
      if (dependencies.contains('counter')) {
        return true;
      }
      return false;
    }
  
    static CountModel of(BuildContext context, String aspect) {
      return InheritedModel.inheritFrom&lt;CountModel&gt;(context, aspect: aspect);
    }
  
  }
  
  class App extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        title: 'Counter',
        theme: Theme.of(context),
        home: Counter(),
      );
    }
  }
  
  class Counter extends StatefulWidget {
    @override
    CounterState createState() =&gt; CounterState();
  }
  
  class CounterState extends State&lt;Counter&gt; {
  
    int count = 0;
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        appBar: AppBar(
          // title: Text("Counter"),
        ),
        body: CountModel(
          count: count,
          child: CounterText()
        ),
        floatingActionButton: FloatingActionButton(
          onPressed: () {
            setState(() {
              ++count;          
            });
          },
          child: Icon(Icons.add),
        ),
      );
    }
  }
  
  class CounterText extends StatelessWidget {
  
    @override
    Widget build(BuildContext context) {
      CountModel model = CountModel.of(context, 'test');
      return Text('Count: ${model.count}');
    }  
  
  }
  </code></pre>
  
  <hr>
  
  <p>I have a CountModel as <code>InheritedModel</code> and a <code>CountText</code> widget which consumes the data from the <code>CountModel</code>. As you can see in the implementation of the <code>CountText</code>, it pass <code>test</code> when getting the <code>CountModel</code>. In my understanding, it should not be updated when the <code>count</code> value is updated in the CountModel. Unfortunately, this does not happen.</p>