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/theme/colors.dart';
import 'package:mc_common_app/widgets/common_widgets/dotted_rect.dart';
import 'package:mc_common_app/widgets/extensions/extensions_widget.dart';

class DottedRoundedCard extends StatelessWidget {
  final Function() onTap;
  final String text;
  final Widget icon;

  const DottedRoundedCard({Key? key, required this.onTap, required this.text, required this.icon}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: onTap,
      child: Container(
        height: 120,
        width: 120,
        color: MyColors.white,
        child: DashedRect(
          color: MyColors.lightIconColor,
          strokeWidth: 2.0,
          gap: 4.0,
          child: Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              icon,
              const SizedBox(width: 8),
              text.toText(
                fontSize: 15,
                isBold: true,
                color: MyColors.darkPrimaryColor,
              ),
            ],
          ),
        ),
      ),
    );
  }
}

class DottedRectContainer extends StatelessWidget {
  final Function() onTap;
  final String text;
  final Widget icon;
  final String extensions;

  const DottedRectContainer({Key? key, required this.onTap, required this.text, required this.icon, required this.extensions}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: onTap,
      child: Column(
        children: [
          DashedRect(
            color: MyColors.lightIconColor,
            strokeWidth: 2.0,
            gap: 4.0,
            child: Row(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                icon,
                const SizedBox(width: 8),
                text
                    .toText(
                      fontSize: 15,
                      isBold: true,
                      color: MyColors.darkPrimaryColor,
                    )
                    .paddingAll(6),
              ],
            ),
          ),
          8.height,
          Row(
            mainAxisAlignment: MainAxisAlignment.end,
            children: [
              "( $extensions )".toText(
                fontSize: 8,
                color: MyColors.lightTextColor,
              ),
            ],
          )
        ],
      ),
    );
  }
}
//
// class BuildAdStepContainer extends StatelessWidget {
//   final WidgetBuilder onVehicleDetails;
//   final WidgetBuilder onDamageParts;
//   final WidgetBuilder onAdDuration;
//   final WidgetBuilder onReviewAd;
//   final AdCreationStepsEnum adCreationStepsEnum;
//
//   const BuildAdStepContainer({
//     Key? key,
//     required this.onVehicleDetails,
//     required this.onDamageParts,
//     required this.onAdDuration,
//     required this.onReviewAd,
//     required this.adCreationStepsEnum,
//   }) : super(key: key);
//
//   @override
//   Widget build(BuildContext context) {
//     switch (adCreationStepsEnum) {
//       case AdCreationStepsEnum.vehicleDetails:
//         return onVehicleDetails(context);
//
//       case AdCreationStepsEnum.damageParts:
//         return onDamageParts(context);
//
//       case AdCreationStepsEnum.adDuration:
//         return onAdDuration(context);
//
//       case AdCreationStepsEnum.reviewAd:
//         return onReviewAd(context);
//     }
//   }
// }
