Browse Source

no message

ios
ZHR007 4 months ago
parent
commit
f962ccc9f7
3 changed files with 21 additions and 10 deletions
  1. 16
      lib/pages/home/nearby_tab.dart
  2. 1
      lib/pages/home/recommend_tab.dart
  3. 14
      lib/pages/mine/mine_page.dart

16
lib/pages/home/nearby_tab.dart

@ -38,9 +38,10 @@ class _NearbyTabState extends State<NearbyTab>
final tabBarHeight = 64.0;
final totalBottomPadding = bottomPadding + tabBarHeight;
return Obx(() {
return SizedBox(
height: MediaQuery.of(context).size.height - totalBottomPadding,
child: Obx(() {
final List<MarriageData> dataSource = controller.nearbyFeed;
final bool hasMore = controller.nearbyHasMore.value;
return SmartRefresher(
controller: _refreshController,
@ -64,6 +65,7 @@ class _NearbyTabState extends State<NearbyTab>
try {
await controller.refreshNearbyData();
_refreshController.refreshCompleted();
_refreshController.loadComplete();
print('同城列表刷新完成');
} catch (e) {
print('同城列表刷新失败: $e');
@ -72,8 +74,8 @@ class _NearbyTabState extends State<NearbyTab>
},
//
onLoading: () async {
print('同城列表上拉加载被触发, hasMore: $hasMore');
if (hasMore && controller.nearbyHasMore.value) {
print('同城列表上拉加载被触发, hasMore: ${controller.nearbyHasMore.value}');
if (controller.nearbyHasMore.value) {
try {
await controller.loadNearbyMoreData();
//
@ -102,14 +104,14 @@ class _NearbyTabState extends State<NearbyTab>
padding: EdgeInsets.only(
left: 12,
right: 12,
bottom: totalBottomPadding + 12,
bottom: 12,
),
itemBuilder: (context, index) {
//
if (dataSource.isEmpty && index == 0) {
// 使
return SizedBox(
height: MediaQuery.of(context).size.height * 1.2,
height: MediaQuery.of(context).size.height - totalBottomPadding,
child: const Center(
child: Text(
"暂无数据",
@ -131,7 +133,7 @@ class _NearbyTabState extends State<NearbyTab>
itemCount: dataSource.isEmpty ? 1 : dataSource.length,
),
);
});
}));
}
@override

1
lib/pages/home/recommend_tab.dart

@ -97,6 +97,7 @@ class _RecommendTabState extends State<RecommendTab>
},
child: ListView.separated(
// 使
physics: AlwaysScrollableScrollPhysics(), //
// padding AppBar
padding: EdgeInsets.only(
left: 12,

14
lib/pages/mine/mine_page.dart

@ -70,11 +70,19 @@ class _MinePageState extends State<MinePage> with AutomaticKeepAliveClientMixin{
children: [
ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(60.w)),
child: (controller.userData.value?.profilePhoto?.isNotEmpty ?? false) ? Image.network(
"${controller.userData.value?.profilePhoto ?? ""}",
child: (controller.userData.value?.profilePhoto?.isNotEmpty ?? false) ?
CachedNetworkImage(
imageUrl: '${controller.userData.value?.profilePhoto}?x-oss-process=image/format,webp/resize,w_320',
width: 60.w,
height: 60.w,
fit: BoxFit.cover,
imageBuilder: (context, imageProvider) => Container(
decoration: BoxDecoration(
image: DecorationImage(
image: imageProvider,
fit: BoxFit.cover,
),
),
),
) : Image.asset(
Assets.imagesUserAvatar,
width: 60.w,

Loading…
Cancel
Save