|
|
|
@ -2,16 +2,23 @@ |
|
|
|
import 'package:cached_network_image/cached_network_image.dart'; |
|
|
|
import 'package:dating_touchme_app/extension/ex_widget.dart'; |
|
|
|
import 'package:flutter/material.dart'; |
|
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart'; |
|
|
|
import 'package:get/get.dart'; |
|
|
|
import 'package:pull_to_refresh/pull_to_refresh.dart'; |
|
|
|
|
|
|
|
import '../../controller/discover/visitor_controller.dart'; |
|
|
|
import '../../model/discover/visitor_model.dart'; |
|
|
|
|
|
|
|
class VisitorListPage extends StatelessWidget { |
|
|
|
final VisitorController visitorController = Get.put(VisitorController()); |
|
|
|
class VisitorListPage extends StatefulWidget { |
|
|
|
const VisitorListPage({super.key}); |
|
|
|
|
|
|
|
@override |
|
|
|
State<VisitorListPage> createState() => _VisitorListPagePageState(); |
|
|
|
} |
|
|
|
|
|
|
|
class _VisitorListPagePageState extends State<VisitorListPage> { |
|
|
|
|
|
|
|
VisitorListPage({Key? key}) : super(key: key); |
|
|
|
final VisitorController visitorController = Get.put(VisitorController()); |
|
|
|
|
|
|
|
@override |
|
|
|
Widget build(BuildContext context) { |
|
|
|
@ -34,6 +41,12 @@ class VisitorListPage extends StatelessWidget { |
|
|
|
_showSortDialog(); |
|
|
|
} |
|
|
|
}, |
|
|
|
tooltip: "", |
|
|
|
padding: EdgeInsets.zero, |
|
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(14)), |
|
|
|
color: Colors.white, |
|
|
|
elevation: 8, |
|
|
|
offset: Offset(32.w, 36.h), // 相对按钮下移一点 |
|
|
|
itemBuilder: (BuildContext context) => [ |
|
|
|
PopupMenuItem(value: 'sort', child: Text('排序方式')), |
|
|
|
PopupMenuItem(value: 'clear', child: Text('清空记录')), |
|
|
|
@ -96,7 +109,7 @@ class VisitorListPage extends StatelessWidget { |
|
|
|
if (mode == LoadStatus.idle) { |
|
|
|
body = Text("上拉加载更多"); |
|
|
|
} else if (mode == LoadStatus.loading) { |
|
|
|
body = CircularProgressIndicator(); |
|
|
|
body = SizedBox(width: 20, height: 20, child: CircularProgressIndicator(strokeWidth: 2,)); |
|
|
|
} else if (mode == LoadStatus.failed) { |
|
|
|
body = Text("加载失败,点击重试"); |
|
|
|
} else if (mode == LoadStatus.canLoading) { |
|
|
|
|