import 'package:cs_resources/generated/assets.dart';
import 'package:cs_resources/generated/l10n.dart';
import 'package:cs_resources/theme/app_colors_theme.dart';
import 'package:flutter/material.dart';
import 'package:widgets/ext/ex_widget.dart';
import 'package:widgets/my_load_image.dart';
import 'package:widgets/my_text_view.dart';

///  选择银行卡的Item
class CardItem extends StatelessWidget {
  final int index;
  final bool item;

  const CardItem({
    required this.index,
    required this.item,
  });

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: const EdgeInsets.only(top: 1),
      color: context.appColors.whiteBG,
      width: double.infinity,
      padding: const EdgeInsets.only(left: 20, right: 23, top: 20, bottom: 20),
      child: Row(
        mainAxisSize: MainAxisSize.max,
        crossAxisAlignment: CrossAxisAlignment.center,
        children: [
          //选中
          MyAssetImage(
            item ? Assets.baseServiceRadioChecked : Assets.baseServiceRadioUncheck,
            width: 25,
            height: 25,
          ),

          const MyAssetImage(
            Assets.facilityAddCardMaster,
            height: 38,
          ).marginOnly(left: 9, right: 9),

          Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              MyTextView(
                "Wu Bing Bing's Card",
                textColor: context.appColors.textBlack,
                fontSize: 13.5,
                isFontRegular: true,
              ),
              MyTextView(
                "Ending 9423",
                marginTop: 5,
                textColor: context.appColors.textBlack,
                fontSize: 13.5,
                isFontRegular: true,
              ),
            ],
          ).expanded(),

        ],
      ),
    );
  }
}
