flutter_shopping/packages/flutter_shopping_cart
mike doornenbal 88cefb047b
feat: userstory (#13)
* feat: add interface to shopping cart

* feat: add interface to flutter_order_details

* feat: add interface to flutter_product_page

* feat: add userstory

* feat: cleanup configuration files

* feat: add builders for productpage

* feat: add filter screen and widgets

* feat: remove listenablebuilders from cart

* feat: remove listenablebuilders from order details

* feat: remove listenablebuilder from product page

---------

Co-authored-by: mike doornenbal <mikedoornenbal9@icloud.com>
2024-07-12 09:49:58 +02: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
pubspec.yaml feat: userstory (#13) 2024-07-12 09:49:58 +02: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