uniquejava / blog

My notes regarding the vibrating frontend :boom and the plain old java :rofl.
Creative Commons Zero v1.0 Universal
11 stars 5 forks source link

flutter tabs with stateless/stateful widgets as tab #286

Open uniquejava opened 4 years ago

uniquejava commented 4 years ago

stateless和stateful widget作为tab有何不同

关键词:AutomaticKeepAliveClientMixin

Flutter: Creating Tabs in AppBar and associating it with Stateless and Stateful Widgets

结论:

  1. A stateful widget will be recreated every time the corresponding tab is selected
  2. When used as a tab action widgets, A stateless widget doesn’t instantiate every time the tab is selected while for a stateful widget it does every time.

TabBar without appBar

关键词: flexibleSpace

https://github.com/flutter/flutter/issues/17459#issuecomment-387984398

push/pop导致parent widget rebuild