mirror of
https://github.com/Iconica-Development/flutter_shopping.git
synced 2025-05-19 17:03:45 +02:00
40 lines
1.4 KiB
Dart
40 lines
1.4 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) 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;
|
||
|
}
|