import 'package:crossmint_flutter/crossmint_flutter_ui.dart';
class CheckoutScreen extends StatefulWidget {
const CheckoutScreen({super.key});
@override
State<CheckoutScreen> createState() => _CheckoutScreenState();
}
class _CheckoutScreenState extends State<CheckoutScreen> {
final _controller = CrossmintCheckoutController();
@override
Widget build(BuildContext context) {
return Scaffold(
body: CrossmintEmbeddedCheckout(
apiKey: 'YOUR_CLIENT_API_KEY',
config: CrossmintCheckoutConfig(
order: CrossmintCheckoutNewOrder.typed(
lineItems: [
CrossmintCheckoutLineItem.collection(
collectionLocator: 'crossmint:YOUR_COLLECTION_ID',
),
],
),
payment: CrossmintCheckoutPayment(
fiat: CrossmintCheckoutFiatPayment(enabled: true),
crypto: CrossmintCheckoutCryptoPayment(enabled: true),
),
),
checkoutController: _controller,
onOrderUpdated: (order) {
debugPrint('Order updated: ${order['status']}');
},
),
);
}
}