flutter_cart 0.0.5+1
flutter_cart: ^0.0.5+1 copied to clipboard

Flutter Android iOS Linux macOS web Windows

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);
}
11
likes
90
pub points
80%
popularity

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

Documentation

API reference

Uploader

osama.asif20@gmail.com

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_cart