import 'package:flutter/material.dart';
import 'package:hmg_patient_app_new/core/app_assets.dart';
import 'package:hmg_patient_app_new/core/utils/size_utils.dart';
import 'package:hmg_patient_app_new/core/utils/utils.dart';
import 'package:hmg_patient_app_new/extensions/string_extensions.dart';
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
import 'package:hmg_patient_app_new/theme/colors.dart';
import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart';

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

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Row(
          mainAxisAlignment: MainAxisAlignment.spaceBetween,
          children: [
            "My Balance".toText16(isBold: true),
            Row(
              children: [
                "View all services".toText12(color: AppColors.primaryRedColor),
                SizedBox(width: 2.h),
                Icon(Icons.arrow_forward_ios, color: AppColors.primaryRedColor, size: 10.h),
              ],
            ),
          ],
        ).paddingSymmetrical(24.h, 0.h),
        SizedBox(height: 16.h),
        Container(
          // height: 150.h,
          width: double.infinity,
          decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
            color: AppColors.whiteColor,
            borderRadius: 24,
          ),
          child: Stack(children: [
            Positioned(
              right: 0,
              child: ClipRRect(borderRadius: BorderRadius.circular(24.0), child: Utils.buildSvgWithAssets(icon: AppAssets.habib_background_icon, width: 150.h, height: 150.h)),
            ),
            Padding(
              padding: EdgeInsets.all(14.h),
              child: Column(
                crossAxisAlignment: CrossAxisAlignment.start,
                children: [
                  Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: [
                      "Habib Wallet".toText15(isBold: true),
                      Container(
                        height: 40.h,
                        width: 40.h,
                        decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
                          color: AppColors.textColor,
                          borderRadius: 8.h,
                        ),
                        child: Padding(
                          padding: EdgeInsets.all(8.h),
                          child: Utils.buildSvgWithAssets(
                            icon: AppAssets.show_icon,
                            width: 12.h,
                            height: 12.h,
                            fit: BoxFit.contain,
                          ),
                        ),
                      ),
                    ],
                  ),
                  SizedBox(height: 4.h),
                  Row(
                    children: [
                      Utils.buildSvgWithAssets(
                        icon: AppAssets.saudi_riyal_icon,
                        iconColor: AppColors.dividerColor,
                        width: 24.h,
                        height: 24.h,
                        fit: BoxFit.contain,
                      ),
                      SizedBox(width: 8.h),
                      "200.18".toText32(isBold: true),
                    ],
                  ),
                  Padding(
                    padding: EdgeInsets.symmetric(horizontal: 50.h),
                    child: Row(
                      children: [
                        "View details".toText12(color: AppColors.primaryRedColor),
                        SizedBox(width: 2.h),
                        Icon(Icons.arrow_forward_ios, color: AppColors.primaryRedColor, size: 10.h),
                      ],
                    ),
                  ),
                  SizedBox(height: 16.h),
                  Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: [
                      SizedBox(
                        width: 150.h,
                        child: Utils.getPaymentMethods(),
                      ),
                      CustomButton(
                        icon: AppAssets.recharge_icon,
                        iconSize: 18.h,
                        text: "Recharge",
                        onPressed: () {},
                        backgroundColor: AppColors.infoColor,
                        borderColor: AppColors.infoColor,
                        textColor: AppColors.whiteColor,
                        fontSize: 12,
                        fontWeight: FontWeight.bold,
                        borderRadius: 12,
                        padding: EdgeInsets.fromLTRB(10, 0, 10, 0),
                        height: 35.h,
                      ),
                    ],
                  ),
                ],
              ),
            ),
          ]),
        ).paddingSymmetrical(24.h, 0.h),
      ],
    );
  }
}
