feat:View All 点击区域过小,和下拉刷新事件冲突

This commit is contained in:
pengtao 2025-10-15 13:57:32 +08:00
parent 74976ae83a
commit 1cca41b1de

View File

@ -39,286 +39,288 @@ class _KtMyListPageState extends State<KtMyListPage> {
), ),
child: state.chestList.isEmpty && state.historyList.isEmpty child: state.chestList.isEmpty && state.historyList.isEmpty
? KtStatusWidget( ? KtStatusWidget(
type: KtErrorStatusType.nothingYet, type: KtErrorStatusType.nothingYet,
onPressed: logic.initData, onPressed: logic.initData,
) )
: SmartRefresher( : SmartRefresher(
controller: logic.refreshCtrl, controller: logic.refreshCtrl,
enablePullUp: true, enablePullUp: true,
enablePullDown: true, enablePullDown: true,
onRefresh: () => logic.initData(), onRefresh: () => logic.initData(),
onLoading: () => logic.getHistoryList(loadMore: true), onLoading: () => logic.getHistoryList(loadMore: true),
child: Column( child: Column(
children: [ children: [
if (state.chestList.isNotEmpty) if (state.chestList.isNotEmpty)
Container( Container(
width: ScreenUtil().screenWidth - 30.w, width: ScreenUtil().screenWidth - 30.w,
padding: EdgeInsets.fromLTRB(6.w, 53.w, 6.w, 6.w), padding: EdgeInsets.fromLTRB(6.w, 46.w, 6.w, 6.w),
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: AssetImage('collect_bg.png'.ktIcon), image: AssetImage('collect_bg.png'.ktIcon),
fit: BoxFit.fill, fit: BoxFit.fill,
),
),
child: Column(
children: [
Row(
children: [
SizedBox(width: 6.w),
Text(
'My Treasure Chest',
style: TextStyle(
fontSize: 18.sp,
color: Colors.white,
fontWeight: FontWeight.w800,
fontStyle: FontStyle.italic,
),
), ),
const Spacer(), ),
GestureDetector( child: Column(
onTap: () => Get.to(KtMyChestPage()), children: [
child: Row( Row(
children: [ children: [
SizedBox(width: 6.w),
Text( Text(
'View All', 'My Treasure Chest',
style: TextStyle( style: TextStyle(
fontSize: 12.sp, fontSize: 18.sp,
color: Color(0xFFD6D6D6), color: Colors.white,
fontWeight: FontWeight.w800,
fontStyle: FontStyle.italic,
), ),
), ),
Image.asset( const Spacer(),
'ic_right_white.png'.ktIcon, GestureDetector(
width: 10.w, onTap: () => Get.to(KtMyChestPage()),
child: Container(
padding: EdgeInsets.all(8.w),
child: Row(
children: [
Text(
'View All',
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFFD6D6D6),
),
),
Image.asset(
'ic_right_white.png'.ktIcon,
width: 10.w,
),
],
),
),
), ),
SizedBox(width: 6.w),
], ],
), ),
), SizedBox(height: 8.w),
], Container(
), height: 145.w,
SizedBox(height: 15.w), decoration: BoxDecoration(
Container( color: Colors.white,
height: 145.w, borderRadius: BorderRadius.circular(14.w),
decoration: BoxDecoration( ),
color: Colors.white, child: Row(
borderRadius: BorderRadius.circular(14.w), mainAxisAlignment: MainAxisAlignment.start,
), children: [
child: Row( ...state.chestList.map(
mainAxisAlignment: MainAxisAlignment.start, (video) => Container(
children: [ margin: EdgeInsets.symmetric(
...state.chestList.map( horizontal: 5.w,
(video) => Container(
margin: EdgeInsets.symmetric(
horizontal: 5.w,
),
child: Stack(
children: [
GestureDetector(
onTap: () => Get.toNamed(
KtRoutes.shortVideo,
arguments: {
'shortPlayId':
video.shortPlayId,
'imageUrl':
video.imageUrl ?? '',
},
), ),
child: KtNetworkImage( child: Stack(
imageUrl: video.imageUrl ?? '', children: [
width: 100.w, GestureDetector(
height: 133.w, onTap: () => Get.toNamed(
borderRadius: KtRoutes.shortVideo,
BorderRadius.circular(6.w), arguments: {
), 'shortPlayId':
), video.shortPlayId,
Positioned( 'imageUrl':
right: 4.w, video.imageUrl ?? '',
top: 4.w, },
child: GestureDetector(
onTap: () =>
logic.cancelCollect(
video.shortPlayId!,
), ),
child: Image.asset( child: KtNetworkImage(
'ic_collect_sel.png'.ktIcon, imageUrl: video.imageUrl ?? '',
width: 28.w, width: 100.w,
), height: 133.w,
borderRadius:
BorderRadius.circular(6.w),
),
),
Positioned(
right: 4.w,
top: 4.w,
child: GestureDetector(
onTap: () =>
logic.cancelCollect(
video.shortPlayId!,
),
child: Image.asset(
'ic_collect_sel.png'.ktIcon,
width: 28.w,
),
),
),
],
), ),
), ),
], ),
), ],
), ),
), ),
], ],
), ),
), ),
], SizedBox(height: 15.w),
), Expanded(
), child: Container(
SizedBox(height: 15.w), width: ScreenUtil().screenWidth,
Expanded( padding: EdgeInsets.all(15.w),
child: Container( decoration: BoxDecoration(
width: ScreenUtil().screenWidth, color: Colors.white,
padding: EdgeInsets.all(15.w), borderRadius: BorderRadius.vertical(
decoration: BoxDecoration( top: Radius.circular(20.w),
color: Colors.white, ),
borderRadius: BorderRadius.vertical(
top: Radius.circular(20.w),
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'Continue Watching',
style: TextStyle(
fontSize: 18.sp,
color: Color(0xFF1E1E20),
fontWeight: FontWeight.w800,
fontStyle: FontStyle.italic,
), ),
), child: Column(
Expanded( crossAxisAlignment: CrossAxisAlignment.start,
child: ListView.separated( children: [
padding: EdgeInsets.only(top: 10.w), Text(
// shrinkWrap: true, 'Continue Watching',
// physics: NeverScrollableScrollPhysics(), style: TextStyle(
itemBuilder: (context, index) { fontSize: 18.sp,
KtHistoryVideoBean video = color: Color(0xFF1E1E20),
state.historyList[index]; fontWeight: FontWeight.w800,
return GestureDetector( fontStyle: FontStyle.italic,
onTap: () => Get.toNamed(
KtRoutes.shortVideo,
arguments: {
'shortPlayId': video.shortPlayId,
'imageUrl': video.imageUrl ?? '',
},
), ),
child: Container( ),
color: Colors.transparent, Expanded(
child: Row( child: ListView.separated(
children: [ padding: EdgeInsets.only(top: 10.w),
KtNetworkImage( // shrinkWrap: true,
imageUrl: video.imageUrl ?? '', // physics: NeverScrollableScrollPhysics(),
width: 74.w, itemBuilder: (context, index) {
height: 98.w, KtHistoryVideoBean video =
borderRadius: state.historyList[index];
BorderRadius.circular(8.w), return GestureDetector(
onTap: () => Get.toNamed(
KtRoutes.shortVideo,
arguments: {
'shortPlayId': video.shortPlayId,
'imageUrl': video.imageUrl ?? '',
},
), ),
SizedBox(width: 13.w), child: Container(
SizedBox( color: Colors.transparent,
width: 200.w, child: Row(
height: 98.w,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisAlignment:
MainAxisAlignment.start,
children: [ children: [
Text( KtNetworkImage(
video.name ?? '', imageUrl: video.imageUrl ?? '',
maxLines: 1, width: 74.w,
overflow: height: 98.w,
TextOverflow.ellipsis, borderRadius:
style: TextStyle( BorderRadius.circular(8.w),
fontSize: 13.sp,
color: Color(0xFF1E1E20),
fontWeight:
FontWeight.w500,
),
), ),
SizedBox(height: 6.w), SizedBox(width: 13.w),
Text( SizedBox(
video.category?.first ?? '', width: 200.w,
maxLines: 1, height: 98.w,
overflow: child: Column(
TextOverflow.ellipsis, crossAxisAlignment:
style: TextStyle( CrossAxisAlignment.start,
fontSize: 10.sp, mainAxisAlignment:
color: Color(0xFF79C900), MainAxisAlignment.start,
fontWeight: children: [
FontWeight.w400, Text(
), video.name ?? '',
), maxLines: 1,
SizedBox(height: 20.w), overflow:
Row( TextOverflow.ellipsis,
children: [ style: TextStyle(
SizedBox( fontSize: 13.sp,
width: 26.w, color: Color(0xFF1E1E20),
height: 26.w, fontWeight:
child: CircularProgressIndicator( FontWeight.w500,
value: ),
(video.currentEpisode ?? ),
0) / SizedBox(height: 6.w),
(video.episodeTotal! > Text(
0 video.category?.first ?? '',
? video maxLines: 1,
.episodeTotal! overflow:
: 1), TextOverflow.ellipsis,
backgroundColor: style: TextStyle(
Color(0xFFD9D9D9), fontSize: 10.sp,
valueColor: color: Color(0xFF79C900),
AlwaysStoppedAnimation< fontWeight:
Color FontWeight.w400,
>( ),
Color( ),
0xFFA7F62F, SizedBox(height: 20.w),
Row(
children: [
SizedBox(
width: 26.w,
height: 26.w,
child: CircularProgressIndicator(
value:
(video.currentEpisode ??
0) /
(video.episodeTotal! >
0
? video
.episodeTotal!
: 1),
backgroundColor:
Color(0xFFD9D9D9),
valueColor:
AlwaysStoppedAnimation<
Color
>(
Color(
0xFFA7F62F,
),
),
strokeWidth: 3.w,
),
), ),
), SizedBox(width: 5.w),
strokeWidth: 3.w, Text(
"${((video.currentEpisode ?? 0) / (video.episodeTotal! > 0 ? video.episodeTotal! : 1) * 100).toStringAsFixed(0)}%",
style: TextStyle(
fontSize: 12.sp,
color: Color(
0xFF1E1E20,
),
fontWeight:
FontWeight.w400,
),
),
],
), ),
), ],
SizedBox(width: 5.w), ),
Text( ),
"${((video.currentEpisode ?? 0) / (video.episodeTotal! > 0 ? video.episodeTotal! : 1) * 100).toStringAsFixed(0)}%", const Spacer(),
style: TextStyle( GestureDetector(
fontSize: 12.sp, onTap: () =>
color: Color( logic.likeVideo(video),
0xFF1E1E20, child: Column(
), children: [
fontWeight: Image.asset(
FontWeight.w400, video.isCollect == 1
? 'ic_collect_sel.png'
.ktIcon
: 'ic_collect_unsel.png'
.ktIcon,
width: 32.w,
), ),
), ],
], ),
), ),
], ],
), ),
), ),
const Spacer(), );
GestureDetector( },
onTap: () => separatorBuilder: (_, __) =>
logic.likeVideo(video), SizedBox(height: 12.w),
child: Column( itemCount: state.historyList.length,
children: [
Image.asset(
video.isCollect == 1
? 'ic_collect_sel.png'
.ktIcon
: 'ic_collect_unsel.png'
.ktIcon,
width: 32.w,
),
],
),
),
],
),
), ),
); ),
}, ],
separatorBuilder: (_, __) =>
SizedBox(height: 12.w),
itemCount: state.historyList.length,
), ),
), ),
], ),
), ],
), ),
), ),
],
),
),
); );
}, },
); );