From f6699d97ed89b7a6ef0eb3d1b6c681c2be6107ee Mon Sep 17 00:00:00 2001 From: Kirill Bubochkin Date: Fri, 26 Jan 2024 23:37:05 +0100 Subject: [PATCH] refactor: update ramp structure (#1251) --- .../coinflow/data/coinflow_api_client.dart | 2 +- .../services/coinflow_off_ramp_order_watcher.dart | 8 ++++---- .../coinflow/widgets/launch.dart} | 2 +- .../guardarian/widgets/launch.dart} | 2 +- .../ramp/{ => partners}/kado/data/kado_api_client.dart | 2 +- .../kado/services/kado_off_ramp_order_watcher.dart | 6 +++--- .../kado/services/kado_on_ramp_order_watcher.dart | 8 ++++---- .../kado.dart => partners/kado/widgets/launch.dart} | 8 ++++---- .../ramp_network/widgets/launch.dart} | 2 +- .../{ => partners}/scalex/data/scalex_repository.dart | 2 +- .../scalex/services/scalex_off_ramp_order_watcher.dart | 6 +++--- .../scalex/services/scalex_on_ramp_order_watcher.dart | 6 +++--- .../scalex/widgets/launch.dart} | 8 ++++---- .../features/ramp/services/off_ramp_order_service.dart | 6 +++--- .../features/ramp/widgets/on_ramp_order_details.dart | 4 ++-- .../lib/features/ramp/widgets/ramp_buttons.dart | 10 +++++----- 16 files changed, 41 insertions(+), 41 deletions(-) rename packages/espressocash_app/lib/features/ramp/{ => partners}/coinflow/data/coinflow_api_client.dart (97%) rename packages/espressocash_app/lib/features/ramp/{ => partners}/coinflow/services/coinflow_off_ramp_order_watcher.dart (90%) rename packages/espressocash_app/lib/features/ramp/{src/widgets/partners/coinflow.dart => partners/coinflow/widgets/launch.dart} (99%) rename packages/espressocash_app/lib/features/ramp/{src/widgets/partners/guardarian.dart => partners/guardarian/widgets/launch.dart} (95%) rename packages/espressocash_app/lib/features/ramp/{ => partners}/kado/data/kado_api_client.dart (98%) rename packages/espressocash_app/lib/features/ramp/{ => partners}/kado/services/kado_off_ramp_order_watcher.dart (92%) rename packages/espressocash_app/lib/features/ramp/{ => partners}/kado/services/kado_on_ramp_order_watcher.dart (92%) rename packages/espressocash_app/lib/features/ramp/{src/widgets/partners/kado.dart => partners/kado/widgets/launch.dart} (96%) rename packages/espressocash_app/lib/features/ramp/{src/widgets/partners/ramp_network.dart => partners/ramp_network/widgets/launch.dart} (95%) rename packages/espressocash_app/lib/features/ramp/{ => partners}/scalex/data/scalex_repository.dart (96%) rename packages/espressocash_app/lib/features/ramp/{ => partners}/scalex/services/scalex_off_ramp_order_watcher.dart (91%) rename packages/espressocash_app/lib/features/ramp/{ => partners}/scalex/services/scalex_on_ramp_order_watcher.dart (91%) rename packages/espressocash_app/lib/features/ramp/{src/widgets/partners/scalex.dart => partners/scalex/widgets/launch.dart} (97%) diff --git a/packages/espressocash_app/lib/features/ramp/coinflow/data/coinflow_api_client.dart b/packages/espressocash_app/lib/features/ramp/partners/coinflow/data/coinflow_api_client.dart similarity index 97% rename from packages/espressocash_app/lib/features/ramp/coinflow/data/coinflow_api_client.dart rename to packages/espressocash_app/lib/features/ramp/partners/coinflow/data/coinflow_api_client.dart index dd70c51576..6fc8ecd256 100644 --- a/packages/espressocash_app/lib/features/ramp/coinflow/data/coinflow_api_client.dart +++ b/packages/espressocash_app/lib/features/ramp/partners/coinflow/data/coinflow_api_client.dart @@ -5,7 +5,7 @@ import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:injectable/injectable.dart'; import 'package:retrofit/retrofit.dart'; -import '../../../../config.dart'; +import '../../../../../config.dart'; part 'coinflow_api_client.freezed.dart'; part 'coinflow_api_client.g.dart'; diff --git a/packages/espressocash_app/lib/features/ramp/coinflow/services/coinflow_off_ramp_order_watcher.dart b/packages/espressocash_app/lib/features/ramp/partners/coinflow/services/coinflow_off_ramp_order_watcher.dart similarity index 90% rename from packages/espressocash_app/lib/features/ramp/coinflow/services/coinflow_off_ramp_order_watcher.dart rename to packages/espressocash_app/lib/features/ramp/partners/coinflow/services/coinflow_off_ramp_order_watcher.dart index 21bdd3f9a5..95b61e576d 100644 --- a/packages/espressocash_app/lib/features/ramp/coinflow/services/coinflow_off_ramp_order_watcher.dart +++ b/packages/espressocash_app/lib/features/ramp/partners/coinflow/services/coinflow_off_ramp_order_watcher.dart @@ -7,10 +7,10 @@ import 'package:injectable/injectable.dart'; import 'package:rxdart/rxdart.dart'; import 'package:solana/encoder.dart'; -import '../../../../data/db/db.dart'; -import '../../../accounts/models/ec_wallet.dart'; -import '../../data/my_database_ext.dart'; -import '../../src/models/ramp_watcher.dart'; +import '../../../../../data/db/db.dart'; +import '../../../../accounts/models/ec_wallet.dart'; +import '../../../data/my_database_ext.dart'; +import '../../../src/models/ramp_watcher.dart'; import '../data/coinflow_api_client.dart'; @injectable diff --git a/packages/espressocash_app/lib/features/ramp/src/widgets/partners/coinflow.dart b/packages/espressocash_app/lib/features/ramp/partners/coinflow/widgets/launch.dart similarity index 99% rename from packages/espressocash_app/lib/features/ramp/src/widgets/partners/coinflow.dart rename to packages/espressocash_app/lib/features/ramp/partners/coinflow/widgets/launch.dart index dd7d3b3041..016fe73a54 100644 --- a/packages/espressocash_app/lib/features/ramp/src/widgets/partners/coinflow.dart +++ b/packages/espressocash_app/lib/features/ramp/partners/coinflow/widgets/launch.dart @@ -18,7 +18,7 @@ import '../../../../tokens/token.dart'; import '../../../models/ramp_partner.dart'; import '../../../screens/off_ramp_order_screen.dart'; import '../../../services/off_ramp_order_service.dart'; -import '../../models/profile_data.dart'; +import '../../../src/models/profile_data.dart'; extension BuildContextExt on BuildContext { Future launchCoinflowOffRamp({ diff --git a/packages/espressocash_app/lib/features/ramp/src/widgets/partners/guardarian.dart b/packages/espressocash_app/lib/features/ramp/partners/guardarian/widgets/launch.dart similarity index 95% rename from packages/espressocash_app/lib/features/ramp/src/widgets/partners/guardarian.dart rename to packages/espressocash_app/lib/features/ramp/partners/guardarian/widgets/launch.dart index 5cf31c76e5..636e756eeb 100644 --- a/packages/espressocash_app/lib/features/ramp/src/widgets/partners/guardarian.dart +++ b/packages/espressocash_app/lib/features/ramp/partners/guardarian/widgets/launch.dart @@ -5,7 +5,7 @@ import 'package:flutter/material.dart'; import '../../../../../config.dart'; import '../../../../../ui/web_view_screen.dart'; -import '../../models/profile_data.dart'; +import '../../../src/models/profile_data.dart'; extension BuildContextExt on BuildContext { void launchGuardarianOnRamp({ diff --git a/packages/espressocash_app/lib/features/ramp/kado/data/kado_api_client.dart b/packages/espressocash_app/lib/features/ramp/partners/kado/data/kado_api_client.dart similarity index 98% rename from packages/espressocash_app/lib/features/ramp/kado/data/kado_api_client.dart rename to packages/espressocash_app/lib/features/ramp/partners/kado/data/kado_api_client.dart index 4acf7aa7c7..5594bd6084 100644 --- a/packages/espressocash_app/lib/features/ramp/kado/data/kado_api_client.dart +++ b/packages/espressocash_app/lib/features/ramp/partners/kado/data/kado_api_client.dart @@ -5,7 +5,7 @@ import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:injectable/injectable.dart'; import 'package:retrofit/http.dart'; -import '../../../../../config.dart'; +import '../../../../../../config.dart'; part 'kado_api_client.freezed.dart'; part 'kado_api_client.g.dart'; diff --git a/packages/espressocash_app/lib/features/ramp/kado/services/kado_off_ramp_order_watcher.dart b/packages/espressocash_app/lib/features/ramp/partners/kado/services/kado_off_ramp_order_watcher.dart similarity index 92% rename from packages/espressocash_app/lib/features/ramp/kado/services/kado_off_ramp_order_watcher.dart rename to packages/espressocash_app/lib/features/ramp/partners/kado/services/kado_off_ramp_order_watcher.dart index 7f16e2ba73..4c1edb025d 100644 --- a/packages/espressocash_app/lib/features/ramp/kado/services/kado_off_ramp_order_watcher.dart +++ b/packages/espressocash_app/lib/features/ramp/partners/kado/services/kado_off_ramp_order_watcher.dart @@ -4,9 +4,9 @@ import 'package:drift/drift.dart'; import 'package:injectable/injectable.dart'; import 'package:rxdart/rxdart.dart'; -import '../../../../data/db/db.dart'; -import '../../data/my_database_ext.dart'; -import '../../src/models/ramp_watcher.dart'; +import '../../../../../data/db/db.dart'; +import '../../../data/my_database_ext.dart'; +import '../../../src/models/ramp_watcher.dart'; import '../data/kado_api_client.dart'; @injectable diff --git a/packages/espressocash_app/lib/features/ramp/kado/services/kado_on_ramp_order_watcher.dart b/packages/espressocash_app/lib/features/ramp/partners/kado/services/kado_on_ramp_order_watcher.dart similarity index 92% rename from packages/espressocash_app/lib/features/ramp/kado/services/kado_on_ramp_order_watcher.dart rename to packages/espressocash_app/lib/features/ramp/partners/kado/services/kado_on_ramp_order_watcher.dart index 72421eafe9..653c961a73 100644 --- a/packages/espressocash_app/lib/features/ramp/kado/services/kado_on_ramp_order_watcher.dart +++ b/packages/espressocash_app/lib/features/ramp/partners/kado/services/kado_on_ramp_order_watcher.dart @@ -5,10 +5,10 @@ import 'package:drift/drift.dart'; import 'package:injectable/injectable.dart'; import 'package:rxdart/rxdart.dart'; -import '../../../../../core/currency.dart'; -import '../../../../../data/db/db.dart'; -import '../../data/my_database_ext.dart'; -import '../../src/models/ramp_watcher.dart'; +import '../../../../../../core/currency.dart'; +import '../../../../../../data/db/db.dart'; +import '../../../data/my_database_ext.dart'; +import '../../../src/models/ramp_watcher.dart'; import '../data/kado_api_client.dart'; @injectable diff --git a/packages/espressocash_app/lib/features/ramp/src/widgets/partners/kado.dart b/packages/espressocash_app/lib/features/ramp/partners/kado/widgets/launch.dart similarity index 96% rename from packages/espressocash_app/lib/features/ramp/src/widgets/partners/kado.dart rename to packages/espressocash_app/lib/features/ramp/partners/kado/widgets/launch.dart index 278d840f4a..d301a58e8d 100644 --- a/packages/espressocash_app/lib/features/ramp/src/widgets/partners/kado.dart +++ b/packages/espressocash_app/lib/features/ramp/partners/kado/widgets/launch.dart @@ -10,14 +10,14 @@ import '../../../../../core/currency.dart'; import '../../../../../di.dart'; import '../../../../../ui/web_view_screen.dart'; import '../../../data/on_ramp_order_service.dart'; -import '../../../kado/data/kado_api_client.dart'; import '../../../models/ramp_partner.dart'; import '../../../screens/off_ramp_order_screen.dart'; import '../../../screens/on_ramp_order_screen.dart'; import '../../../services/off_ramp_order_service.dart'; -import '../../models/profile_data.dart'; -import '../../models/ramp_type.dart'; -import '../../screens/ramp_amount_screen.dart'; +import '../../../src/models/profile_data.dart'; +import '../../../src/models/ramp_type.dart'; +import '../../../src/screens/ramp_amount_screen.dart'; +import '../data/kado_api_client.dart'; extension BuildContextExt on BuildContext { Future launchKadoOnRamp({ diff --git a/packages/espressocash_app/lib/features/ramp/src/widgets/partners/ramp_network.dart b/packages/espressocash_app/lib/features/ramp/partners/ramp_network/widgets/launch.dart similarity index 95% rename from packages/espressocash_app/lib/features/ramp/src/widgets/partners/ramp_network.dart rename to packages/espressocash_app/lib/features/ramp/partners/ramp_network/widgets/launch.dart index 2f1b83cc0c..aa8f2f29a2 100644 --- a/packages/espressocash_app/lib/features/ramp/src/widgets/partners/ramp_network.dart +++ b/packages/espressocash_app/lib/features/ramp/partners/ramp_network/widgets/launch.dart @@ -4,7 +4,7 @@ import 'package:ramp_flutter/ramp_flutter.dart'; import '../../../../../config.dart'; import '../../../../balances/widgets/context_ext.dart'; -import '../../models/profile_data.dart'; +import '../../../src/models/profile_data.dart'; extension BuildContextExt on BuildContext { void launchRampNetworkOnRamp({ diff --git a/packages/espressocash_app/lib/features/ramp/scalex/data/scalex_repository.dart b/packages/espressocash_app/lib/features/ramp/partners/scalex/data/scalex_repository.dart similarity index 96% rename from packages/espressocash_app/lib/features/ramp/scalex/data/scalex_repository.dart rename to packages/espressocash_app/lib/features/ramp/partners/scalex/data/scalex_repository.dart index 09ffb2322c..f9be015f8a 100644 --- a/packages/espressocash_app/lib/features/ramp/scalex/data/scalex_repository.dart +++ b/packages/espressocash_app/lib/features/ramp/partners/scalex/data/scalex_repository.dart @@ -1,7 +1,7 @@ import 'package:espressocash_api/espressocash_api.dart'; import 'package:injectable/injectable.dart'; -import '../../../../core/currency.dart'; +import '../../../../../core/currency.dart'; @injectable class ScalexRepository { diff --git a/packages/espressocash_app/lib/features/ramp/scalex/services/scalex_off_ramp_order_watcher.dart b/packages/espressocash_app/lib/features/ramp/partners/scalex/services/scalex_off_ramp_order_watcher.dart similarity index 91% rename from packages/espressocash_app/lib/features/ramp/scalex/services/scalex_off_ramp_order_watcher.dart rename to packages/espressocash_app/lib/features/ramp/partners/scalex/services/scalex_off_ramp_order_watcher.dart index 962fa52903..7b7ee303b6 100644 --- a/packages/espressocash_app/lib/features/ramp/scalex/services/scalex_off_ramp_order_watcher.dart +++ b/packages/espressocash_app/lib/features/ramp/partners/scalex/services/scalex_off_ramp_order_watcher.dart @@ -5,9 +5,9 @@ import 'package:espressocash_api/espressocash_api.dart'; import 'package:injectable/injectable.dart'; import 'package:rxdart/rxdart.dart'; -import '../../../../../data/db/db.dart'; -import '../../data/my_database_ext.dart'; -import '../../src/models/ramp_watcher.dart'; +import '../../../../../../data/db/db.dart'; +import '../../../data/my_database_ext.dart'; +import '../../../src/models/ramp_watcher.dart'; import '../data/scalex_repository.dart'; @injectable diff --git a/packages/espressocash_app/lib/features/ramp/scalex/services/scalex_on_ramp_order_watcher.dart b/packages/espressocash_app/lib/features/ramp/partners/scalex/services/scalex_on_ramp_order_watcher.dart similarity index 91% rename from packages/espressocash_app/lib/features/ramp/scalex/services/scalex_on_ramp_order_watcher.dart rename to packages/espressocash_app/lib/features/ramp/partners/scalex/services/scalex_on_ramp_order_watcher.dart index 2e9e7ee906..56e8bdb701 100644 --- a/packages/espressocash_app/lib/features/ramp/scalex/services/scalex_on_ramp_order_watcher.dart +++ b/packages/espressocash_app/lib/features/ramp/partners/scalex/services/scalex_on_ramp_order_watcher.dart @@ -5,9 +5,9 @@ import 'package:espressocash_api/espressocash_api.dart'; import 'package:injectable/injectable.dart'; import 'package:rxdart/rxdart.dart'; -import '../../../../../data/db/db.dart'; -import '../../data/my_database_ext.dart'; -import '../../src/models/ramp_watcher.dart'; +import '../../../../../../data/db/db.dart'; +import '../../../data/my_database_ext.dart'; +import '../../../src/models/ramp_watcher.dart'; import '../data/scalex_repository.dart'; @injectable diff --git a/packages/espressocash_app/lib/features/ramp/src/widgets/partners/scalex.dart b/packages/espressocash_app/lib/features/ramp/partners/scalex/widgets/launch.dart similarity index 97% rename from packages/espressocash_app/lib/features/ramp/src/widgets/partners/scalex.dart rename to packages/espressocash_app/lib/features/ramp/partners/scalex/widgets/launch.dart index fd198864eb..2ecac22637 100644 --- a/packages/espressocash_app/lib/features/ramp/src/widgets/partners/scalex.dart +++ b/packages/espressocash_app/lib/features/ramp/partners/scalex/widgets/launch.dart @@ -14,13 +14,13 @@ import '../../../../../ui/snackbar.dart'; import '../../../../../ui/web_view_screen.dart'; import '../../../data/on_ramp_order_service.dart'; import '../../../models/ramp_partner.dart'; -import '../../../scalex/data/scalex_repository.dart'; import '../../../screens/off_ramp_order_screen.dart'; import '../../../screens/on_ramp_order_screen.dart'; import '../../../services/off_ramp_order_service.dart'; -import '../../models/profile_data.dart'; -import '../../models/ramp_type.dart'; -import '../../screens/ramp_amount_screen.dart'; +import '../../../src/models/profile_data.dart'; +import '../../../src/models/ramp_type.dart'; +import '../../../src/screens/ramp_amount_screen.dart'; +import '../data/scalex_repository.dart'; extension BuildContextExt on BuildContext { Future launchScalexRamp({ diff --git a/packages/espressocash_app/lib/features/ramp/services/off_ramp_order_service.dart b/packages/espressocash_app/lib/features/ramp/services/off_ramp_order_service.dart index a78ed40e5a..3ead636b39 100644 --- a/packages/espressocash_app/lib/features/ramp/services/off_ramp_order_service.dart +++ b/packages/espressocash_app/lib/features/ramp/services/off_ramp_order_service.dart @@ -23,10 +23,10 @@ import '../../tokens/token_list.dart'; import '../../transactions/models/tx_results.dart'; import '../../transactions/services/resign_tx.dart'; import '../../transactions/services/tx_sender.dart'; -import '../coinflow/services/coinflow_off_ramp_order_watcher.dart'; -import '../kado/services/kado_off_ramp_order_watcher.dart'; import '../models/ramp_partner.dart'; -import '../scalex/services/scalex_off_ramp_order_watcher.dart'; +import '../partners/coinflow/services/coinflow_off_ramp_order_watcher.dart'; +import '../partners/kado/services/kado_off_ramp_order_watcher.dart'; +import '../partners/scalex/services/scalex_off_ramp_order_watcher.dart'; import '../src/models/ramp_watcher.dart'; typedef OffRampOrder = ({ diff --git a/packages/espressocash_app/lib/features/ramp/widgets/on_ramp_order_details.dart b/packages/espressocash_app/lib/features/ramp/widgets/on_ramp_order_details.dart index e0c9dd64cc..68425980cf 100644 --- a/packages/espressocash_app/lib/features/ramp/widgets/on_ramp_order_details.dart +++ b/packages/espressocash_app/lib/features/ramp/widgets/on_ramp_order_details.dart @@ -2,9 +2,9 @@ import 'package:flutter/widgets.dart'; import '../../../di.dart'; import '../data/on_ramp_order_service.dart'; -import '../kado/services/kado_on_ramp_order_watcher.dart'; import '../models/ramp_partner.dart'; -import '../scalex/services/scalex_on_ramp_order_watcher.dart'; +import '../partners/kado/services/kado_on_ramp_order_watcher.dart'; +import '../partners/scalex/services/scalex_on_ramp_order_watcher.dart'; import '../src/models/ramp_watcher.dart'; export '../data/on_ramp_order_service.dart' show OnRampOrder; diff --git a/packages/espressocash_app/lib/features/ramp/widgets/ramp_buttons.dart b/packages/espressocash_app/lib/features/ramp/widgets/ramp_buttons.dart index 00e945c62f..912d563159 100644 --- a/packages/espressocash_app/lib/features/ramp/widgets/ramp_buttons.dart +++ b/packages/espressocash_app/lib/features/ramp/widgets/ramp_buttons.dart @@ -14,16 +14,16 @@ import '../../accounts/models/account.dart'; import '../../country_picker/models/country.dart'; import '../../profile/data/profile_repository.dart'; import '../models/ramp_partner.dart'; +import '../partners/coinflow/widgets/launch.dart'; +import '../partners/guardarian/widgets/launch.dart'; +import '../partners/kado/widgets/launch.dart'; +import '../partners/ramp_network/widgets/launch.dart'; +import '../partners/scalex/widgets/launch.dart'; import '../src/models/profile_data.dart'; import '../src/models/ramp_type.dart'; import '../src/screens/ramp_onboarding_screen.dart'; import '../src/screens/ramp_partner_select_screen.dart'; import '../src/widgets/off_ramp_bottom_sheet.dart'; -import '../src/widgets/partners/coinflow.dart'; -import '../src/widgets/partners/guardarian.dart'; -import '../src/widgets/partners/kado.dart'; -import '../src/widgets/partners/ramp_network.dart'; -import '../src/widgets/partners/scalex.dart'; class AddCashButton extends StatelessWidget { const AddCashButton({