| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- import 'package:flutter/material.dart';
- import 'package:flutter_screenutil/flutter_screenutil.dart';
- import 'package:go_router/go_router.dart';
- import 'package:news_app/constant/size_res.dart';
- import 'package:news_app/ui/video/video_detail_page.dart';
- import 'package:news_app/widget/auth_gesture_detector.dart';
- import 'package:news_app/widget/load_image.dart';
- import '../../constant/color_res.dart';
- import '../../gen/assets.gen.dart';
- import '../../model/video_new_model.dart';
- import '../../widget/my_txt.dart';
- /// @author: bo.zeng
- /// @email: cnhbwds@gmail.com
- /// @date: 2025 2025/4/9 16:00
- /// @description:
- class FavoriteVideoItemWidget extends StatelessWidget {
- final VideoNewModel? data;
- const FavoriteVideoItemWidget({super.key, this.data});
- @override
- Widget build(BuildContext context) {
- return AuthGestureDetector(
- onTap: () {
- context.push(
- '/video/detail',
- extra: VideoParam(
- id: data?.contentId ?? "",
- videoUrl: data?.url ?? "",
- ),
- );
- },
- child: Container(
- color: Colors.white,
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- spacing: 5.h,
- children: [
- Stack(
- alignment: Alignment.center,
- children: [
- LoadImage(
- data?.coverImage ?? '',
- fit: BoxFit.cover,
- width: screenWidth,
- holderImg: 'none',
- ),
- Image.asset(
- Assets.images.playIcon.path,
- width: 40.w,
- height: 40.w,
- ),
- Positioned(
- bottom: 10.w,
- left: 10.w,
- child: Row(
- children: [
- myTxt(
- text: data?.createTime ?? "",
- fontSize: 12.sp,
- color: Colors.white,
- ),
- ],
- ),
- ),
- ],
- ),
- Padding(
- padding: EdgeInsets.symmetric(horizontal: horizontalPadding),
- child: myTxt(
- text: data?.title ?? "",
- fontSize: 16.sp,
- fontWeight: FontWeight.bold,
- ),
- ),
- Padding(
- padding: EdgeInsets.symmetric(horizontal: horizontalPadding),
- child: myTxt(text: "新华日报", fontSize: 14.sp, color: color666666),
- ),
- SizedBox(height: 10.h),
- ],
- ),
- ),
- );
- }
- }
|