content: import 'package:crafty_bay/presentation/ui/utility/app_colors.dart';
  import 'package:flutter/material.dart';
  
  class SizeSelector extends StatefulWidget {
    const SizeSelector({super.key, required this.sizes, required this.onChange});
  
    final List<String> sizes;
    final Function(String) onChange;
  
    @override
    State<SizeSelector> createState() => _SizeSelectorState();
  }
  
  class _SizeSelectorState extends State<SizeSelector> {
    late String _selectedSize;
  
    @override
    void initState() {
      super.initState();
      _selectedSize = widget.sizes.first;
      widget.onChange(_selectedSize);
    }
  
    @override
    Widget build(BuildContext context) {
      return Row(
        mainAxisAlignment: MainAxisAlignment.start,
        children: widget.sizes
            .map(
              (s) => InkWell(
                onTap: () {
                  _selectedSize = s;
                  widget.onChange(s);
                  if (mounted) {
                    setState(() {});
                  }
                },
                borderRadius: BorderRadius.circular(16),
                child: Padding(
                  padding: const EdgeInsets.all(4.0),
                  child: Container(
                    padding: const EdgeInsets.symmetric(
                      horizontal: 12,
                      vertical: 8,
                    ),
                    decoration: BoxDecoration(
                        color: _selectedSize == s ? AppColors.primaryColor : null,
                        borderRadius: BorderRadius.circular(30),
                        border: Border.all(
                          color: Colors.grey,
                        )),
                    child: Text(
                      s,
                      style: TextStyle(
                        color: _selectedSize == s ? Colors.white : Colors.black87,
                      ),
                    ),
                  ),
                ),
              ),
            )
            .toList(),
      );
    }
  }
  