NibiteProductStack constructor

const NibiteProductStack({
  1. Key? key,
  2. required String name,
  3. required Widget image,
  4. required String price,
  5. required void onAddToCart(
    1. GlobalKey<State<StatefulWidget>>
    ),
  6. required void onTap(),
  7. bool showDataOnly = false,
  8. Color? primaryColor,
  9. Color? foregroundColor,
})

Creates a NibiteProductStack with its initial values.

  • name: The product name.
  • image: The product image.
  • price: The price of the product.
  • onAddToCart: The event to be executed when touching the added shopping cart button.
  • onTap: The event to run when touching any part of the widget.
  • showDataOnly: When its value is true, the price and the add to shopping cart button are hidden.
  • showDataOnly: The color of the price text and the add to cart button.
  • foregroundColor: The text color of the add to cart button.

Implementation

const NibiteProductStack({
  super.key,
  required this.name,
  required this.image,
  required this.price,
  required this.onAddToCart,
  required this.onTap,
  this.showDataOnly = false,
  this.primaryColor,
  this.foregroundColor,
});