import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:gap/gap.dart';
import 'package:tanami_app/core/styles/app_color.dart';

import '../../../../../core/styles/app_images.dart';
import '../../../../../core/styles/app_text.dart';
import '../../../../../shared/components/text_widget.dart';

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

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Container(
          color: AppColor.plainWhite,
          child: Padding(
            padding: const EdgeInsets.only(
              left: 20.0,
              right: 20,
              top: 10,
              bottom: 20,
            ),
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    TextWidget().text17W700(
                      'Multi Family Residental',
                      clr: AppColor.plainBlack,
                    ),
                    Container(
                      height: 28,
                      padding: const EdgeInsets.symmetric(
                          horizontal: 12, vertical: 6),
                      decoration: ShapeDecoration(
                        color: const Color(0xFFE4F5E9),
                        shape: RoundedRectangleBorder(
                            borderRadius: BorderRadius.circular(4)),
                      ),
                      child: Center(
                          child: TextWidget().text12W700(
                        "Real estate",
                        clr: AppColor.selectedItemColor,
                      )),
                    )
                  ],
                ),
                Gap(10.h),
                Container(
                  padding: const EdgeInsets.symmetric(
                      horizontal: 15.0, vertical: 10.0),
                  decoration: BoxDecoration(
                    color: Colors.white,
                    border: Border.all(color: const Color(0xFFE4F5E9)),
                    borderRadius: BorderRadius.circular(14.0),
                  ),
                  child: Row(
                    mainAxisSize: MainAxisSize.min,
                    mainAxisAlignment: MainAxisAlignment.start,
                    children: [
                      Image.asset(
                        AppImages.portfolioClock,
                        height: 15.h,
                      ),
                      Gap(
                        5.w,
                      ),
                      TextWidget().text12W700(
                        "${AppText.closingDateText}: ",
                        clr: AppColor.plainBlack,
                      ),
                      TextWidget().text12W500(
                        'Jul 10 2025',
                        clr: AppColor.plainBlack,
                      ),
                    ],
                  ),
                ),
                Gap(
                  10.h,
                ),
                TextWidget()
                    .text22W900("SAR 1,478,000", clr: AppColor.investTextColor),
                const Gap(8.0),
                LinearProgressIndicator(
                  value: 1,
                  borderRadius: BorderRadius.circular(2),
                  minHeight: 8.0,
                  backgroundColor: AppColor.txtBorderColor,
                  valueColor: const AlwaysStoppedAnimation<Color>(
                      AppColor.investTextColor),
                ),
                const Gap(8.0),
                TextWidget().text11W700("100% ${AppText.fundedText}",
                    clr: AppColor.portoflioCardTextColor),
                const Gap(8.0),
                TextWidget().text14W400(
                  'Forem ipsum dolor sit amet, consectetur adipiscing elit. Nunc vulputate libero et velit interdum, ac aliquet odio mattis. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Curabitur tempus urna at turpis condimentum lobortis.',
                  clr: Colors.grey,
                  txtAlign: TextAlign.start,
                  maxLine: 2,
                )
              ],
            ),
          ),
        ),
        Padding(
          padding: const EdgeInsets.only(left: 12.0, right: 12, bottom: 12.0),
          child: Container(
            decoration: BoxDecoration(
                color: const Color(0xFFE4F5E9),
                borderRadius: BorderRadius.circular(22)),
            child: Padding(
              padding:
                  const EdgeInsets.symmetric(horizontal: 20.0, vertical: 16.0),
              child: Column(
                children: [
                  Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      SizedBox(
                        width: 150.w,
                        child: TextWidget().text14W500(
                          "${AppText.sponsorNameText}:",
                          clr: AppColor.portoflioCardTextColor,
                          txtAlign: TextAlign.start,
                        ),
                      ),
                      TextWidget().text14W700(
                        'Silverlake',
                        clr: AppColor.plainBlack,
                        txtAlign: TextAlign.end,
                      )
                    ],
                  ),
                  SizedBox(
                    height: 8.h,
                  ),
                  Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      SizedBox(
                        width: 200.w,
                        child: TextWidget().text14W500(
                          "${AppText.originalEstimatedReturnText}:",
                          clr: AppColor.portoflioCardTextColor,
                          txtAlign: TextAlign.start,
                        ),
                      ),
                      TextWidget().text14W700(
                        '20.0%',
                        clr: AppColor.plainBlack,
                        txtAlign: TextAlign.end,
                      ),
                    ],
                  ),
                  SizedBox(
                    height: 8.h,
                  ),
                  Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      SizedBox(
                        width: 150.w,
                        child: TextWidget().text14W500(
                          "${AppText.actualEstimatedReturnText}:",
                          clr: AppColor.portoflioCardTextColor,
                          txtAlign: TextAlign.start,
                        ),
                      ),
                      TextWidget().text14W700(
                        '22.5%',
                        clr: AppColor.plainBlack,
                        txtAlign: TextAlign.end,
                      ),
                    ],
                  ),
                  SizedBox(
                    height: 8.h,
                  ),
                  Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      SizedBox(
                        width: 150.w,
                        child: TextWidget().text14W500(
                          "${AppText.holdingPeriodText}:",
                          clr: AppColor.portoflioCardTextColor,
                          txtAlign: TextAlign.start,
                        ),
                      ),
                      TextWidget().text14W700(
                        '24 Months',
                        clr: AppColor.plainBlack,
                        txtAlign: TextAlign.end,
                      ),
                    ],
                  ),
                  SizedBox(
                    height: 8.h,
                  ),
                  Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      TextWidget().text14W500(
                        "${AppText.payoutDateText}:",
                        clr: AppColor.portoflioCardTextColor,
                        txtAlign: TextAlign.start,
                      ),
                      TextWidget().text14W700(
                        'August 1, 2027',
                        clr: AppColor.plainBlack,
                        txtAlign: TextAlign.end,
                      ),
                    ],
                  )
                ],
              ),
            ),
          ),
        )
      ],
    );
  }
}
