Post

Replies

Boosts

Views

Activity

Reply to Apple Pay
[quote='838060022, Geeta_sharma, /thread/783285?answerId=838060022#838060022, /profile/Geeta_sharma'] I have write code for this still not Apear Apple Pay Button [/quote] [quote='838060022, Geeta_sharma, /thread/783285?answerId=838060022#838060022, /profile/Geeta_sharma'] I have write code for this [/quote] [quote='838060022, Geeta_sharma, /thread/783285?answerId=838060022#838060022, /profile/Geeta_sharma'] child [/quote]
Topic: UI Frameworks SubTopic: General Tags:
May ’25
Reply to Apple Pay
I have write code for this late Future _applePayConfig; _applePayConfig = PaymentConfiguration.fromAsset('apple_payment.json'); if (platform == TargetPlatform.iOS) FutureBuilder( future: _applePayConfig, // Ensure this future is correctly initialized builder: (context, snapshot) { print('Apple Pay snapshot: ${snapshot.connectionState}'); print('Apple Pay snapshot error: ${snapshot.error}'); print('Apple Pay snapshot data: ${snapshot.data}'); if (snapshot.connectionState == ConnectionState.done) { if (snapshot.hasData) { return Container( margin: const EdgeInsets.symmetric(horizontal: 5), // 20 left and right width: double.infinity, // Make it take full width (minus margin) child: ApplePayButton( paymentConfiguration: snapshot.data!, paymentItems: const [ PaymentItem( label: 'Total', amount: '10.00', status: PaymentItemStatus.final_price, ), ], type: ApplePayButtonType.buy, onPaymentResult: (result) { print('Apple Pay RESULT: $result'); _showMessage('Apple Pay result received. Check console.'); }, loadingIndicator: const Center( child: CircularProgressIndicator(), ), onError: (error) { print('Apple Pay Error: $error'); _showMessage('Apple Pay Error'); }, ), ); } else { return const Text('Apple Pay Configuration Failed'); } } return const CircularProgressIndicator(); }, ),
Topic: UI Frameworks SubTopic: General Tags:
May ’25