dart_cart 2.2.1 icon indicating copy to clipboard operation
dart_cart: ^2.2.1 copied to clipboard

This package for the cart management. This package helps you to perform basic cart operation like (Add to cart, Remove from cart, Get total count) etc.

example/main.dart

import 'package:dart_cart/dart_cart.dart';

void main() {
  var cart = DartCart();

  //add produto to cart productId end price
  cart.addToCart( productId: 111, unitPrice: 200);
  cart.addToCart(
      productId: 112,
      unitPrice: 400,
      quantity: 7,
      productDetailsObject: 'New produto',
      productName: 'Book',
      uniqueCheck: true);

  //incrementItemToCart
  cart.incrementItemToCart(0);
  cart.incrementItemToCart(0);
  cart.incrementItemToCart(0);

  //decrementItemFromCart
  cart.decrementItemFromCart(1);
  cart.decrementItemFromCart(1);

  //Total Price
  var total = cart.getTotalAmount();
  // Count
  var qtd = cart.getCartItemCount();

  print('Total to Cart $qtd');
  print('Total $total');
}
3
likes
130
pub points
39%
popularity

Publisher

unverified uploader

This package for the cart management. This package helps you to perform basic cart operation like (Add to cart, Remove from cart, Get total count) etc.

Homepage

Documentation

API reference

License

Icon for licenses.Apache-2.0 (LICENSE)

More

Packages that depend on dart_cart