title: stuck on cubit changing state to 2 widgets
body: <p>I have my base code working for cubit to update a simple counter in a class that is in a row on my app listview.</p>
  <p>I want to update the counter of  total items using bottomNavigationBar and a totalbagel field which is in a different class that my cubit.   I wrapped my navbar text field totalbabgel in a block see below.</p>
  <p>My issue is i do not know how to call in the cubit field in my bottom nav bar variable.</p>
  <p>What is the correct format to reference a state variable from my cubit class??  All the online examples show only cubit state within same class text update.  I need update state in 2 widgets.</p>
  <p>text</p>
  <pre><code>     bottomNavigationBar: BottomAppBar(
              child: Row(
                children: [
                  //IconButton(icon: Icon(Icons.menu), onPressed: () {}),
                  Spacer(),
                  Container(
                    height: 55.0,
                    width: 1.0,
                  ),
                  //TODO get bakerdoz and etotal on footer working need to pass data between main and bagelcounter
      
                BlocBuilder&lt;CounterCubit, CounterCubitState&gt;(
                          key: UniqueKey(),
                          builder: (context,state)
                           =&gt; Text(&quot;Baker's Dozen: &quot; +  $totalbagels  + &quot;    Singles:  $singles&quot;,
                      style: TextStyle(
                          color: Colors.white,
                          fontSize: 20.0,
                          fontWeight: FontWeight.w500)),
      
                ),
  
  
  my test cubit  increment code:
  
   
  
         CounterCubit()
            : super(CounterCubitInitial(dozcount: 0, singcount: 0, totalbagels: 0));
      
        void increment() {
          int  holdcart = (state.totalbagels + 1);
          holdtotal = ((state.totalbagels + 1) ~/ 13);
          holdsingle = ((state.totalbagels + 1) % 13);
          print(&quot;+holdsingle: &quot; + holdsingle.toStringAsFixed(2));
          print(&quot;+holdtotal: &quot; + holdtotal.toStringAsFixed(2));
          print(&quot;+holdcart: &quot; + holdcart.toStringAsFixed(2));
          CartTotal(holdcart);
      
          emit(CounterCubitIncreased(
            totalbagels: (state.totalbagels + 1),
            // dozcount: ((state.totalbagels +1) ~/ 13),
            singcount: ((state.totalbagels +1) % 13),
      
            // singcount: ((state.totalbagels +1) % 13),
          ));
        }
  </code></pre>