You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.5 KiB
54 lines
1.5 KiB
import 'package:dating_touchme_app/controller/home/home_controller.dart';
|
|
import 'package:dating_touchme_app/pages/home/all_timeline.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:tdesign_flutter/tdesign_flutter.dart';
|
|
|
|
class TimelineWindow extends StatefulWidget {
|
|
const TimelineWindow({super.key});
|
|
|
|
@override
|
|
State<TimelineWindow> createState() => _TimelineWindowState();
|
|
}
|
|
|
|
class _TimelineWindowState extends State<TimelineWindow> with AutomaticKeepAliveClientMixin, SingleTickerProviderStateMixin {
|
|
|
|
|
|
late TabController tabController;
|
|
final HomeController controller = Get.find<HomeController>();
|
|
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
print(111);
|
|
tabController = TabController(length: 2, vsync: this);
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
super.build(context);
|
|
return Column(
|
|
children: [
|
|
Expanded(
|
|
child: Obx(() {
|
|
// 使用 IndexedStack 保持两个列表的状态,根据当前选中的标签显示对应的列表
|
|
return IndexedStack(
|
|
index: controller.timelineTab.value,
|
|
children: const [
|
|
// 推荐列表
|
|
AllTimeline(),
|
|
// 同城列表
|
|
SizedBox(),
|
|
],
|
|
);
|
|
}),
|
|
),
|
|
],
|
|
);
|
|
}
|
|
|
|
|
|
@override
|
|
bool get wantKeepAlive => true;
|
|
}
|