flutter_shopping/packages/flutter_shopping_cart
2025-02-17 15:39:22 +01:00
..
lib feat: userstory (#13) 2024-07-12 09:49:58 +02:00
.gitignore Feature/melos-variant (#8) 2024-06-26 16:12:48 +02:00
analysis_options.yaml Feature/melos-variant (#8) 2024-06-26 16:12:48 +02:00
CHANGELOG.md chore: ready the package for deployment to the pub server 2025-02-17 15:39:22 +01:00
CONTRIBUTING.md chore: ready the package for deployment to the pub server 2025-02-17 15:39:22 +01:00
LICENSE chore: ready the package for deployment to the pub server 2025-02-17 15:39:22 +01:00
pubspec.yaml chore: ready the package for deployment to the pub server 2025-02-17 15:39:22 +01:00
README.md Feature/melos-variant (#8) 2024-06-26 16:12:48 +02:00

flutter_shopping_cart

This component contains a shopping cart screen and the functionality for shopping carts that contain products.

Features

  • Shopping cart screen
  • Shopping cart products

Usage

First, create your own product by extending the Product class:

class ExampleProduct extends Product {
  ExampleProduct({
    requried super.id,
    required super.name,
    required super.price,
    required this.image,
    super.quantity,
  });

  final String image;
}

Next, you can create the ShoppingCartScreen widget like this:

var myProductService = ProductService<ExampleProduct>([]);

ShoppingCartScreen<ExampleProduct>(
    configuration: ShoppingCartConfig<ExampleProduct>(
        productService: myProductService,
        //
        productItemBuilder: (
            BuildContext context,
            Locale locale,
            ExampleProduct product,
        ) =>
            ListTile(
            title: Text(product.name),
            subtitle: Text(product.price.toString()),
        ),
        //
        onConfirmOrder: (List<ExampleProduct> products) {
            print("Placing order with products: $products");
        },
    ),
);

For a more detailed example you can see the example.

Or, you could run the example yourself:

git clone https://github.com/Iconica-Development/flutter_shopping_cart.git

cd flutter_shopping_cart

cd example

flutter run

Issues

Please file any issues, bugs or feature request as an issue on our GitHub page. Commercial support is available if you need help with integration with your app or services. You can contact us at support@iconica.nl.

Want to contribute

If you would like to contribute to the component (e.g. by improving the documentation, solving a bug or adding a cool new feature), please carefully review our contribution guide and send us your pull request.

Author

This flutter_shopping_cart for Flutter is developed by Iconica. You can contact us at support@iconica.nl