import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:hgdj/assets_tool/images.dart'; import 'package:hgdj/extension/extensions.dart'; import 'package:hgdj/hj_model/video_model.dart'; import 'package:hgdj/hj_page/find/pic_collect/pics_detail_page.dart'; import 'package:hgdj/hj_utils/screen.dart'; import 'package:hgdj/tools_base/widget/net_image_widget.dart'; //图集item class PhotoGalleryItem extends StatelessWidget { final VideoModel? videoModel; final Function? callback; final int textline; const PhotoGalleryItem({ super.key, this.videoModel, this.callback, this.textline = 1, }); @override Widget build(BuildContext context) { return InkWell( enableFeedback: false, onTap: () { if (callback != null) { callback?.call(); } else { Get.to(PicsDetailPage(id: videoModel?.id), preventDuplicates: false); } }, child: Column( children: [ Expanded( child: Stack( fit: StackFit.expand, children: [ NetworkImageLoader( imageUrl: videoModel?.cover ?? "", ), Positioned( bottom: 0, left: 0, right: 0, child: Container( decoration: BoxDecoration( gradient: LinearGradient( colors: [ Colors.black.withValues(alpha: 0), Colors.black.withValues(alpha: .6), ], begin: Alignment.topCenter, end: Alignment.bottomCenter, )), height: 30, child: Row( children: [ 8.sizeBoxW, Image.asset("eye_white.webp".commonImgPath, width: 16), SizedBox(width: 2), Text( videoModel?.playCount?.countStr ?? "", style: TextStyle( color: Colors.white, fontSize: 10, ), ), Spacer(), Image.asset("tuji_icon.webp".communityPath, width: 16), 2.sizeBoxW, Text( '${videoModel?.seriesCover?.length ?? 0}', textAlign: TextAlign.justify, style: TextStyle( color: Colors.white, fontSize: 10, ), ), 8.sizeBoxW, ], ), ), ) ], ), ), 4.sizeBoxH, Row( children: [ Expanded( child: Text( '${videoModel?.title}', maxLines: textline, overflow: TextOverflow.ellipsis, style: TextStyle( color: Colors.white.withValues(alpha: .9), fontSize: 12, ), ), ) ], ) ], ), ); } }