flutter_cart 0.0.5 copy "flutter_cart: ^0.0.5" to clipboard
flutter_cart: ^0.0.5 copied to clipboard

outdated

A flutter 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:flutter_cart/flutter_cart.dart';

class SampleClass {
  var message;

  /// Creating the instance of flutter cart package.
  var cart = FlutterCart();

  /// sample function
  addToCart(dynamic _product) => {
        message = cart.addToCart(
            productId: _product.productId,
            unitPrice: _product.productPrice,
            quantity: _product.quantity,

            ///[uniqueCheck] is used to differentiate the type between item
            ///[e.g] the shirt sizes in (LARGE, MEDIUM, SMALL) the [Product ID] will remain same
            ///But if UUID is not present so, how we can differentiate between them? So in this case we will
            ///User the uniqueCheck
            uniqueCheck: _product.selectedProductType,

            ///[productDetailsObject] is used as a dump variable you can dump your object and any kind of data
            ///that you wanted use in future.
            productDetailsObject: _product),
      };

  /// This function is used to decrement the item quantity from cart
  removeItemFromCart(int index) => {
        cart.decrementItemFromCart(index),
      };

  /// This function is used to increment the item quantity into cart
  addItemToCart(int index) {
    cart.incrementItemToCart(index);
  }
}

void main() {
  var yourObject;
  SampleClass().addItemToCart(yourObject);
}
86
likes
0
pub points
90%
popularity

Publisher

unverified uploader

A flutter 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.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_cart