content: import 'package:flutter/material.dart';
  import 'package:t_store/common/widgets/chips/choice_chip.dart';
  import 'package:t_store/common/widgets/custom_shapes/containers/rounded_container.dart';
  import 'package:t_store/common/widgets/texts/product_price_text.dart';
  import 'package:t_store/common/widgets/texts/product_title_text.dart';
  import 'package:t_store/common/widgets/texts/section_heading.dart';
  import 'package:t_store/features/shop/models/product_model.dart';
  import 'package:t_store/utils/constraints/colors.dart';
  import 'package:t_store/utils/constraints/sizes.dart';
  import 'package:t_store/utils/helpers/helper_functions.dart';
  
  class TProductAttributes extends StatelessWidget {
    const TProductAttributes({Key? key, required this.product}) : super(key: key);
  
    final ProductModel product;
  
    @override
    Widget build(BuildContext context) {
      final dark = THelperFunctions.isDarkMode(context);
      return Column(
        children: [
          ///selected attribute pricing & description
          TRoundedContainer(
            padding: const EdgeInsets.all(TSizes.md),
            backgroundColor: dark ? TColors.darkerGrey : TColors.grey,
            child: Column(
              children: [
                ///title,price and stock status
                Row(
                  children: [
                    const TSectionHeading(
                        title: 'Variation', showActionButton: false),
                    const SizedBox(width: TSizes.spaceBtwItems),
                    Column(
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: [
                        Row(
                          children: [
                            const TProductTitleText(
                                title: 'Price : ', smallSize: true),
                            const SizedBox(width: TSizes.spaceBtwItems),
  
                            ///actual price
                            Text(
                              '\$25',
                              style: Theme.of(context)
                                  .textTheme
                                  .titleSmall!
                                  .apply(decoration: TextDecoration.lineThrough),
                            ),
                            const SizedBox(width: TSizes.spaceBtwItems),
  
                            ///sale price
                            const TProductPriceText(price: '20'),
                          ],
                        ),
  
                        ///stack
                        Row(
                          children: [
                            const TProductTitleText(
                                title: 'Stock : ', smallSize: true),
                            Text('In Stock',
                                style: Theme.of(context).textTheme.titleMedium),
                          ],
                        )
                      ],
                    ),
                  ],
                ),
  
                ///variable description
                const TProductTitleText(
                  title:
                      'This is the description of the product and it can open up to  max 4 times',
                  smallSize: true,
                  maxLines: 4,
                ),
              ],
            ),
          ),
          const SizedBox(height: TSizes.spaceBtwItems),
  
          ///attributes
          Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: product.productAttributes!.map((attribute) => Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                TSectionHeading(title: attribute.name ?? '', showActionButton: false),
                const SizedBox(height: TSizes.spaceBtwItems / 2),
                Wrap(
                  spacing: 8,
                  children: attribute.values!.map((value) =>
                      TChoiceChip(text: value, selected: false, onSelected: (value){}),).toList(),
  
                    
  
                )
              ],
            ),).toList(),
  
          )
  
  
  
        ],
      );
    }
  }
  
  
  