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

import '../app.dart';

class CartItemAdder extends StatelessWidget {
  final ProductModel model;
  const CartItemAdder({required this.model});

  @override
  Widget build(BuildContext context) {
    return GetX<ProductController>(
      init: ProductController(model),
      builder: (controller) => ItemQuantityCounter(
        text: controller.addingItemCount.value.toString(),
        decrementCallback: controller.onDecreaseItemTapped,
        incrementCallback: controller.onIncreaseItemTapped,
      ),
    );
  }
}
