From 0f1173f90af90f2ff6112c1e61e86bd8c367c18d Mon Sep 17 00:00:00 2001 From: markkiepe Date: Tue, 28 May 2024 10:00:53 +0200 Subject: [PATCH] chore: latest versions --- README.md | 2 +- example/lib/src/configuration/configuration.dart | 12 +++++++----- example/pubspec.yaml | 2 +- pubspec.yaml | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index c4ce84d..abe92eb 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/example/lib/src/configuration/configuration.dart b/example/lib/src/configuration/configuration.dart index 85281f3..93e7730 100644 --- a/example/lib/src/configuration/configuration.dart +++ b/example/lib/src/configuration/configuration.dart @@ -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.value( - getShopContent(shopId), + getProducts: (ProductPageShop shop) => + Future.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(), diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 99f72f1..30bba15 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -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 diff --git a/pubspec.yaml b/pubspec.yaml index 14ff230..96b0ac5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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