checkout static method

Future<CheckoutResponse> checkout(
  1. BuildContext context, {
  2. required Charge charge,
  3. bool fullscreen = false,
  4. bool hideEmail = false,
  5. bool hideAmount = false,
})

Implementation

static Future<CheckoutResponse> checkout(
  BuildContext context, {
  required Charge charge,
  bool fullscreen = false,
  Widget? logo,
  bool hideEmail = false,
  bool hideAmount = false,
}) async {
  if (_publicKey == null || _publicKey!.isEmpty) {
    throw PlatformException(
      code: 'not-initialized',
      message: 'You are yet to initialize FlutterPaystackClient',
    );
  }

  if (kIsWeb) return _web.checkout(charge, _publicKey!);

  return _plugin.checkout(
    context,
    charge: charge,
    fullscreen: fullscreen,
    logo: logo,
    hideEmail: hideEmail,
    hideAmount: hideAmount,
    method: CheckoutMethod.card,
  );
}