preface

A TabBarView component is used to page up and down the page, which triggers init and build of the page. The page will return to the top of the page.

The first step: in every page with AutomaticKeepAliveClientMixin

Step 2: Override the wantKeepAlive method in these pages

Step 3: Call super.build() at the beginning of build for these pages

At the end

At this point, the Tabbarview state is saved. If I switch TAB, init and build won’t be called again, and if I scroll to the bottom of the page, I’ll still be at the bottom.