mod: 推荐视频增加时长显示 issues #71、推荐栏刷新逻辑

This commit is contained in:
guozhigq
2023-09-07 19:25:35 +08:00
parent 5b953ae0be
commit 0ad54d8c0b
3 changed files with 20 additions and 9 deletions

View File

@ -112,12 +112,22 @@ class VideoCardV extends StatelessWidget {
height: maxHeight, height: maxHeight,
), ),
), ),
if (crossAxisCount == 1 && videoItem.duration != null) if (videoItem.duration != null)
PBadge( if (crossAxisCount == 1) ...[
bottom: 10, PBadge(
right: 10, bottom: 10,
text: videoItem.duration, right: 10,
) text: videoItem.duration,
)
] else ...[
PBadge(
bottom: 6,
right: 7,
size: 'small',
type: 'gray',
text: videoItem.duration,
)
],
], ],
); );
}), }),
@ -174,7 +184,7 @@ class VideoContent extends StatelessWidget {
], ],
), ),
if (crossAxisCount > 1) ...[ if (crossAxisCount > 1) ...[
const SizedBox(height: 3), const SizedBox(height: 2),
VideoStat( VideoStat(
videoItem: videoItem, videoItem: videoItem,
), ),

View File

@ -49,7 +49,7 @@ class RcmdController extends GetxController {
videoList.value = res['data']; videoList.value = res['data'];
} }
} else if (type == 'onRefresh') { } else if (type == 'onRefresh') {
videoList.insertAll(0, res['data']); videoList.value = res['data'];
} else if (type == 'onLoad') { } else if (type == 'onLoad') {
videoList.addAll(res['data']); videoList.addAll(res['data']);
} }

View File

@ -77,7 +77,8 @@ class _RcmdPageState extends State<RcmdPage>
), ),
child: RefreshIndicator( child: RefreshIndicator(
onRefresh: () async { onRefresh: () async {
return await _rcmdController.onRefresh(); await _rcmdController.onRefresh();
await Future.delayed(const Duration(milliseconds: 300));
}, },
child: CustomScrollView( child: CustomScrollView(
controller: _rcmdController.scrollController, controller: _rcmdController.scrollController,