You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Additional Context **
When i view call stack in vscode it's keep flashing 2-3 call back while the app is in webview .
The text was updated successfully, but these errors were encountered:
aabhik-coder
changed the title
Payment Screen Freezes on loading screen on webview
Webview screen freezes loading gif while initiating payment
Aug 7, 2024
Describe the bug
After initiating payment the webview launch then, the khalti loading start and stuck(freezes) .
To Reproduce
import 'dart:developer';
import 'package:flutter/material.dart';
import 'package:khalti_checkout_flutter/khalti_checkout_flutter.dart';
void main() {
runApp(
const MaterialApp(
home: KhaltiSDKDemo(),
),
);
}
class KhaltiSDKDemo extends StatefulWidget {
const KhaltiSDKDemo({super.key});
@OverRide
State createState() => _KhaltiSDKDemoState();
}
class _KhaltiSDKDemoState extends State {
late final Future<Khalti?> khalti;
String pidx =
'PIDX';
PaymentResult? paymentResult;
@OverRide
void initState() {
super.initState();
final payConfig = KhaltiPayConfig(
publicKey:
'testID"
pidx: pidx,
environment: Environment.test,
);
}
@OverRide
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: FutureBuilder(
future: khalti,
initialData: null,
builder: (context, snapshot) {
final khaltiSnapshot = snapshot.data;
if (khaltiSnapshot == null) {
return const CircularProgressIndicator.adaptive();
}
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const SizedBox(height: 120),
const Text(
'Rs. 22',
style: TextStyle(fontSize: 25),
),
const Text('1 day fee'),
OutlinedButton(
onPressed: () => khaltiSnapshot.open(context),
child: const Text('Pay with Khalti'),
),
const SizedBox(height: 120),
paymentResult == null
? Text(
'pidx: $pidx',
style: const TextStyle(fontSize: 15),
)
: Column(
children: [
Text(
'pidx: ${paymentResult!.payload?.pidx}',
),
Text('Status: ${paymentResult!.payload?.status}'),
Text(
'Amount Paid: ${paymentResult!.payload?.totalAmount}',
),
Text(
'Transaction ID: ${paymentResult!.payload?.transactionId}',
),
],
),
const SizedBox(height: 120),
const Text(
'This is a demo application developed by some merchant.',
style: TextStyle(fontSize: 12),
)
],
);
},
),
),
);
}
}
Expected behavior
Initiate payment by launching webview and ask for khalti Id .
Device Information (please complete the following information):
Screenshots
https://github.com/user-attachments/assets/574f9139-bb2c-4148-9f8f-eff1c767ae43
**Additional Context **
When i view call stack in vscode it's keep flashing 2-3 call back while the app is in webview .
The text was updated successfully, but these errors were encountered: