title: flutter Hooks Widget useState() with Object
body: <p>I am using <code>useState</code> to trigger refresh, now this is my define, I define a parameter with an object:</p>
  <pre><code>import '../../Item.dart';
  
  class ArticleRequest{
    ArticleRequest({
      this.latestTime,
      this.storiesType,
      this.pageSize,
    });
  
    int latestTime;
    StoriesType storiesType;
    int pageSize=20;
  }
  </code></pre>
  <p>then pass it by parameter:</p>
  <pre><code>return SmartRefresher(
                          onRefresh: () {
                            print(&quot;trigger&quot;);
                            articleRequest.latestTime = DateTime.now().millisecondsSinceEpoch;
                            counter.value = articleRequest;
  
                            _refreshController.refreshCompleted();
                          },
                          enablePullUp: true,
                          enablePullDown: true,
                          controller: _refreshController,
                          onLoading: () {
                            print(&quot;loading&quot;);
                            _refreshController.loadComplete();
                          },
                          footer: CustomFooter(
                            builder: (BuildContext context, LoadStatus mode) {
                              Widget body;
                              if (mode == LoadStatus.idle) {
                                body = Text(&quot;pull up load&quot;);
                              } else if (mode == LoadStatus.loading) {
                                //body =  CupertinoActivityIndicator();
                              } else if (mode == LoadStatus.failed) {
                                body = Text(&quot;Load Failed!Click retry!&quot;);
                              } else if (mode == LoadStatus.canLoading) {
                                body = Text(&quot;release to load more&quot;);
                              } else {
                                body = Text(&quot;No more Data&quot;);
                              }
                              return Container(
                                height: 55.0,
                                child: Center(child: body),
                              );
                            },
                          ),
                          child: CustomScrollView(
                            key: PageStorageKey(type),
                            slivers: &lt;Widget&gt;[
                              SliverOverlapInjector(
                                handle: NestedScrollView
                                    .sliverOverlapAbsorberHandleFor(
                                  context,
                                ),
                              ),
                              SliverPadding(
                                padding:
                                    const EdgeInsets.symmetric(vertical: 8.0),
                                sliver: ArticlesPage(
                                  type: counter.value,
                                ),
                              )
                            ],
                          ));
  </code></pre>
  <p>when I change the parameter object in <code>onRefresh</code> function:</p>
  <pre><code>articleRequest.latestTime = DateTime.now().millisecondsSinceEpoch;
  counter.value = articleRequest;
  </code></pre>
  <p>but the subcomponent not triggered refresh, why did this happen? what should I to to trigger <code>ArticlesPage</code> rerender? this is my <code>useState</code>:</p>
  <pre><code>final counter = useState&lt;ArticleRequest&gt;();
  </code></pre>
  <p>what I have tried,make the state object editable</p>
  <pre><code>var counter = useState&lt;ArticleRequest&gt;();
  </code></pre>
  <p>but it still not work, did not trigger refresh.</p>