Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 22 additions & 20 deletions lib/bloc/fiat/models/fiat_payment_method.dart
Original file line number Diff line number Diff line change
Expand Up @@ -120,26 +120,28 @@ class FiatPaymentMethod extends Equatable {
}

List<FiatPaymentMethod> defaultFiatPaymentMethods = [
FiatPaymentMethod(
id: 'CARD_PAYMENT',
name: 'Card Payment',
providerId: 'Ramp',
priceInfo: FiatPriceInfo.zero,
relativePercent: Decimal.zero,
providerIconAssetPath: 'assets/fiat/providers/ramp_icon.svg',
transactionLimits: const [],
transactionFees: const [],
),
FiatPaymentMethod(
id: 'APPLE_PAY',
name: 'Apple Pay',
providerId: 'Ramp',
priceInfo: FiatPriceInfo.zero,
relativePercent: Decimal.parse('-0.04126038522159592'),
providerIconAssetPath: 'assets/fiat/providers/ramp_icon.svg',
transactionLimits: const [],
transactionFees: const [],
),
// Ramp API keys unavailable for the time being
// TODO(takenagain): re-enable when API keys are available
// FiatPaymentMethod(
// id: 'CARD_PAYMENT',
// name: 'Card Payment',
// providerId: 'Ramp',
// priceInfo: FiatPriceInfo.zero,
// relativePercent: Decimal.zero,
// providerIconAssetPath: 'assets/fiat/providers/ramp_icon.svg',
// transactionLimits: const [],
// transactionFees: const [],
// ),
// FiatPaymentMethod(
// id: 'APPLE_PAY',
// name: 'Apple Pay',
// providerId: 'Ramp',
// priceInfo: FiatPriceInfo.zero,
// relativePercent: Decimal.parse('-0.04126038522159592'),
// providerIconAssetPath: 'assets/fiat/providers/ramp_icon.svg',
// transactionLimits: const [],
// transactionFees: const [],
// ),
FiatPaymentMethod(
id: '7554',
name: 'Visa/Mastercard',
Expand Down
5 changes: 4 additions & 1 deletion lib/views/fiat/fiat_page.dart
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the RampFiatProvider() is disabled, are the changes to lib/bloc/fiat/models/fiat_payment_method.dart still necessary? I haven't looked at the full context yet, but I assume the available options are populated dynamically based on the registered providers.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The defaultFiatPaymentMethods is a placeholder value used when

  • there is no valid Fiat amount entered (initial form state), and
  • when logging out and resetting the form (before updating providers with a default example fiat value of 10000).

Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ class _FiatPageState extends State<FiatPage> with TickerProviderStateMixin {
Widget build(BuildContext context) {
final coinsRepository = RepositoryProvider.of<CoinsRepo>(context);
final fiatRepository = FiatRepository(
[BanxaFiatProvider(), RampFiatProvider()],
// Ramp API keys unavailable for the time being
// TODO(takenagain): re-enable when API keys are available
// [BanxaFiatProvider(), RampFiatProvider()],
[BanxaFiatProvider()],
coinsRepository,
Comment on lines +51 to 55
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

ramp_fiat_provider.dart import is now unused – will fail on dart analyze --fatal-warnings

Since the provider list no longer contains RampFiatProvider, the import at line 11 becomes unused.
Either:

-import 'package:web_dex/bloc/fiat/ramp/ramp_fiat_provider.dart';
+// import removed while Ramp is disabled – add back when keys are refreshed

or add the provider conditionally behind a compile-time flag so the import remains referenced when enabled.

Neglecting this will cause CI to break if unused-import warnings are treated as errors.

🤖 Prompt for AI Agents
In lib/views/fiat/fiat_page.dart around lines 51 to 55, the import for
ramp_fiat_provider.dart is now unused because RampFiatProvider is commented out
from the provider list. To fix this, either remove the import statement for
ramp_fiat_provider.dart at line 11 or reintroduce RampFiatProvider conditionally
using a compile-time flag so the import remains referenced when enabled. This
will prevent dart analyze from failing due to unused imports.

);
final sdk = RepositoryProvider.of<KomodoDefiSdk>(context);
Expand Down
Loading