mirror of
https://github.com/Iconica-Development/flutter_shopping.git
synced 2025-05-19 08:53:46 +02:00
44 lines
1.5 KiB
Dart
44 lines
1.5 KiB
Dart
import "package:flutter/material.dart";
|
|
import "package:flutter_order_details/flutter_order_details.dart";
|
|
|
|
/// Configuration class for the flutter_shopping user-story.
|
|
class FlutterShoppingConfiguration {
|
|
/// Constructor for the FlutterShoppingConfiguration.
|
|
const FlutterShoppingConfiguration({
|
|
required this.shopBuilder,
|
|
required this.shoppingCartBuilder,
|
|
required this.onCompleteUserStory,
|
|
this.orderDetailsBuilder,
|
|
this.onCompleteOrderDetails,
|
|
this.orderSuccessBuilder,
|
|
this.orderFailedBuilder,
|
|
});
|
|
|
|
/// Builder for the shop/product page.
|
|
final Widget Function(
|
|
BuildContext context,
|
|
String? initialBuildShopId,
|
|
String? streetName,
|
|
) shopBuilder;
|
|
|
|
/// Builder for the shopping cart page.
|
|
final Widget Function(BuildContext context) shoppingCartBuilder;
|
|
|
|
/// Function that is called when the user-story is completed.
|
|
final Function(BuildContext context) onCompleteUserStory;
|
|
|
|
/// Builder for the order details page. This does not have to be set if you
|
|
/// are using the default order details page.
|
|
final Widget Function(BuildContext context)? orderDetailsBuilder;
|
|
|
|
/// Allows you to execute actions before
|
|
final Future<bool> Function(BuildContext context, OrderResult result)?
|
|
onCompleteOrderDetails;
|
|
|
|
/// Builder for when the order is successful.
|
|
final Widget Function(BuildContext context)? orderSuccessBuilder;
|
|
|
|
/// Builder for when the order failed.
|
|
final Widget Function(BuildContext context)? orderFailedBuilder;
|
|
}
|