title: Change property of RiverPod StateNotifier state
body: <p>When using StateNotifier with Riverpod, how do we notify the change of state whenever we change any property of the state object?</p>
  <pre><code>class UserState {
      String name;
      int age;
      bool isActive;
      bool isLoading;
  
      UserState();
  }
  
  class UserStateNotifier extends StateNotifier&lt;UserState&gt; {
      UserStateNotifier() : super(UserStateNotifier());
      
      void setActive() {
          state.isActive = true; // Changing property of state object doesn't refresh UI
          state = state; // Need to do this to force the change of state object
      }
  
      Future getUserPosts() {
          state.isLoading = true; 
          state = state; 
          
          // await userRepo.getUserPosts();
  
          state.isLoading = false; 
          state = state; 
      }
  }    
  </code></pre>
  <p>As you can see from the example above, I need to set &quot;state = state&quot; multiple times to force the change of state object to notify changes on the UI. While this approach kind of works, but I don't think I'm doing it correctly.. Can someone please help me improve this code?</p>
  <p>Just trying to get better with Riverpod :)</p>
  <p>Thanks!</p>