import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:tanami_app/core/styles/app_images.dart';

import '../../../../../core/styles/app_text.dart';

class AcademyVideoSection extends StatelessWidget {
  const AcademyVideoSection({super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: const BorderRadius.all(Radius.circular(20.0)),
        boxShadow: [
          BoxShadow(
            color: Colors.black.withOpacity(0.15),
            spreadRadius: 2,
            blurRadius: 10,
            offset: const Offset(0, 3), // changes position of shadow
          ),
        ],
      ),
      child: Padding(
        padding: const EdgeInsets.symmetric(vertical: 20.0, horizontal: 16.0),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Text(
              AppText.videosTitle,
              style: GoogleFonts.dmSans(
                color: Colors.black,
                fontSize: 15.sp,
                fontWeight: FontWeight.w700,
              ),
            ),
            SizedBox(
              height: 12.h,
            ),
            ListView.builder(
              physics: const NeverScrollableScrollPhysics(),
              shrinkWrap: true,
              itemCount: videos.length,
              itemBuilder: (context, index) {
                return Padding(
                  padding: const EdgeInsets.only(bottom: 18.0),
                  child: ClipRRect(
                    borderRadius: const BorderRadius.all(
                      Radius.circular(18.0),
                    ),
                    child: Stack(
                      children: [
                        Image.asset(
                          videos[index],
                          fit: BoxFit.cover,
                          height: 160.h,
                          width: 1.sw,
                        ),
                        Positioned(
                          bottom: 0.0,
                          child: Image.asset(
                            AppImages.academyCardOverlay,
                          ),
                        ),
                        Positioned.fill(
                          child: Image.asset(
                            AppImages.videoPlayIcon,
                          ),
                        )
                      ],
                    ),
                  ),
                );
              },
            )
          ],
        ),
      ),
    );
  }
}

List videos = [
  'assets/images/academy_screen/vd_bg.jpg',
  'assets/images/academy_screen/vd_bg.jpg',
  'assets/images/academy_screen/vd_bg.jpg'
];
