error handle

This commit is contained in:
2025-02-03 19:04:28 +05:30
parent 5006eef68d
commit 58100e0b42
3 changed files with 11 additions and 6 deletions

View File

@@ -992,7 +992,7 @@
"languageVersion": "3.4"
}
],
"generated": "2025-02-03T13:28:33.681422Z",
"generated": "2025-02-03T13:34:10.143808Z",
"generator": "pub",
"generatorVersion": "3.4.4",
"flutterRoot": "file:///Users/rajeevsingh/Documents/allSoftwares/flutter",

File diff suppressed because one or more lines are too long

View File

@@ -63,11 +63,16 @@ class _PaymentWebViewState extends State<PaymentWebView> {
},
onLoadStop: (controller, url) async {
print("Payment page loaded: $url");
// ✅ Check if payment is successful
if (url.toString().contains("success")) {
Navigator.pop(context, true); // Send success result
} else if (url.toString().contains("failure")) {
Navigator.pop(context, false); // Send failure result
}
},
onReceivedHttpError: (controller, request, response)
{
if (response.statusCode == 404)
{
onReceivedHttpError: (controller, request, response) {
if (response.statusCode == 404) {
setState(() {
isErrorPage = true;
});