[ad_1]
I am working Flutter Stripe with this library : https://pub.dev/packages/flutter_stripe.
That is the operate from my bloc to create efficiently fee intent and show the fee sheet.
paymentSink.add(Standing.Loading);
logData(key, 'Stripe Pay');
//create fee intent
var response = await paymentRepository.createPaymentIntent(200, 'USD');
paymentSink.add(Standing.Profitable);
var paymentIntentData = json.decode(response.physique);
await stripe.initPaymentSheet(
paymentSheetParameters: SetupPaymentSheetParameters(
applePay: true,
googlePay: true,
model: ThemeMode.darkish,
testEnv: true,
merchantDisplayName: 'Flutter Stripe Retailer Demo',
customerId: paymentIntentData!['customer'],
paymentIntentClientSecret: paymentIntentData['client_secret'],
customerEphemeralKeySecret: paymentIntentData['ephemeralKey'],
));
//show fee sheet
await displayPaymentSheet();
if(isSuccessPaid){
logData(key, 'isSuccessPaid: $isSuccessPaid');
//deal with outcome after fee efficiently
}
and that is the show fee sheet operate
attempt {
await stripe.presentPaymentSheet().then((worth) {
isSuccessPaid = true;
}).onError((error, stackTrace){
GetIt.I<AppSnackBar>().present(error.toString());
logData(key,error.toString());
});
} catch (e) {
GetIt.I<AppSnackBar>().present(e.toString());
logData(key, '$e');
}
The issue is Android simulator works completely like this
however the IOS simulator cannot show it and the terminal exhibits the errors like this

I do not know that is the platform error or simply the simulator drawback.Anybody acquired drawback like this?Please assist.Thanks!
[ad_2]

