title: show alert on cubit state in flutter
body: <p>I know we can return different widgets on certain state of cubit, but how can we show an alert or other interactions on states:</p>
  <pre><code>BlocBuilder&lt;LoginCubit, LoginState&gt; (
    builder: (context, LoginState loginState) {
      if (loginState is LoginInitial) {
        return Text(&quot;LoginInitial&quot;);
      } else if (loginState is LoginLoading) {
        return Text(&quot;LoginLoading&quot;);
      } else if (loginState is LoginLoaded) {
        return Text(&quot;LoginLoaded&quot;);
      } else if (loginState is LoginError) {
        return Text(&quot;LoginError&quot;);
      } else {
        return Container();
      }
    },
  )
  </code></pre>
  <p>here in LoginError I want to show an alert dialog.</p>