import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:gap/gap.dart';
import 'package:tanami_app/core/styles/app_color.dart';
import 'package:tanami_app/core/styles/app_images.dart';
import 'package:tanami_app/shared/components/text_widget.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return Container(
      width: double.infinity,
      padding: const EdgeInsets.symmetric(horizontal: 5),
      decoration: BoxDecoration(
        color: AppColor.documentCardBgColor,
        borderRadius: const BorderRadius.all(Radius.circular(20.0)),
        boxShadow: [
          BoxShadow(
            color: AppColor.plainBlack.withOpacity(0.15),
            spreadRadius: 2,
            blurRadius: 10,
            offset: const Offset(0, 3), // changes position of shadow
          ),
        ],
      ),
      child: Padding(
        padding: const EdgeInsets.all(20.0),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            TextWidget().text15W700(
              AppText.keyMeritsOfInvestmentText,
              clr: AppColor.plainBlack,
            ),
            Gap(
              16.h,
            ),
            ListView.builder(
                itemCount: 4,
                physics: const NeverScrollableScrollPhysics(),
                shrinkWrap: true,
                itemBuilder: (ctx, index) {
                  return Container(
                    margin: const EdgeInsets.only(
                      bottom: 12,
                    ),
                    child: investmentSectionCardText(
                      imageList[index],
                      "Nunc vulputate libero et velit interdumb aenfoao",
                      "ac aliquet odio mattis.",
                    ),
                  );
                })
          ],
        ),
      ),
    );
  }
}

List<String> imageList = [
  AppImages.timeSquareIcon,
  AppImages.walletIcon,
  AppImages.ticketIcon,
  AppImages.scannerIcon
];

Widget investmentSectionCardText(
  String icon,
  String title,
  String subtitle,
) {
  return Row(
    crossAxisAlignment: CrossAxisAlignment.start,
    children: [
      SvgPicture.asset(icon),
      const Gap(8),
      Expanded(
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            TextWidget().text14W700(
              title,
              clr: AppColor.textLabelColor,
              txtAlign: TextAlign.start,
            ),
            TextWidget().text14W400(
              subtitle,
              clr: AppColor.textLabelColor,
              txtAlign: TextAlign.start,
            ),
          ],
        ),
      )
    ],
  );
}
