Browse Source

优化好友接口对接和跳转

master
王子贤 3 months ago
parent
commit
e5171a0d6d
3 changed files with 10 additions and 4 deletions
  1. 7
      lib/controller/mine/my_friend_controller.dart
  2. 2
      lib/pages/mine/mine_page.dart
  3. 5
      lib/pages/mine/my_friend_page.dart

7
lib/controller/mine/my_friend_controller.dart

@ -9,6 +9,10 @@ import '../../model/mine/friend_data.dart';
class MyFriendController extends GetxController with GetSingleTickerProviderStateMixin {
final int index;
MyFriendController({required this.index});
late TabController tabController;
final sum = 0.obs;
@ -31,7 +35,8 @@ class MyFriendController extends GetxController with GetSingleTickerProviderStat
void onInit() {
super.onInit();
tabController = TabController(length: 2, vsync: this);
tabController = TabController(length: 2, vsync: this, initialIndex: index);
tab.value = index;
listRefreshController = EasyRefreshController(
controlFinishRefresh: true,

2
lib/pages/mine/mine_page.dart

@ -367,7 +367,7 @@ class _InfoItemState extends State<InfoItem> {
});
});
} else {
Get.to(()=> MyFriendPage())?.then((w) async {
Get.to(()=> MyFriendPage(index: widget.item['type'] - 1,))?.then((w) async {
await widget.getUserCount();
setState(() {

5
lib/pages/mine/my_friend_page.dart

@ -13,12 +13,13 @@ import 'package:tdesign_flutter/tdesign_flutter.dart';
import '../../model/mine/friend_apply_data.dart' as fa;
class MyFriendPage extends StatelessWidget {
const MyFriendPage({super.key});
final int index;
const MyFriendPage({super.key, required this.index});
@override
Widget build(BuildContext context) {
return GetX<MyFriendController>(
init: MyFriendController(),
init: MyFriendController(index: index),
builder: (controller){
return Scaffold(
appBar: PageAppbar(title: "我的好友"),

Loading…
Cancel
Save