title: What is the difference between between context.watch and context.read in flutter_bloc?
body: <p>I just learn about a cubit in a flutter. I learn in the tutorial video, so in that video, the mentor made a login page that contains an email and password text field and one login button. In that video, the mentor still uses the old version of flutter_bloc. There is a warning when I follow one of the code lines</p>
  <pre><code>child: ElevatedButton(
    onPressed: () {
      context.watch&lt;AuthCubit&gt;().signIn(
       _emailController.text,
       _passwordController.text);
  }
  </code></pre>
  <p>that code is written inside the onPressed function button.
  it says that <code>context.bloc</code> is deprecated. When I try to run the app it returns an error because the flutter_bloc's version I used has not supported null safety so I upgrade it to the current version (7.3.1) and I found this in version 6.1.0 changelog (you can see it in <a href="https://pub.dev/packages/flutter_bloc/changelog" rel="nofollow noreferrer">flutter_bloc change log</a> )</p>
  <pre><code>deprecated: context.bloc in favor of context.read and context.watch
  </code></pre>
  <p>Because I don't know the difference I just change <code>context.bloc</code> to <code>context.watch</code> then I run the app again and it returns another error</p>
  <pre><code>Tried to listen to a value exposed with a provider, from outside of the widget tree.
  
  This is likely caused by an event handler (like a button's onPressed) that called
  Provider.of without passing `listen: false`.
  
  To fix, write:
  Provider.of&lt;AuthCubit&gt;(context, listen: false);
  
  It is unsupported because may pointlessly rebuild the widget associated to the
  the event handler, when the widget tree doesn't care about the value.
  ...
  </code></pre>
  <p>And when I change it to <code>context.read</code> it works. I am wondering about the difference between them</p>