From bafa7cd0a0671a7971753eafe1653fb7b6a284c9 Mon Sep 17 00:00:00 2001 From: Freek van de Ven Date: Wed, 26 Jun 2024 15:36:28 +0200 Subject: [PATCH] feat: remove example apps --- .../flutter_order_details/example/.gitignore | 53 ------- .../flutter_order_details/example/README.md | 16 -- .../example/analysis_options.yaml | 9 -- .../order_detail_screen_configuration.dart | 144 ------------------ .../example/lib/main.dart | 20 --- .../example/lib/utils/theme.dart | 32 ---- .../example/pubspec.yaml | 33 ---- packages/flutter_order_details/pubspec.yaml | 3 +- .../flutter_product_page/example/.gitignore | 53 ------- .../flutter_product_page/example/README.md | 16 -- .../example/analysis_options.yaml | 9 -- .../product_page_screen_configuration.dart | 81 ---------- .../example/lib/main.dart | 48 ------ .../example/lib/models/my_product.dart | 34 ----- .../example/lib/models/my_shop.dart | 8 - .../example/lib/utils/theme.dart | 37 ----- .../flutter_product_page/example/pubspec.yaml | 33 ---- packages/flutter_product_page/pubspec.yaml | 3 +- .../flutter_shopping/example/pubspec.yaml | 12 +- .../example_amazon/pubspec.yaml | 12 +- packages/flutter_shopping/pubspec.yaml | 12 +- .../flutter_shopping_cart/example/.gitignore | 53 ------- .../flutter_shopping_cart/example/README.md | 16 -- .../example/analysis_options.yaml | 9 -- .../shopping_cart_configuration.dart | 125 --------------- .../example/lib/main.dart | 48 ------ .../example/lib/models/example_product.dart | 13 -- .../example/pubspec.yaml | 34 ----- 28 files changed, 23 insertions(+), 943 deletions(-) delete mode 100644 packages/flutter_order_details/example/.gitignore delete mode 100644 packages/flutter_order_details/example/README.md delete mode 100644 packages/flutter_order_details/example/analysis_options.yaml delete mode 100644 packages/flutter_order_details/example/lib/config/order_detail_screen_configuration.dart delete mode 100644 packages/flutter_order_details/example/lib/main.dart delete mode 100644 packages/flutter_order_details/example/lib/utils/theme.dart delete mode 100644 packages/flutter_order_details/example/pubspec.yaml delete mode 100644 packages/flutter_product_page/example/.gitignore delete mode 100644 packages/flutter_product_page/example/README.md delete mode 100644 packages/flutter_product_page/example/analysis_options.yaml delete mode 100644 packages/flutter_product_page/example/lib/config/product_page_screen_configuration.dart delete mode 100644 packages/flutter_product_page/example/lib/main.dart delete mode 100644 packages/flutter_product_page/example/lib/models/my_product.dart delete mode 100644 packages/flutter_product_page/example/lib/models/my_shop.dart delete mode 100644 packages/flutter_product_page/example/lib/utils/theme.dart delete mode 100644 packages/flutter_product_page/example/pubspec.yaml delete mode 100644 packages/flutter_shopping_cart/example/.gitignore delete mode 100644 packages/flutter_shopping_cart/example/README.md delete mode 100644 packages/flutter_shopping_cart/example/analysis_options.yaml delete mode 100644 packages/flutter_shopping_cart/example/lib/configuration/shopping_cart_configuration.dart delete mode 100644 packages/flutter_shopping_cart/example/lib/main.dart delete mode 100644 packages/flutter_shopping_cart/example/lib/models/example_product.dart delete mode 100644 packages/flutter_shopping_cart/example/pubspec.yaml diff --git a/packages/flutter_order_details/example/.gitignore b/packages/flutter_order_details/example/.gitignore deleted file mode 100644 index 8760a85..0000000 --- a/packages/flutter_order_details/example/.gitignore +++ /dev/null @@ -1,53 +0,0 @@ -# Miscellaneous -*.class -*.log -*.pyc -*.swp -.DS_Store -.atom/ -.buildlog/ -.history -.svn/ -migrate_working_dir/ - -# IntelliJ related -*.iml -*.ipr -*.iws -.idea/ - -# The .vscode folder contains launch configuration and tasks you configure in -# VS Code which you may wish to be included in version control, so this line -# is commented out by default. -.vscode/ - -# Flutter/Dart/Pub related -**/doc/api/ -**/ios/Flutter/.last_build_id -.dart_tool/ -.flutter-plugins -.flutter-plugins-dependencies -.pub-cache/ -.pub/ -/build/ -.metadata -pubspec.lock - -# Symbolication related -app.*.symbols - -# Obfuscation related -app.*.map.json - -# Android Studio will place build artifacts here -/android/app/debug -/android/app/profile -/android/app/release - -# Platforms -/android/ -/ios/ -/linux/ -/macos/ -/web/ -/windows/ diff --git a/packages/flutter_order_details/example/README.md b/packages/flutter_order_details/example/README.md deleted file mode 100644 index 2b3fce4..0000000 --- a/packages/flutter_order_details/example/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# example - -A new Flutter project. - -## Getting Started - -This project is a starting point for a Flutter application. - -A few resources to get you started if this is your first Flutter project: - -- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) -- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) - -For help getting started with Flutter development, view the -[online documentation](https://docs.flutter.dev/), which offers tutorials, -samples, guidance on mobile development, and a full API reference. diff --git a/packages/flutter_order_details/example/analysis_options.yaml b/packages/flutter_order_details/example/analysis_options.yaml deleted file mode 100644 index 31b4b51..0000000 --- a/packages/flutter_order_details/example/analysis_options.yaml +++ /dev/null @@ -1,9 +0,0 @@ -include: package:flutter_iconica_analysis/analysis_options.yaml - -# Possible to overwrite the rules from the package - -analyzer: - exclude: - -linter: - rules: diff --git a/packages/flutter_order_details/example/lib/config/order_detail_screen_configuration.dart b/packages/flutter_order_details/example/lib/config/order_detail_screen_configuration.dart deleted file mode 100644 index 6a04536..0000000 --- a/packages/flutter_order_details/example/lib/config/order_detail_screen_configuration.dart +++ /dev/null @@ -1,144 +0,0 @@ -import "package:flutter/material.dart"; -import "package:flutter_order_details/flutter_order_details.dart"; - -OrderDetailConfiguration getOrderDetailConfiguration() => - OrderDetailConfiguration( - // (REQUIRED): onComplete function that allows you to do with the - // results as wanted. - // ignore: avoid_print - onCompleted: (OrderResult result) => print(result.order), - - // (REQUIRED): List of steps that the user has to go through to - // complete the order. - steps: [ - OrderDetailStep( - // stepName: "Step 1", - formKey: GlobalKey(), - fields: [ - OrderChoiceInput( - // REQUIRED - title: "Payment method", - outputKey: "payment_method", - items: [ - "PAY NOW", - "PAY AT CASH REGISTER", - ], - - // OPTIONAL - subtitle: "Choose a payment method", - ), - ], - ), - OrderDetailStep( - // stepName: "Step 1", - formKey: GlobalKey(), - fields: [ - OrderDropdownInput( - // REQUIRED - title: "When do you want to pick up your order?", - outputKey: "order_pickup_time", - items: [ - "Today", - "Monday 7 juni", - "Tuesday 8 juni", - "Wednesday 9 juni", - "Thursday 10 juni", - ], - - // OPTIONAL - subtitle: "Choose a date", - ), - OrderTimePicker( - // REQUIRED - title: "Choose a time", - - titleStyle: OrderDetailTitleStyle.none, - padding: EdgeInsets.zero, - outputKey: "chosen_time", - - // OPTIONAL - morningLabel: "Morning", - afternoonLabel: "Afternoon", - eveningLabel: "Evening", - - beginTime: 9, // Opening time - endTime: 20, // Closing time - ), - ], - ), - OrderDetailStep( - // stepName: "Step 1", - formKey: GlobalKey(), - fields: [ - OrderTextInput( - // REQUIRED - outputKey: "user_name", - title: "What is your name?", - textController: TextEditingController(), - - // OPTIONAL - hint: "Your name", - ), - OrderAddressInput( - // REQUIRED - outputKey: "user_address", - title: "What is your address?", - textController: TextEditingController(), - ), - ], - ), - OrderDetailStep( - // stepName: "Step 2", - formKey: GlobalKey(), - fields: [ - OrderPhoneInput( - // REQUIRED - outputKey: "user_phone", - title: "Phone", - textController: TextEditingController(), - - // OPTIONAL - errorIsRequired: "You must enter a phone number", - errorMustBe11Digits: "A phone number must be 11 digits long", - errorMustBeNumeric: "Phone number must be numeric", - errorMustStartWith316: "Phone number must start with 316", - ), - OrderEmailInput( - // REQUIRED - outputKey: "user_email", - title: "Email", - textController: TextEditingController(), - - // OPTIONAL - errorInvalidEmail: "Invalid email address", - ), - ], - ), - ], - - // (OPTIONAL) (RECOMMENDED): Custom localizations. - localization: const OrderDetailLocalization( - backButton: "Back", - nextButton: "Next", - completeButton: "Complete", - ), - - // (OPTIONAL): Progress bar - progressIndicator: true, - - // (OPTIONAL): Input field padding - inputFieldPadding: const EdgeInsets.symmetric( - horizontal: 32, - vertical: 16, - ), - - // (OPTIONAL): Title padding - titlePadding: const EdgeInsets.only(left: 16, right: 16, top: 16), - - // (OPTIONAL): App bar - appBar: AppBar( - title: const Text( - "Order Details", - ), - ), - ); diff --git a/packages/flutter_order_details/example/lib/main.dart b/packages/flutter_order_details/example/lib/main.dart deleted file mode 100644 index 59496c4..0000000 --- a/packages/flutter_order_details/example/lib/main.dart +++ /dev/null @@ -1,20 +0,0 @@ -import "package:example/config/order_detail_screen_configuration.dart"; -import "package:example/utils/theme.dart"; -import "package:flutter/material.dart"; -import "package:flutter_order_details/flutter_order_details.dart"; - -void main() => runApp(const MyApp()); - -class MyApp extends StatelessWidget { - /// - const MyApp({super.key}); - - @override - Widget build(BuildContext context) => MaterialApp( - title: "Flutter Demo", - theme: getTheme(), - home: OrderDetailScreen( - configuration: getOrderDetailConfiguration(), - ), - ); -} diff --git a/packages/flutter_order_details/example/lib/utils/theme.dart b/packages/flutter_order_details/example/lib/utils/theme.dart deleted file mode 100644 index c4e60f9..0000000 --- a/packages/flutter_order_details/example/lib/utils/theme.dart +++ /dev/null @@ -1,32 +0,0 @@ -import "package:flutter/material.dart"; - -ThemeData getTheme() => ThemeData( - scaffoldBackgroundColor: const Color.fromRGBO(250, 249, 246, 1), - textTheme: const TextTheme( - labelMedium: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w400, - color: Color.fromRGBO(0, 0, 0, 1), - ), - titleMedium: TextStyle( - fontSize: 16, - color: Color.fromRGBO(60, 60, 59, 1), - fontWeight: FontWeight.w700, - ), - ), - inputDecorationTheme: const InputDecorationTheme( - fillColor: Color.fromRGBO(255, 255, 255, 1), - ), - colorScheme: const ColorScheme.light( - primary: Color.fromRGBO(64, 87, 122, 1), - secondary: Color.fromRGBO(255, 255, 255, 1), - surface: Color.fromRGBO(250, 249, 246, 1), - ), - appBarTheme: const AppBarTheme( - backgroundColor: Color.fromRGBO(64, 87, 122, 1), - titleTextStyle: TextStyle( - fontSize: 28, - color: Color.fromRGBO(255, 255, 255, 1), - ), - ), - ); diff --git a/packages/flutter_order_details/example/pubspec.yaml b/packages/flutter_order_details/example/pubspec.yaml deleted file mode 100644 index 817c9cf..0000000 --- a/packages/flutter_order_details/example/pubspec.yaml +++ /dev/null @@ -1,33 +0,0 @@ -name: example -description: "Demonstrates how to use the flutter_order_details package." -publish_to: 'none' -version: 1.0.0+1 - -environment: - sdk: '>=3.3.0 <4.0.0' - -dependencies: - flutter: - sdk: flutter - flutter_order_details: - path: ../ - -dev_dependencies: - flutter_test: - sdk: flutter - flutter_iconica_analysis: - git: - url: https://github.com/Iconica-Development/flutter_iconica_analysis - ref: 7.0.0 - -flutter: - uses-material-design: true - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic diff --git a/packages/flutter_order_details/pubspec.yaml b/packages/flutter_order_details/pubspec.yaml index 7aaf793..7d37a9f 100644 --- a/packages/flutter_order_details/pubspec.yaml +++ b/packages/flutter_order_details/pubspec.yaml @@ -1,7 +1,6 @@ name: flutter_order_details description: "A Flutter module for order details." -version: 1.0.0+1 -homepage: +version: 1.0.0 environment: sdk: '>=3.3.0 <4.0.0' diff --git a/packages/flutter_product_page/example/.gitignore b/packages/flutter_product_page/example/.gitignore deleted file mode 100644 index 8760a85..0000000 --- a/packages/flutter_product_page/example/.gitignore +++ /dev/null @@ -1,53 +0,0 @@ -# Miscellaneous -*.class -*.log -*.pyc -*.swp -.DS_Store -.atom/ -.buildlog/ -.history -.svn/ -migrate_working_dir/ - -# IntelliJ related -*.iml -*.ipr -*.iws -.idea/ - -# The .vscode folder contains launch configuration and tasks you configure in -# VS Code which you may wish to be included in version control, so this line -# is commented out by default. -.vscode/ - -# Flutter/Dart/Pub related -**/doc/api/ -**/ios/Flutter/.last_build_id -.dart_tool/ -.flutter-plugins -.flutter-plugins-dependencies -.pub-cache/ -.pub/ -/build/ -.metadata -pubspec.lock - -# Symbolication related -app.*.symbols - -# Obfuscation related -app.*.map.json - -# Android Studio will place build artifacts here -/android/app/debug -/android/app/profile -/android/app/release - -# Platforms -/android/ -/ios/ -/linux/ -/macos/ -/web/ -/windows/ diff --git a/packages/flutter_product_page/example/README.md b/packages/flutter_product_page/example/README.md deleted file mode 100644 index 2b3fce4..0000000 --- a/packages/flutter_product_page/example/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# example - -A new Flutter project. - -## Getting Started - -This project is a starting point for a Flutter application. - -A few resources to get you started if this is your first Flutter project: - -- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) -- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) - -For help getting started with Flutter development, view the -[online documentation](https://docs.flutter.dev/), which offers tutorials, -samples, guidance on mobile development, and a full API reference. diff --git a/packages/flutter_product_page/example/analysis_options.yaml b/packages/flutter_product_page/example/analysis_options.yaml deleted file mode 100644 index 31b4b51..0000000 --- a/packages/flutter_product_page/example/analysis_options.yaml +++ /dev/null @@ -1,9 +0,0 @@ -include: package:flutter_iconica_analysis/analysis_options.yaml - -# Possible to overwrite the rules from the package - -analyzer: - exclude: - -linter: - rules: diff --git a/packages/flutter_product_page/example/lib/config/product_page_screen_configuration.dart b/packages/flutter_product_page/example/lib/config/product_page_screen_configuration.dart deleted file mode 100644 index daf34de..0000000 --- a/packages/flutter_product_page/example/lib/config/product_page_screen_configuration.dart +++ /dev/null @@ -1,81 +0,0 @@ -import "package:example/models/my_product.dart"; -import "package:example/models/my_shop.dart"; -import "package:flutter/material.dart"; -import "package:flutter_product_page/flutter_product_page.dart"; - -ProductPageConfiguration getProductPageScreenConfiguration({ - required List shops, - required List products, -}) => - ProductPageConfiguration( - // (REQUIRED) List of shops to display. - shops: Future.value(shops), - - // (REQUIRED) Function that returns the products for a shop. - getProducts: (ProductPageShop shop) => Future( - () => ProductPageContent( - products: products, - discountedProduct: products.firstWhere( - (MyProduct product) => product.hasDiscount, - ), - ), - ), - - // (REQUIRED) Function that handles the functionality behind adding - // a product to the cart. - // ignore: avoid_print - onAddToCart: (product) => print("Add to cart: ${product.name}"), - - // (REQUIRED) Function that handles the functionality behind navigating - // to the product detail page. - // ignore: avoid_print - onNavigateToShoppingCart: () => print("Navigate to shopping cart"), - - // (RECOMMENDED) The shop that is initially selected. - // Must be one of the shops in the [shops] list. - initialShopId: shops.first.id, - - // (RECOMMENDED) Function that returns the amount of products in the - // shopping cart. This currently is mocked and should be replaced with - // a real implementation. - // getProductsInShoppingCart: () => 0, - - // (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: (ProductPageShop shop) => - // ignore: avoid_print - print("Shop selected: ${shop.id}"), - - // (RECOMMENDED) Localizations for the product page. - localizations: const ProductPageLocalization( - navigateToShoppingCart: "Naar Winkelmandje", - discountTitle: "Weekaanbieding", - failedToLoadImageExplenation: "Afbeelding laden mislukt.", - close: "Sluiten", - ), - - // (RECOMMENDED) Function that returns the description for a product - // that is on sale. - getDiscountDescription: (ProductPageProduct product) => - """Koop nu ${product.name} voor slechts €${product.discountPrice?.toStringAsFixed(2)}""", - - /* - Some recommended functions to implement for additional customizability: - - Widget Function(BuildContext, Product)? productBuilder, - Widget Function(BuildContext, Product)? productPopupBuilder, - Widget Function(BuildContext)? noContentBuilder, - Widget Function(BuildContext, Object?, StackTrace?)? errorBuilder, - */ - - // (OPTIONAL) Styling for the shop selector - shopSelectorStyle: ShopSelectorStyle.row, - - // (OPTIONAL) Builder for the product item. - appBar: AppBar( - title: const Text( - "Producten pagina", - ), - ), - ); diff --git a/packages/flutter_product_page/example/lib/main.dart b/packages/flutter_product_page/example/lib/main.dart deleted file mode 100644 index 9f52a42..0000000 --- a/packages/flutter_product_page/example/lib/main.dart +++ /dev/null @@ -1,48 +0,0 @@ -import "package:example/config/product_page_screen_configuration.dart"; -import "package:example/models/my_product.dart"; -import "package:example/models/my_shop.dart"; -import "package:example/utils/theme.dart"; -import "package:flutter/material.dart"; -import "package:flutter_product_page/flutter_product_page.dart"; - -void main() => runApp(const MyApp()); - -class MyApp extends StatelessWidget { - /// - const MyApp({super.key}); - - @override - Widget build(BuildContext context) { - var shops = List.generate( - 7, - (int index) => MyShop( - id: index.toString(), - name: "Shop ${(index.isEven ? index * 40 : index) + 1}", - ), - ); - - var products = List.generate( - 6, - (int index) => MyProduct( - id: index.toString(), - name: "Product ${index + 1}", - price: 100.0, - imageUrl: "https://via.placeholder.com/150", - category: index.isEven ? "Category 1" : "Category 2", - hasDiscount: index.isEven, - discountPrice: 50.0, - ), - ); - - return MaterialApp( - title: "Flutter Demo", - theme: getTheme(), - home: ProductPageScreen( - configuration: getProductPageScreenConfiguration( - shops: shops, - products: products, - ), - ), - ); - } -} diff --git a/packages/flutter_product_page/example/lib/models/my_product.dart b/packages/flutter_product_page/example/lib/models/my_product.dart deleted file mode 100644 index d7f760e..0000000 --- a/packages/flutter_product_page/example/lib/models/my_product.dart +++ /dev/null @@ -1,34 +0,0 @@ -import "package:flutter_product_page/flutter_product_page.dart"; - -class MyProduct with ProductPageProduct { - const MyProduct({ - required this.id, - required this.name, - required this.price, - required this.imageUrl, - required this.category, - required this.hasDiscount, - required this.discountPrice, - }); - - @override - final String id; - - @override - final String name; - - @override - final double price; - - @override - final String imageUrl; - - @override - final String category; - - @override - final bool hasDiscount; - - @override - final double? discountPrice; -} diff --git a/packages/flutter_product_page/example/lib/models/my_shop.dart b/packages/flutter_product_page/example/lib/models/my_shop.dart deleted file mode 100644 index ddf05b9..0000000 --- a/packages/flutter_product_page/example/lib/models/my_shop.dart +++ /dev/null @@ -1,8 +0,0 @@ -import "package:flutter_product_page/flutter_product_page.dart"; - -class MyShop extends ProductPageShop { - const MyShop({ - required super.id, - required super.name, - }); -} diff --git a/packages/flutter_product_page/example/lib/utils/theme.dart b/packages/flutter_product_page/example/lib/utils/theme.dart deleted file mode 100644 index 7893dc1..0000000 --- a/packages/flutter_product_page/example/lib/utils/theme.dart +++ /dev/null @@ -1,37 +0,0 @@ -import "package:flutter/material.dart"; - -ThemeData getTheme() => ThemeData( - textTheme: const TextTheme( - labelMedium: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w400, - color: Color.fromRGBO(0, 0, 0, 1), - ), - titleMedium: TextStyle( - fontSize: 16, - color: Color.fromRGBO(60, 60, 59, 1), - fontWeight: FontWeight.w700, - ), - bodyMedium: TextStyle( - fontSize: 14, - fontWeight: FontWeight.w400, - fontFamily: "Futura", - color: Color.fromRGBO(60, 60, 59, 1), - ), - ), - inputDecorationTheme: const InputDecorationTheme( - fillColor: Color.fromRGBO(255, 255, 255, 1), - ), - colorScheme: const ColorScheme.light( - primary: Color.fromRGBO(64, 87, 122, 1), - secondary: Color.fromRGBO(255, 255, 255, 1), - surface: Color.fromRGBO(250, 249, 246, 1), - ), - appBarTheme: const AppBarTheme( - backgroundColor: Color.fromRGBO(64, 87, 122, 1), - titleTextStyle: TextStyle( - fontSize: 28, - color: Color.fromRGBO(255, 255, 255, 1), - ), - ), - ); diff --git a/packages/flutter_product_page/example/pubspec.yaml b/packages/flutter_product_page/example/pubspec.yaml deleted file mode 100644 index f56a1b6..0000000 --- a/packages/flutter_product_page/example/pubspec.yaml +++ /dev/null @@ -1,33 +0,0 @@ -name: example -description: "Demonstrates how to use the flutter_product_page package." -publish_to: 'none' -version: 1.0.0+1 - -environment: - sdk: '>=3.3.0 <4.0.0' - -dependencies: - flutter: - sdk: flutter - flutter_product_page: - path: ../ - -dev_dependencies: - flutter_test: - sdk: flutter - flutter_iconica_analysis: - git: - url: https://github.com/Iconica-Development/flutter_iconica_analysis - ref: 7.0.0 - -flutter: - uses-material-design: true - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic diff --git a/packages/flutter_product_page/pubspec.yaml b/packages/flutter_product_page/pubspec.yaml index b345fe2..6ffcb50 100644 --- a/packages/flutter_product_page/pubspec.yaml +++ b/packages/flutter_product_page/pubspec.yaml @@ -1,8 +1,7 @@ name: flutter_product_page description: "A Flutter module for the product page" publish_to: 'none' -version: 1.0.0+1 -homepage: +version: 1.0.0 environment: sdk: '>=3.3.4 <4.0.0' diff --git a/packages/flutter_shopping/example/pubspec.yaml b/packages/flutter_shopping/example/pubspec.yaml index d6ef298..7542647 100644 --- a/packages/flutter_shopping/example/pubspec.yaml +++ b/packages/flutter_shopping/example/pubspec.yaml @@ -1,7 +1,7 @@ name: example description: Demonstrates how to use the flutter_shopping package." publish_to: 'none' # Remove this line if you wish to publish to pub.dev -version: 1.0.0+1 +version: 1.0.0 environment: sdk: '>=3.3.4 <4.0.0' @@ -22,12 +22,14 @@ dependencies: ## Normal Packages flutter_product_page: git: - url: https://github.com/Iconica-Development/flutter_product_page - ref: 1.3.3 + url: https://github.com/Iconica-Development/flutter_shopping + ref: 1.0.0 + path: packages/flutter_product_page flutter_shopping_cart: git: - url: https://github.com/Iconica-Development/flutter_shopping_cart - ref: 1.1.1 + url: https://github.com/Iconica-Development/flutter_shopping + ref: 1.0.0 + path: packages/flutter_shopping_cart flutter_order_details: git: url: https://github.com/Iconica-Development/flutter_order_details diff --git a/packages/flutter_shopping/example_amazon/pubspec.yaml b/packages/flutter_shopping/example_amazon/pubspec.yaml index 6d51de9..47681db 100644 --- a/packages/flutter_shopping/example_amazon/pubspec.yaml +++ b/packages/flutter_shopping/example_amazon/pubspec.yaml @@ -1,7 +1,7 @@ name: amazon description: "A new Flutter project." publish_to: 'none' -version: 1.0.0+1 +version: 1.0.0 environment: sdk: '>=3.4.1 <4.0.0' @@ -18,12 +18,14 @@ dependencies: ref: 0.0.1 flutter_product_page: git: - url: https://github.com/Iconica-Development/flutter_product_page - ref: 1.3.3 + url: https://github.com/Iconica-Development/flutter_shopping + ref: 1.0.0 + path: packages/flutter_product_page flutter_shopping_cart: git: - url: https://github.com/Iconica-Development/flutter_shopping_cart - ref: 1.1.1 + url: https://github.com/Iconica-Development/flutter_shopping + ref: 1.0.0 + path: packages/flutter_shopping_cart flutter_order_details: git: url: https://github.com/Iconica-Development/flutter_order_details diff --git a/packages/flutter_shopping/pubspec.yaml b/packages/flutter_shopping/pubspec.yaml index e4c7983..1f79b2b 100644 --- a/packages/flutter_shopping/pubspec.yaml +++ b/packages/flutter_shopping/pubspec.yaml @@ -1,7 +1,7 @@ name: flutter_shopping description: "A new Flutter project." publish_to: 'none' # Remove this line if you wish to publish to pub.dev -version: 1.0.0+1 +version: 1.0.0 environment: sdk: '>=3.3.4 <4.0.0' @@ -12,12 +12,14 @@ dependencies: go_router: any flutter_product_page: git: - url: https://github.com/Iconica-Development/flutter_product_page - ref: 1.3.3 + url: https://github.com/Iconica-Development/flutter_shopping + ref: 1.0.0 + path: packages/flutter_product_page flutter_shopping_cart: git: - url: https://github.com/Iconica-Development/flutter_shopping_cart - ref: 1.1.1 + url: https://github.com/Iconica-Development/flutter_shopping + ref: 1.0.0 + path: packages/flutter_shopping_cart flutter_order_details: git: url: https://github.com/Iconica-Development/flutter_order_details diff --git a/packages/flutter_shopping_cart/example/.gitignore b/packages/flutter_shopping_cart/example/.gitignore deleted file mode 100644 index 8760a85..0000000 --- a/packages/flutter_shopping_cart/example/.gitignore +++ /dev/null @@ -1,53 +0,0 @@ -# Miscellaneous -*.class -*.log -*.pyc -*.swp -.DS_Store -.atom/ -.buildlog/ -.history -.svn/ -migrate_working_dir/ - -# IntelliJ related -*.iml -*.ipr -*.iws -.idea/ - -# The .vscode folder contains launch configuration and tasks you configure in -# VS Code which you may wish to be included in version control, so this line -# is commented out by default. -.vscode/ - -# Flutter/Dart/Pub related -**/doc/api/ -**/ios/Flutter/.last_build_id -.dart_tool/ -.flutter-plugins -.flutter-plugins-dependencies -.pub-cache/ -.pub/ -/build/ -.metadata -pubspec.lock - -# Symbolication related -app.*.symbols - -# Obfuscation related -app.*.map.json - -# Android Studio will place build artifacts here -/android/app/debug -/android/app/profile -/android/app/release - -# Platforms -/android/ -/ios/ -/linux/ -/macos/ -/web/ -/windows/ diff --git a/packages/flutter_shopping_cart/example/README.md b/packages/flutter_shopping_cart/example/README.md deleted file mode 100644 index 2b3fce4..0000000 --- a/packages/flutter_shopping_cart/example/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# example - -A new Flutter project. - -## Getting Started - -This project is a starting point for a Flutter application. - -A few resources to get you started if this is your first Flutter project: - -- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) -- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) - -For help getting started with Flutter development, view the -[online documentation](https://docs.flutter.dev/), which offers tutorials, -samples, guidance on mobile development, and a full API reference. diff --git a/packages/flutter_shopping_cart/example/analysis_options.yaml b/packages/flutter_shopping_cart/example/analysis_options.yaml deleted file mode 100644 index 31b4b51..0000000 --- a/packages/flutter_shopping_cart/example/analysis_options.yaml +++ /dev/null @@ -1,9 +0,0 @@ -include: package:flutter_iconica_analysis/analysis_options.yaml - -# Possible to overwrite the rules from the package - -analyzer: - exclude: - -linter: - rules: diff --git a/packages/flutter_shopping_cart/example/lib/configuration/shopping_cart_configuration.dart b/packages/flutter_shopping_cart/example/lib/configuration/shopping_cart_configuration.dart deleted file mode 100644 index b37ec8a..0000000 --- a/packages/flutter_shopping_cart/example/lib/configuration/shopping_cart_configuration.dart +++ /dev/null @@ -1,125 +0,0 @@ -import "dart:math"; - -import "package:flutter/foundation.dart"; -import "package:flutter/material.dart"; -import "package:flutter_shopping_cart/flutter_shopping_cart.dart"; -import "package:flutter_shopping_cart_example/models/example_product.dart"; - -ShoppingCartConfig getShoppingCartConfiguration( - BuildContext ctx, - ProductService productService, -) => - ShoppingCartConfig( - // (REQUIRED) product service instance: - productService: productService, - - // (REQUIRED) product item builder: - productItemBuilder: ( - BuildContext context, - Locale locale, - ExampleProduct product, - ) => - ListTile( - title: Text(product.name), - subtitle: Text(product.price.toStringAsFixed(2)), - trailing: Row( - mainAxisSize: MainAxisSize.min, - children: [ - IconButton( - icon: const Icon(Icons.remove), - onPressed: () => productService.removeOneProduct(product), - ), - Text("${product.quantity}"), - IconButton( - icon: const Icon(Icons.add), - onPressed: () => productService.addProduct(product), - ), - ], - ), - ), - - // (OPTIONAL/REQUIRED) on confirm order callback: - // Either use this callback or the placeOrderButtonBuilder. - onConfirmOrder: (List products) { - if (kDebugMode) { - print("Placing order with products: $products"); - } - }, - - // (OPTIONAL/REQUIRED) place order button height: - // Either use this or the onConfirmOrder callback. - // confirmOrderButtonBuilder: (context) => ElevatedButton( - // onPressed: () { - // print("meow!"); - // }, - // child: Text("Place Order"), - // ), - - // (OPTIONAL) (RECOMMENDED) localizations: - localizations: ShoppingCartLocalizations( - placeOrder: "BESTEL", - sum: "Te betalen", - locale: Localizations.localeOf(ctx), - ), - - // (OPTIONAL) title above product list: - title: "Producten", - - // (OPTIONAL) custom title builder: - // titleBuilder: (context) => Text("Products"), - - // (OPTIONAL) padding around the shopping cart: - padding: const EdgeInsets.symmetric(horizontal: 32), - - // (OPTIONAL) bottom padding of the shopping cart: - bottomPadding: const EdgeInsets.fromLTRB(44, 0, 44, 32), - - // (OPTIONAL) sum bottom sheet builder: - // sumBottomSheetBuilder: (context) => Container(...), - - /// (OPTIONAL) no content builder for when there are no products - /// in the shopping cart. - noContentBuilder: (context) => const Center( - child: Padding( - padding: EdgeInsets.symmetric(vertical: 128), - child: Column( - children: [ - Icon( - Icons.warning, - ), - SizedBox( - height: 16, - ), - Text( - "Geen producten in winkelmandje", - ), - ], - ), - ), - ), - - // (OPTIONAL) custom appbar: - appBar: AppBar( - title: const Text("Shopping Cart"), - actions: [ - IconButton( - icon: const Icon(Icons.delete), - onPressed: productService.clear, - ), - IconButton( - onPressed: () { - var random = Random(); - productService.addProduct( - ExampleProduct( - name: "Example Product", - price: 100, - image: "https://via.placeholder.com/150", - id: "example_product_id${random.nextInt(100000)}", - ), - ); - }, - icon: const Icon(Icons.add), - ), - ], - ), - ); diff --git a/packages/flutter_shopping_cart/example/lib/main.dart b/packages/flutter_shopping_cart/example/lib/main.dart deleted file mode 100644 index 0591f3b..0000000 --- a/packages/flutter_shopping_cart/example/lib/main.dart +++ /dev/null @@ -1,48 +0,0 @@ -import "package:flutter/material.dart"; -import "package:flutter_localizations/flutter_localizations.dart"; -import "package:flutter_shopping_cart/flutter_shopping_cart.dart"; -import "package:flutter_shopping_cart_example/configuration/shopping_cart_configuration.dart"; -import "package:flutter_shopping_cart_example/models/example_product.dart"; - -void main() { - runApp(const MyApp()); -} - -class MyApp extends StatelessWidget { - const MyApp({super.key}); - - @override - Widget build(BuildContext context) => MaterialApp( - theme: ThemeData( - colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), - useMaterial3: true, - ), - localizationsDelegates: const [ - GlobalMaterialLocalizations.delegate, - GlobalWidgetsLocalizations.delegate, - GlobalCupertinoLocalizations.delegate, - ], - supportedLocales: const [ - Locale("nl", "NL"), - ], - home: const Scaffold( - body: _ShoppingCartScreen(), - ), - ); -} - -class _ShoppingCartScreen extends StatelessWidget { - const _ShoppingCartScreen(); - - @override - Widget build(BuildContext context) { - var productService = ProductService([]); - - return ShoppingCartScreen( - configuration: getShoppingCartConfiguration( - context, - productService, - ), - ); - } -} diff --git a/packages/flutter_shopping_cart/example/lib/models/example_product.dart b/packages/flutter_shopping_cart/example/lib/models/example_product.dart deleted file mode 100644 index 4a7f24b..0000000 --- a/packages/flutter_shopping_cart/example/lib/models/example_product.dart +++ /dev/null @@ -1,13 +0,0 @@ -import "package:flutter_shopping_cart/flutter_shopping_cart.dart"; - -class ExampleProduct extends ShoppingCartProduct { - ExampleProduct({ - required super.name, - required super.price, - required this.image, - super.quantity, - super.id = "example_product_id", - }); - - final String image; -} diff --git a/packages/flutter_shopping_cart/example/pubspec.yaml b/packages/flutter_shopping_cart/example/pubspec.yaml deleted file mode 100644 index 51e70f7..0000000 --- a/packages/flutter_shopping_cart/example/pubspec.yaml +++ /dev/null @@ -1,34 +0,0 @@ -name: flutter_shopping_cart_example -description: "Demonstrates how to use the flutter_shopping_cart package." -publish_to: 'none' - -environment: - sdk: '>=3.3.0 <4.0.0' - -dependencies: - flutter: - sdk: flutter - flutter_localizations: - sdk: flutter - flutter_shopping_cart: - path: ../ - -dev_dependencies: - flutter_test: - sdk: flutter - flutter_iconica_analysis: - git: - url: https://github.com/Iconica-Development/flutter_iconica_analysis - ref: 7.0.0 - -flutter: - uses-material-design: true - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic