|
|
@ -25,6 +25,11 @@ class _CommunityPageState extends State<CommunityPage>
|
|
|
|
with TickerProviderStateMixin, AutomaticKeepAliveClientMixin {
|
|
|
|
with TickerProviderStateMixin, AutomaticKeepAliveClientMixin {
|
|
|
|
TabController _tabController;
|
|
|
|
TabController _tabController;
|
|
|
|
List<String> _tabs = ['最新', '话题', '我的'];
|
|
|
|
List<String> _tabs = ['最新', '话题', '我的'];
|
|
|
|
|
|
|
|
GlobalKey<TopicCommunityViewState> topicKey =
|
|
|
|
|
|
|
|
GlobalKey<TopicCommunityViewState>();
|
|
|
|
|
|
|
|
GlobalKey<MyCommunityViewState> myKey = GlobalKey<MyCommunityViewState>();
|
|
|
|
|
|
|
|
GlobalKey<NewCommunityViewState> newKey = GlobalKey<NewCommunityViewState>();
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
void initState() {
|
|
|
|
void initState() {
|
|
|
|
super.initState();
|
|
|
|
super.initState();
|
|
|
@ -47,7 +52,22 @@ class _CommunityPageState extends State<CommunityPage>
|
|
|
|
),
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
fab: FloatingActionButton(
|
|
|
|
fab: FloatingActionButton(
|
|
|
|
onPressed: () => Get.to(AddNewEventPage()),
|
|
|
|
onPressed: () async {
|
|
|
|
|
|
|
|
bool result = await Get.to(AddNewEventPage());
|
|
|
|
|
|
|
|
if (result == true) {
|
|
|
|
|
|
|
|
switch (_tabController.index) {
|
|
|
|
|
|
|
|
case 0:
|
|
|
|
|
|
|
|
newKey.currentState.refresh();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 1:
|
|
|
|
|
|
|
|
topicKey.currentState.refresh();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 2:
|
|
|
|
|
|
|
|
myKey.currentState.refresh();
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
heroTag: 'event_add',
|
|
|
|
heroTag: 'event_add',
|
|
|
|
child: Icon(Icons.add),
|
|
|
|
child: Icon(Icons.add),
|
|
|
|
),
|
|
|
|
),
|
|
|
@ -64,9 +84,9 @@ class _CommunityPageState extends State<CommunityPage>
|
|
|
|
),
|
|
|
|
),
|
|
|
|
body: TabBarView(
|
|
|
|
body: TabBarView(
|
|
|
|
children: [
|
|
|
|
children: [
|
|
|
|
NewCommunityView(),
|
|
|
|
NewCommunityView(key: newKey),
|
|
|
|
TopicCommunityView(),
|
|
|
|
TopicCommunityView(key: topicKey),
|
|
|
|
MyCommunityView(),
|
|
|
|
MyCommunityView(key: myKey),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
controller: _tabController,
|
|
|
|
controller: _tabController,
|
|
|
|
),
|
|
|
|
),
|
|
|
|