chore: latest versions (#2)

This commit is contained in:
Mark 2024-05-28 10:10:28 +02:00 committed by GitHub
parent 33184a3b01
commit 756fa00be6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 10 additions and 8 deletions

View file

@ -88,7 +88,7 @@ FlutterShoppingConfiguration(
// (RECOMMENDED) Function that is fired when the shop selection
// changes. You could use this to clear your shopping cart or to
// change the products so they belong to the correct shop again.
onShopSelectionChange: (shopId) => productService.clear(),
onShopSelectionChange: (ProductPageShop shop) => productService.clear(),
// (RECOMMENDED) The shop that is initially selected.
// Must be one of the shops in the [shops] list.

View file

@ -19,15 +19,16 @@ FlutterShoppingConfiguration getFlutterShoppingConfiguration() =>
configuration: ProductPageConfiguration(
// (REQUIRED): List of shops that should be displayed
// If there is only one, make a list with just one shop.
shops: getShops(),
shops: Future.value(getShops()),
// (REQUIRED): Function to add a product to the cart
onAddToCart: (ProductPageProduct product) =>
productService.addProduct(product as MyProduct),
// (REQUIRED): Function to get the products for a shop
getProducts: (String shopId) => Future<ProductPageContent>.value(
getShopContent(shopId),
getProducts: (ProductPageShop shop) =>
Future<ProductPageContent>.value(
getShopContent(shop.id),
),
// (REQUIRED): Function to navigate to the shopping cart
@ -46,11 +47,12 @@ FlutterShoppingConfiguration getFlutterShoppingConfiguration() =>
// (RECOMMENDED) Function that is fired when the shop selection
// changes. You could use this to clear your shopping cart or to
// change the products so they belong to the correct shop again.
onShopSelectionChange: (shopId) => productService.clear(),
onShopSelectionChange: (ProductPageShop shop) =>
productService.clear(),
// (RECOMMENDED) The shop that is initially selected.
// Must be one of the shops in the [shops] list.
initialShop: getShops().first,
initialShopId: getShops().first.id,
// (RECOMMENDED) Localizations for the product page.
localizations: const ProductPageLocalization(),

View file

@ -23,7 +23,7 @@ dependencies:
flutter_product_page:
git:
url: https://github.com/Iconica-Development/flutter_product_page
ref: 1.1.0
ref: 1.3.0
flutter_shopping_cart:
git:
url: https://github.com/Iconica-Development/flutter_shopping_cart

View file

@ -13,7 +13,7 @@ dependencies:
flutter_product_page:
git:
url: https://github.com/Iconica-Development/flutter_product_page
ref: 1.1.0
ref: 1.3.0
flutter_shopping_cart:
git:
url: https://github.com/Iconica-Development/flutter_shopping_cart