// Author: fengshengxiong
// Date: 2024/6/21
// Description: 首页视频Item

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:tone_snap/components/network_image_widget.dart';
import 'package:tone_snap/data/models/music_model.dart';
import 'package:tone_snap/utils/obj_util.dart';

class BrowseItemOmv extends StatelessWidget {
  const BrowseItemOmv({super.key, required this.musicModel});

  final MusicModel musicModel;

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: () {},
      child: SizedBox(
        width: 339.w,
        height: double.infinity,
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            NetworkImageWidget(
              url: musicModel.coverUrl,
              width: 339.w,
              height: 187.w,
              radius: 16.r,
            ),
            const Spacer(),
            Text(
              ObjUtil.getStr(musicModel.title),
              maxLines: 1,
              overflow: TextOverflow.ellipsis,
              style: TextStyle(
                color: Colors.white,
                fontSize: 14.sp,
              ),
            ),
            SizedBox(height: 2.h),
            Text(
              ObjUtil.getStr(musicModel.subtitle),
              maxLines: 1,
              overflow: TextOverflow.ellipsis,
              style: TextStyle(
                color: const Color(0xFF666666),
                fontSize: 12.sp,
              ),
            ),
          ],
        ),
      ),
    );
  }
}
