diff --git a/lib/di.dart b/lib/di.dart index 0e4eb2a1a..76813f475 100644 --- a/lib/di.dart +++ b/lib/di.dart @@ -1,7 +1,6 @@ import 'package:cake_wallet/anonpay/anonpay_api.dart'; import 'package:cake_wallet/anonpay/anonpay_info_base.dart'; import 'package:cake_wallet/anonpay/anonpay_invoice_info.dart'; -import 'package:cake_wallet/buy/moonpay/moonpay_buy_provider.dart'; import 'package:cake_wallet/buy/onramper/onramper_buy_provider.dart'; import 'package:cake_wallet/buy/payfura/payfura_buy_provider.dart'; import 'package:cake_wallet/core/yat_service.dart'; @@ -14,7 +13,6 @@ import 'package:cake_wallet/ionia/ionia_tip.dart'; import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/src/screens/anonpay_details/anonpay_details_page.dart'; import 'package:cake_wallet/src/screens/buy/webview_page.dart'; -import 'package:cake_wallet/src/screens/buy/payfura_page.dart'; import 'package:cake_wallet/src/screens/dashboard/desktop_dashboard_page.dart'; import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_sidebar_wrapper.dart'; import 'package:cake_wallet/src/screens/dashboard/desktop_widgets/desktop_wallet_selection_dropdown.dart'; @@ -685,8 +683,6 @@ Future setup({ wallet: getIt.get().wallet!, )); - getIt.registerFactory(() => PayFuraPage(getIt.get())); - getIt.registerFactory(() => ExchangeViewModel( getIt.get().wallet!, _tradesSource, diff --git a/lib/entities/main_actions.dart b/lib/entities/main_actions.dart index 5fb46d1d8..0cf3cead4 100644 --- a/lib/entities/main_actions.dart +++ b/lib/entities/main_actions.dart @@ -1,12 +1,10 @@ import 'package:cake_wallet/buy/moonpay/moonpay_buy_provider.dart'; import 'package:cake_wallet/buy/onramper/onramper_buy_provider.dart'; -import 'package:cake_wallet/buy/payfura/payfura_buy_provider.dart'; import 'package:cake_wallet/di.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/routes.dart'; import 'package:cake_wallet/src/widgets/alert_with_one_action.dart'; import 'package:cake_wallet/utils/device_info.dart'; -import 'package:cake_wallet/utils/responsive_layout_util.dart'; import 'package:cake_wallet/utils/show_pop_up.dart'; import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart'; import 'package:cw_core/wallet_type.dart'; @@ -60,12 +58,9 @@ class MainActions { break; case WalletType.monero: if (viewModel.isEnabledBuyAction) { - if (DeviceInfo.instance.isMobile) { - Navigator.of(context).pushNamed(Routes.payfuraPage); - } else { - final uri = getIt.get().requestUrl(); - await launchUrl(uri); - } + // final uri = getIt.get().requestUrl(); + final uri = Uri.parse("https://monero.com/trade"); + await launchUrl(uri); } break; default: diff --git a/lib/router.dart b/lib/router.dart index ecb4f72c4..39dd75628 100644 --- a/lib/router.dart +++ b/lib/router.dart @@ -9,7 +9,6 @@ import 'package:cake_wallet/src/screens/backup/backup_page.dart'; import 'package:cake_wallet/src/screens/backup/edit_backup_password_page.dart'; import 'package:cake_wallet/src/screens/buy/buy_webview_page.dart'; import 'package:cake_wallet/src/screens/buy/webview_page.dart'; -import 'package:cake_wallet/src/screens/buy/payfura_page.dart'; import 'package:cake_wallet/src/screens/buy/pre_order_page.dart'; import 'package:cake_wallet/src/screens/restore/sweeping_wallet_page.dart'; import 'package:cake_wallet/src/screens/receive/anonpay_invoice_page.dart'; @@ -97,8 +96,6 @@ import 'package:cake_wallet/ionia/ionia_any_pay_payment_info.dart'; import 'package:cw_core/crypto_currency.dart'; import 'package:cw_core/node.dart'; -import 'buy/moonpay/moonpay_buy_provider.dart'; - late RouteSettings currentRouteSettings; Route createRoute(RouteSettings settings) { @@ -528,9 +525,6 @@ Route createRoute(RouteSettings settings) { param1: title, param2: url)); - case Routes.payfuraPage: - return CupertinoPageRoute(builder: (_) => getIt.get()); - case Routes.advancedPrivacySettings: final type = settings.arguments as WalletType; diff --git a/lib/routes.dart b/lib/routes.dart index 10c2fef57..a7a50c433 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -81,7 +81,6 @@ class Routes { static const anonPayInvoicePage = '/anon_pay_invoice_page'; static const anonPayReceivePage = '/anon_pay_receive_page'; static const anonPayDetailsPage = '/anon_pay_details_page'; - static const payfuraPage = '/pay_fura_page'; static const desktop_actions = '/desktop_actions'; static const transactionsPage = '/transactions_page'; static const setup_2faPage = '/setup_2fa_page'; diff --git a/lib/src/screens/buy/payfura_page.dart b/lib/src/screens/buy/payfura_page.dart deleted file mode 100644 index a974aec25..000000000 --- a/lib/src/screens/buy/payfura_page.dart +++ /dev/null @@ -1,58 +0,0 @@ -import 'package:cake_wallet/buy/payfura/payfura_buy_provider.dart'; -import 'package:cake_wallet/generated/i18n.dart'; -import 'package:cake_wallet/src/screens/base_page.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_inappwebview/flutter_inappwebview.dart'; -import 'package:permission_handler/permission_handler.dart'; - -class PayFuraPage extends BasePage { - PayFuraPage(this._PayfuraBuyProvider); - - final PayfuraBuyProvider _PayfuraBuyProvider; - - @override - String get title => S.current.buy; - - @override - Widget body(BuildContext context) { - return PayFuraPageBody(_PayfuraBuyProvider); - } -} - -class PayFuraPageBody extends StatefulWidget { - PayFuraPageBody(this._PayfuraBuyProvider); - - final PayfuraBuyProvider _PayfuraBuyProvider; - - Uri get uri => _PayfuraBuyProvider.requestUrl(); - - @override - PayFuraPageBodyState createState() => PayFuraPageBodyState(); -} - -class PayFuraPageBodyState extends State { - PayFuraPageBodyState(); - - @override - Widget build(BuildContext context) { - return InAppWebView( - initialOptions: InAppWebViewGroupOptions( - crossPlatform: InAppWebViewOptions(transparentBackground: true), - ), - initialUrlRequest: URLRequest(url: widget.uri), - androidOnPermissionRequest: (_, __, resources) async { - bool permissionGranted = await Permission.camera.status == PermissionStatus.granted; - if (!permissionGranted) { - permissionGranted = await Permission.camera.request().isGranted; - } - - return PermissionRequestResponse( - resources: resources, - action: permissionGranted - ? PermissionRequestResponseAction.GRANT - : PermissionRequestResponseAction.DENY, - ); - }, - ); - } -}