import 'package:flutter/material.dart';
import 'package:mc_common_app/extensions/int_extensions.dart';
import 'package:mc_common_app/extensions/string_extensions.dart';
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';

class CardButtonWithIcon extends StatelessWidget {
  final Widget icon;
  final Function() onCardTapped;
  final String title;

  const CardButtonWithIcon({
    Key? key,
    required this.onCardTapped,
    required this.title,
    required this.icon,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return SizedBox(
      // height: 150,
      width: 150,
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        mainAxisAlignment: MainAxisAlignment.spaceAround,
        children: [
          icon,
          title.toText(
            fontSize: 11,
            isBold: true,
            textAlign: TextAlign.left,
          ).paddingOnly(top: 10)
        ],
      ).toWhiteContainer(allPading: 12, width: double.infinity).onPress(onCardTapped),
    );
  }
}
