import 'package:flutter/material.dart';
import 'producto_model.dart';

class ItemCarrito {
  Producto producto;
  int cantidad;
  Map<int, Set<int>> selectedToppings;
  Map<int, List<Producto>> selectableToppings;
  String? comentario;
  bool expandido;
  TextEditingController comentarioController;

  ItemCarrito({
    required this.producto,
    this.cantidad = 1,
    this.comentario,
    this.expandido = false,
    Map<int, Set<int>>? selectedToppings,
    Map<int, List<Producto>>? selectableToppings,
  })  : selectedToppings = selectedToppings ?? {},
        selectableToppings = selectableToppings ?? {},
        comentarioController = TextEditingController(text: comentario ?? '');

  void dispose() {
    comentarioController.dispose();
  }
}
