title: how to use consumer correctly in flutter provider package
body: <p>This is the error message</p>
  <pre><code>: The following NoSuchMethodError was thrown building Consumer&lt;PageOffsetNotifier&gt;(dirty,
  : dependencies: [_InheritedProviderScope&lt;PageOffsetNotifier&gt;]):
  : The method 'unary-' was called on null.
  : Receiver: null
  : Tried calling: unary-()
  </code></pre>
  <p>this is the class with consumer</p>
  <pre><code>class LeopardImage extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return Consumer&lt;PageOffsetNotifier&gt;(
        builder: (context,notifier,child) =&gt; Positioned(
            width:300, left: -notifier.offset,
            child: child,
        ),
        child: Image.asset('assets/leopard.png'),
      );
    }
  }
  </code></pre>
  <p>here <strong>PageOffsetNotifier</strong> is the class which extends with <strong>ChangeNotifier</strong> and passed on to <strong>ChangeNotifierProvider</strong></p>
  <p>the <strong>notifier</strong> will detect the change in offset value while swiping one page to another and perform the desired function.....</p>
  <p>Please tell me what I'm missing or done wrong in the <strong>consumer</strong>, as a result, I'm getting this error</p>