Flutter: Default Tab Bar Controller does not maintain state after swipe

后端 未结 4 1936
北恋
北恋 2021-01-03 09:55

I am writing an application in flutter that has 4 tabbed views, kinda like the stock android phone app or clock app. One of those views hash a floating action button that wh

4条回答
  •  暖寄归人
    2021-01-03 10:24

    class _RepoInfoState extends State with AutomaticKeepAliveClientMixin {
    
      @override
      bool get wantKeepAlive => true; // Note here
    
      @override
      Widget build(BuildContext context) {
        super.build(context); // Note here
    
        return Text('嘿');
      }
    
    }
    

提交回复
热议问题