|
|
@ -1,5 +1,6 @@ |
|
|
|
import 'dart:ui'; |
|
|
|
import 'dart:ui'; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:dio/dio.dart'; |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
import 'package:flutter/rendering.dart'; |
|
|
|
import 'package:flutter/rendering.dart'; |
|
|
|
import 'package:flutter/services.dart'; |
|
|
|
import 'package:flutter/services.dart'; |
|
|
@ -8,9 +9,12 @@ import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
import 'package:huixiang/retrofit/retrofit_api.dart'; |
|
|
|
import 'package:huixiang/retrofit/retrofit_api.dart'; |
|
|
|
import 'package:huixiang/view_widget/my_appbar.dart'; |
|
|
|
import 'package:huixiang/view_widget/my_appbar.dart'; |
|
|
|
import 'package:flutter/cupertino.dart'; |
|
|
|
import 'package:flutter/cupertino.dart'; |
|
|
|
|
|
|
|
import 'package:shared_preferences/shared_preferences.dart'; |
|
|
|
import '../../generated/l10n.dart'; |
|
|
|
import '../../generated/l10n.dart'; |
|
|
|
import '../../utils/font_weight.dart'; |
|
|
|
import '../../utils/font_weight.dart'; |
|
|
|
import '../main.dart'; |
|
|
|
import '../main.dart'; |
|
|
|
|
|
|
|
import '../retrofit/data/base_data.dart'; |
|
|
|
|
|
|
|
import '../retrofit/data/social_info.dart'; |
|
|
|
import '../utils/event_type.dart'; |
|
|
|
import '../utils/event_type.dart'; |
|
|
|
import '../view_widget/my_tab.dart'; |
|
|
|
import '../view_widget/my_tab.dart'; |
|
|
|
import 'im_view/custom_underline_tabIndicator.dart'; |
|
|
|
import 'im_view/custom_underline_tabIndicator.dart'; |
|
|
@ -28,12 +32,24 @@ class _ChatFriendGroup extends State<ChatFriendGroup> |
|
|
|
ApiService apiService; |
|
|
|
ApiService apiService; |
|
|
|
TabController tabController; |
|
|
|
TabController tabController; |
|
|
|
List<GlobalKey> _allKey = []; |
|
|
|
List<GlobalKey> _allKey = []; |
|
|
|
|
|
|
|
SocialInfo infoNumber; |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
void initState() { |
|
|
|
void initState() { |
|
|
|
super.initState(); |
|
|
|
super.initState(); |
|
|
|
tabController = TabController(length: 3, vsync: this, initialIndex: 0); |
|
|
|
tabController = TabController(length: 3, vsync: this, initialIndex: 0); |
|
|
|
|
|
|
|
tabController.addListener(() { |
|
|
|
|
|
|
|
if(!tabController.indexIsChanging) |
|
|
|
|
|
|
|
setState(() {}); |
|
|
|
|
|
|
|
}); |
|
|
|
loadFinish(); |
|
|
|
loadFinish(); |
|
|
|
|
|
|
|
querySocialInfo(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
|
|
|
void dispose() { |
|
|
|
|
|
|
|
super.dispose(); |
|
|
|
|
|
|
|
tabController.dispose(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
loadFinish() { |
|
|
|
loadFinish() { |
|
|
@ -41,12 +57,29 @@ class _ChatFriendGroup extends State<ChatFriendGroup> |
|
|
|
setState(() {}); |
|
|
|
setState(() {}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///个人社交信息(粉丝/关注数量/成就数量/好友数量) |
|
|
|
|
|
|
|
querySocialInfo() async { |
|
|
|
|
|
|
|
SharedPreferences value = await SharedPreferences.getInstance(); |
|
|
|
|
|
|
|
apiService = ApiService(Dio(), |
|
|
|
|
|
|
|
context: context, token: value.getString("token"), showLoading: true); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BaseData<SocialInfo> baseData = |
|
|
|
|
|
|
|
await apiService.socialInfo().catchError((onError) {}); |
|
|
|
|
|
|
|
if (baseData != null && baseData.isSuccess) { |
|
|
|
|
|
|
|
setState(() { |
|
|
|
|
|
|
|
infoNumber = baseData.data; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
EasyLoading.dismiss(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
Widget build(BuildContext context) { |
|
|
|
Widget build(BuildContext context) { |
|
|
|
return Scaffold( |
|
|
|
return Scaffold( |
|
|
|
backgroundColor: Color(0xFFFFFFFF), |
|
|
|
backgroundColor: Color(0xFFFFFFFF), |
|
|
|
appBar: MyAppBar( |
|
|
|
appBar: MyAppBar( |
|
|
|
title: "${S.of(context).haoyou}(2)", |
|
|
|
title: tabController.index == 0 ? "${S.of(context).haoyou} (${infoNumber?.mutualFollowCount ?? "0"})" : |
|
|
|
|
|
|
|
(tabController.index == 1 ? "${S.of(context).guanzhu} (${infoNumber?.follow ?? "0"})" : "${S.of(context).fensi} (${infoNumber?.fans ?? "0"})"), |
|
|
|
titleColor: Color(0xFF0D0D0D), |
|
|
|
titleColor: Color(0xFF0D0D0D), |
|
|
|
titleSize: 17.sp, |
|
|
|
titleSize: 17.sp, |
|
|
|
leading: true, |
|
|
|
leading: true, |
|
|
|