title: Flutter Riverpod combine FutureProviders into a StateNotifierProvider
body: <p>Im using riverpod with Freezed unions.</p>
  <p>Im trying to merge/watch two <code>FutureProviders</code> that both return the same type into a <code>StateNotifierProvider</code> and use them to set state.</p>
  <p>I've noticed that because im watching two futureProviders, that it creates two instance of the <code>StateNotifierProvider</code> because...</p>
  <p>From Logging I can see that init method gets called twice, <code>clocking state</code> gets called twice and <code>DPS state</code> gets called once.</p>
  <p>Im failing at the first hurdle but my hope is to:
  show itineraryState (doubles as loading screen)
  get data for DPS state
  pause for 10 seconds
  show dps state</p>
  <p>I realise the below example has no timer implemented, but I need to figure out the problem with StateNotfierProvider and then I'll move on to adding the pause ect.</p>
  <p>To be honest im not even sure this is the correct way of doing things?</p>
  <p>I thought about maybe setting up two consumers for each futureprovider in the widget but this seems a little cumbersome.
  Would be good if I could manage multiple future providers in a state provider.</p>
  <pre><code>final clockingState = StateNotifierProvider&lt;ClockingNotifier, ClockingState&gt;(
      (ref) =&gt; ClockingNotifier(
          ref.watch(loadingItineraryProvider), ref.watch(clockingDps)));
  
  class ClockingNotifier extends StateNotifier&lt;ClockingState&gt; {
    final AsyncValue&lt;ClockingState&gt; itineraryState;
    final AsyncValue&lt;ClockingState&gt; clockingDps;
  
    ClockingNotifier(this.itineraryState, this.clockingDps)
        : super(ClockingState.init()) {
      init();
    }
  
    void init() {
      logger.d(&quot;the init method&quot;);
      itineraryState.whenData((ClockingState clockingState) {
        logger.d(&quot;clocking state&quot;);
        state = clockingState;
      });
      clockingDps.whenData((ClockingState dps) {
        logger.d(&quot;DPS state&quot;);
        state = dps;
      });
    }
  }
  
  </code></pre>