fixing android build
This commit is contained in:
@@ -3,7 +3,7 @@ import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:qpay/models/responsive_policy.dart';
|
||||
import 'package:qpay/screens/gateway/gateway_controller.dart';
|
||||
import 'package:web/web.dart' as web;
|
||||
import 'package:qpay/browser.dart';
|
||||
|
||||
class GatewayWebScreen extends StatefulWidget {
|
||||
const GatewayWebScreen({super.key});
|
||||
@@ -50,7 +50,7 @@ class _GatewayWebScreenState extends State<GatewayWebScreen> {
|
||||
final transactionId =
|
||||
controller.transactionController.model.confirmationData['id'];
|
||||
if (transactionId != null) {
|
||||
web.window.localStorage.setItem(
|
||||
Browser.localStorage.setItem(
|
||||
'pendingTransactionId',
|
||||
transactionId.toString(),
|
||||
);
|
||||
@@ -60,7 +60,7 @@ class _GatewayWebScreenState extends State<GatewayWebScreen> {
|
||||
// After payment, the gateway will redirect back to this app's host.
|
||||
// index.html then reads the saved transaction ID and navigates to
|
||||
// /poll/:id so the app can immediately start polling for the result.
|
||||
web.window.location.href = url;
|
||||
Browser.location.href = url;
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -5,7 +5,7 @@ import 'package:provider/provider.dart';
|
||||
import 'package:qpay/screens/gateway/gateway_controller.dart';
|
||||
import 'package:qpay/screens/transaction_controller.dart';
|
||||
import 'package:qpay/widgets/step_loading_widget.dart';
|
||||
import 'package:web/web.dart' as web;
|
||||
import 'package:qpay/browser.dart';
|
||||
|
||||
class PollScreen extends StatefulWidget {
|
||||
final String? transactionId;
|
||||
@@ -39,8 +39,8 @@ class _PollScreenState extends State<PollScreen> {
|
||||
// Priority 2: localStorage (for when gateway redirect causes page reload
|
||||
// and the route param path is not available due to hub redirect override)
|
||||
if (transactionId == null && kIsWeb) {
|
||||
transactionId = web.window.localStorage.getItem('pendingTransactionId');
|
||||
web.window.localStorage.removeItem('pendingTransactionId');
|
||||
transactionId = Browser.localStorage.getItem('pendingTransactionId');
|
||||
Browser.localStorage.removeItem('pendingTransactionId');
|
||||
}
|
||||
|
||||
// Priority 3: in-memory confirmation data (normal SPA navigation)
|
||||
|
||||
Reference in New Issue
Block a user