chore: latest versions

This commit is contained in:
markkiepe 2024-05-28 10:00:53 +02:00
parent 33184a3b01
commit 0f1173f90a
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 // (RECOMMENDED) Function that is fired when the shop selection
// changes. You could use this to clear your shopping cart or to // changes. You could use this to clear your shopping cart or to
// change the products so they belong to the correct shop again. // 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. // (RECOMMENDED) The shop that is initially selected.
// Must be one of the shops in the [shops] list. // Must be one of the shops in the [shops] list.

View file

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

View file

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

View file

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