TabBarView中的children要实现AutomaticKeepAliveClientMixin(用with),且重写wantKeepAlive方法
@protected
bool get wantKeepAlive => true;
在build方法中还需要调用super.build(context);
TabBarView中的children要实现AutomaticKeepAliveClientMixin(用with),且重写wantKeepAlive方法
@protected
bool get wantKeepAlive => true;
在build方法中还需要调用super.build(context);