|
|
|
@ -1,10 +1,16 @@
|
|
|
|
|
import 'package:dio/dio.dart'; |
|
|
|
|
import 'package:flutter/cupertino.dart'; |
|
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
|
import 'package:flutter_easyloading/flutter_easyloading.dart'; |
|
|
|
|
import 'package:huixiang/mine/follow_page.dart'; |
|
|
|
|
import 'package:huixiang/retrofit/data/base_data.dart'; |
|
|
|
|
import 'package:huixiang/retrofit/data/social_info.dart'; |
|
|
|
|
import 'package:huixiang/retrofit/retrofit_api.dart'; |
|
|
|
|
import 'package:huixiang/utils/font_weight.dart'; |
|
|
|
|
import 'package:huixiang/view_widget/my_appbar.dart'; |
|
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
|
import 'package:huixiang/view_widget/my_tab.dart'; |
|
|
|
|
import 'package:shared_preferences/shared_preferences.dart'; |
|
|
|
|
|
|
|
|
|
import '../fans_page.dart'; |
|
|
|
|
|
|
|
|
@ -18,14 +24,34 @@ class CommunityFollow extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
class _CommunityFollow extends State<CommunityFollow> |
|
|
|
|
with SingleTickerProviderStateMixin { |
|
|
|
|
|
|
|
|
|
ApiService apiService; |
|
|
|
|
SocialInfo infoNumber; |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
void initState() { |
|
|
|
|
super.initState(); |
|
|
|
|
|
|
|
|
|
querySocialInfo(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
///个人社交信息(粉丝/关注数量) |
|
|
|
|
querySocialInfo() async { |
|
|
|
|
SharedPreferences value = await SharedPreferences.getInstance(); |
|
|
|
|
apiService = ApiService( |
|
|
|
|
Dio(), |
|
|
|
|
context: context, |
|
|
|
|
token: value.getString("token"), |
|
|
|
|
showLoading: false, |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
BaseData<SocialInfo> baseData = |
|
|
|
|
await apiService.socialInfo().catchError((onError) {}); |
|
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
|
setState(() { |
|
|
|
|
infoNumber = baseData.data; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
EasyLoading.dismiss(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
Widget build(BuildContext context) { |
|
|
|
@ -56,8 +82,8 @@ class _CommunityFollow extends State<CommunityFollow>
|
|
|
|
|
indicatorSize: TabBarIndicatorSize.label, |
|
|
|
|
//指示器与文字等宽 |
|
|
|
|
tabs: <Widget>[ |
|
|
|
|
MyTab(text:"关注(0)",), |
|
|
|
|
MyTab(text: "粉丝(0)"), |
|
|
|
|
MyTab(text:"关注(${infoNumber?.follow??"0"})",), |
|
|
|
|
MyTab(text: "粉丝(${infoNumber?.fans??"0"})"), |
|
|
|
|
], |
|
|
|
|
), |
|
|
|
|
), |
|
|
|
|