Status
The Status card displays the user's current Flex status and opens the Embedded Checkout when tapped.
Initialization
Import and render FlexStatusCard in your widget tree.
DART
import 'package:flex_checkout_flutter/flex_checkout_flutter.dart';
import 'package:flutter/material.dart' hide Flex;
class StatusScreen extends StatelessWidget {
const StatusScreen({super.key});
Widget build(BuildContext context) {
return const Center(
child: FlexStatusCard(),
);
}
}
info
When the Status card CTA is tapped, it automatically opens checkout. Make sure you have registered a token provider with sdk.loadToken and configured checkout callbacks with sdk.checkout before rendering the card.
DART
final sdk = await Flex.initialize(
const FlexConfig(clientId: 'your-flex-client-id'),
);
sdk.loadToken(() async {
final response = await yourApi.getFlexToken();
return response.token;
});
sdk.checkout(CheckoutConfig(
onEvent: (event) {},
));
Options
| Parameter | Type | Description |
|---|---|---|
height | double | Height of the card in logical pixels. Defaults to 210. |
visible | bool | Whether the card is visible. Defaults to true. When false, the widget reserves the same space but the native view is hidden. |
DART
const FlexStatusCard(height: 240, visible: true);
Next Steps
- Configure Checkout callbacks to handle events and errors
- Review the Installation guide for lifecycle management and error handling