仿照贝壳找房app看点页实现feed流功能。
UI使用了:tabbar+tabbarview+ListView
http通讯:Dio
json:json_serializable
下载刷新/加载更多:flutter_refresh
遇到问题:
1、 tabbarview在切换标签页后, 前一个标签页的状态会丢失。 其实TabbarView也是用的PageView,只需要继承mixin类AutomaticKeepAliveClientMixin并设置wantKeepAlive为true。 原理类似于安卓的ViewPager的pagelimit。
class ContentWidget extends StatefulWidget {
List dataItems;
ContentWidget({Key key, this.title, this.dataItems}) : super(key: key);
// This widget is the home page of your application. It is stateful, meaning
// that it has a State object (defined below) that contains fields that affect
// how it looks.
// This class is the configuration for the state. It holds the values