feat: remove example apps

This commit is contained in:
Freek van de Ven 2024-06-26 15:36:28 +02:00
parent 5082dab216
commit bafa7cd0a0
28 changed files with 23 additions and 943 deletions

View file

@ -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/

View file

@ -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.

View file

@ -1,9 +0,0 @@
include: package:flutter_iconica_analysis/analysis_options.yaml
# Possible to overwrite the rules from the package
analyzer:
exclude:
linter:
rules:

View file

@ -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<FormState>(),
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<FormState>(),
fields: [
OrderDropdownInput<String>(
// 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<FormState>(),
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<FormState>(),
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",
),
),
);

View file

@ -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(),
),
);
}

View file

@ -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),
),
),
);

View file

@ -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

View file

@ -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'

View file

@ -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/

View file

@ -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.

View file

@ -1,9 +0,0 @@
include: package:flutter_iconica_analysis/analysis_options.yaml
# Possible to overwrite the rules from the package
analyzer:
exclude:
linter:
rules:

View file

@ -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<MyShop> shops,
required List<MyProduct> 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>(
() => 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",
),
),
);

View file

@ -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,
),
),
);
}
}

View file

@ -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;
}

View file

@ -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,
});
}

View file

@ -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),
),
),
);

View file

@ -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

View file

@ -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'

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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/

View file

@ -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.

View file

@ -1,9 +0,0 @@
include: package:flutter_iconica_analysis/analysis_options.yaml
# Possible to overwrite the rules from the package
analyzer:
exclude:
linter:
rules:

View file

@ -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<ExampleProduct> getShoppingCartConfiguration(
BuildContext ctx,
ProductService<ExampleProduct> productService,
) =>
ShoppingCartConfig<ExampleProduct>(
// (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<ExampleProduct> 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),
),
],
),
);

View file

@ -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<ExampleProduct>([]);
return ShoppingCartScreen<ExampleProduct>(
configuration: getShoppingCartConfiguration(
context,
productService,
),
);
}
}

View file

@ -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;
}

View file

@ -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