// ignore_for_file: deprecated_member_use_from_same_package

import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:hoshan/core/gen/assets.gen.dart';
import 'package:hoshan/ui/theme/colors.dart';
import 'package:hoshan/ui/theme/cubit/theme_mode_cubit.dart';
import 'package:hoshan/ui/theme/responsive.dart';
import 'package:hoshan/ui/theme/text.dart';
import 'package:hoshan/ui/widgets/sections/loading/default_placeholder.dart';

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

  @override
  Widget build(BuildContext context) {
    return Container(
      constraints: BoxConstraints(
          maxWidth: MediaQuery.sizeOf(context).width *
              (Responsive(context).isMobile() ? 0.7 : 0.15)),
      margin: const EdgeInsets.all(8),
      decoration: BoxDecoration(
          boxShadow: const [
            BoxShadow(
              color: Color(0x664D4D4D),
              blurRadius: 6,
              offset: Offset(0, 1),
              spreadRadius: 0,
            )
          ],
          color: Theme.of(context).colorScheme.surface,
          borderRadius: BorderRadius.circular(16)),
      child: Column(
        mainAxisAlignment: MainAxisAlignment.spaceBetween,
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Padding(
            padding: const EdgeInsets.all(12),
            child: Row(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                DefaultPlaceHolder(
                  child: Container(
                    width: 54,
                    height: 54,
                    decoration: BoxDecoration(
                      color: Colors.white,
                      borderRadius: BorderRadius.circular(16),
                      // boxShadow: const [
                      //   BoxShadow(
                      //     color: Color(0x664D4D4D),
                      //     blurRadius: 30,
                      //     offset: Offset(0, 1),
                      //     spreadRadius: 0,
                      //   )
                      // ],
                    ),
                  ),
                ),
                const SizedBox(
                  width: 8,
                ),
                Expanded(
                  child: Column(
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: [
                      DefaultPlaceHolder(
                        child: Container(
                          decoration: BoxDecoration(
                              color: Colors.white,
                              borderRadius: BorderRadius.circular(8)),
                          child: Text(
                            "cat.name   ",
                            style: AppTextStyles.headline6.copyWith(
                                color: Theme.of(context).colorScheme.onSurface),
                          ),
                        ),
                      ),
                      const SizedBox(
                        height: 4,
                      ),
                      DefaultPlaceHolder(
                        child: Column(
                          crossAxisAlignment: CrossAxisAlignment.start,
                          children: [
                            Container(
                              decoration: BoxDecoration(
                                  color: Colors.white,
                                  borderRadius: BorderRadius.circular(8)),
                              child: Row(
                                children: [
                                  Assets.icon.outline.coin.svg(
                                      color: Theme.of(context)
                                          .colorScheme
                                          .primary),
                                  Text(
                                    '',
                                    maxLines: 1,
                                    style: AppTextStyles.body5.copyWith(
                                        color: AppColors.gray[context
                                                .read<ThemeModeCubit>()
                                                .isDark()
                                            ? 600
                                            : 900]),
                                  ),
                                ],
                              ),
                            ),
                            const SizedBox(
                              height: 4,
                            ),
                            Container(
                              decoration: BoxDecoration(
                                  color: Colors.white,
                                  borderRadius: BorderRadius.circular(8)),
                              child: Text(
                                'سکه مصرفی بر اساس مدل انتخابی',
                                maxLines: 1,
                                style: AppTextStyles.body5.copyWith(
                                    color: AppColors.gray[
                                        context.read<ThemeModeCubit>().isDark()
                                            ? 600
                                            : 900]),
                              ),
                            ),
                          ],
                        ),
                      ),
                    ],
                  ),
                )
              ],
            ),
          ),
          Padding(
              padding: const EdgeInsets.symmetric(horizontal: 12),
              child: Row(
                mainAxisAlignment: MainAxisAlignment.start,
                children: [
                  DefaultPlaceHolder(
                    child: Container(
                      padding: const EdgeInsets.all(8),
                      decoration: BoxDecoration(
                          color: Colors.white,
                          borderRadius: BorderRadius.circular(8)),
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.start,
                        children: [
                          Container(
                            width: 8,
                            height: 8,
                            margin: const EdgeInsets.only(bottom: 4),
                            decoration: BoxDecoration(
                                shape: BoxShape.circle,
                                color: Theme.of(context).colorScheme.secondary),
                          ),
                          const SizedBox(
                            width: 8,
                          ),
                          Text(
                            ' مدل',
                            style: AppTextStyles.body5.copyWith(
                                color: Theme.of(context).colorScheme.onSurface,
                                fontWeight: FontWeight.bold),
                          )
                        ],
                      ),
                    ),
                  ),
                  const SizedBox(
                    width: 8,
                  ),
                  DefaultPlaceHolder(
                    child: Container(
                      decoration: BoxDecoration(
                          color: Colors.white,
                          borderRadius: BorderRadius.circular(8)),
                      child: Text(
                        'و...          ',
                        style: AppTextStyles.body6.copyWith(
                            color: AppColors.gray[
                                context.read<ThemeModeCubit>().isDark()
                                    ? 600
                                    : 900]),
                      ),
                    ),
                  ),
                ],
              )),
          const SizedBox(
            height: 12,
          )
        ],
      ),
    );
  }
}
