Skip to content

Remove USD as the default fiat currency#250

Merged
grunch merged 2 commits into
mainfrom
fix/remove-usd-default-currency
Aug 2, 2025
Merged

Remove USD as the default fiat currency#250
grunch merged 2 commits into
mainfrom
fix/remove-usd-default-currency

Conversation

@grunch

@grunch grunch commented Aug 1, 2025

Copy link
Copy Markdown
Member

Changes Made:

  1. Modified selectedFiatCodeProvider in lib/shared/providers/exchange_service_provider.dart to return String? instead of String and removed the ?? 'USD' fallback
  2. Added localization keys in all ARB files (en/es/it):
  • "selectCurrency" - "Select Currency" / "Seleccionar Moneda" / "Seleziona Valuta"
  • "noCurrencySelected" - "No currency selected" / "Ninguna moneda seleccionada" / "Nessuna valuta selezionata"
  1. Updated UI components to handle null currency selection:
  • currency_section.dart - Shows "Select Currency" when no currency is selected
  • settings_screen.dart - Shows "No currency selected" in settings when none chosen
  • add_order_screen.dart - Properly validates non-null currency before order submission
  • payment_methods_section.dart - Handles null currency code gracefully
  1. Fixed all Flutter analyzer issues - Zero warnings or errors remain

Now when the app is first installed, users will see "Select Currency" instead of USD, and they must explicitly choose a fiat currency before they can create orders. The selected currency persists in settings once chosen.

Summary by CodeRabbit

  • New Features

    • Added new localized strings for currency selection in English, Spanish, and Italian.
  • Bug Fixes

    • Improved handling of currency selection by resetting to the default fiat currency for each new order.
    • Enhanced validation to prevent issues when no currency is selected.
    • Updated UI to display appropriate messages when no currency is selected.
  • Style

    • Improved display text and fallback messaging for currency selection fields.

Changes Made:

1. Modified selectedFiatCodeProvider in lib/shared/providers/exchange_service_provider.dart
to return String? instead of String and removed the ?? 'USD' fallback
2. Added localization keys in all ARB files (en/es/it):
  - "selectCurrency" - "Select Currency" / "Seleccionar Moneda" / "Seleziona Valuta"
  - "noCurrencySelected" - "No currency selected" / "Ninguna moneda seleccionada" / "Nessuna
valuta selezionata"
3. Updated UI components to handle null currency selection:
  - currency_section.dart - Shows "Select Currency" when no currency is selected
  - settings_screen.dart - Shows "No currency selected" in settings when none chosen
  - add_order_screen.dart - Properly validates non-null currency before order submission
  - payment_methods_section.dart - Handles null currency code gracefully
4. Fixed all Flutter analyzer issues - Zero warnings or errors remain

Now when the app is first installed, users will see "Select Currency" instead of USD, and
they must explicitly choose a fiat currency before they can create orders. The selected
currency persists in settings once chosen.
@coderabbitai

coderabbitai Bot commented Aug 1, 2025

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

Walkthrough

This update refactors fiat currency selection and state management in the order and settings flows. It makes the fiat code provider nullable, resets it to the default on order screen initialization, improves null handling in UI and validation, and adds new localization strings for currency selection prompts in English, Spanish, and Italian.

Changes

Cohort / File(s) Change Summary
Order Screen Fiat Code Management
lib/features/order/screens/add_order_screen.dart
Resets selectedFiatCodeProvider to default fiat from settings on screen init; improves null validation and variable assignment for fiat code in order submission.
Currency Section UI & Logic
lib/features/order/widgets/currency_section.dart
Removes settings provider import; handles null selectedFiatCode with fallback text; updates key and UI display logic; removes updating settings on selection.
Payment Methods Section
lib/features/order/widgets/payment_methods_section.dart
Ensures localization method always receives a non-null string for fiat code by using a null-aware operator.
Settings Screen Currency Selector
lib/features/settings/settings_screen.dart
Now derives selected fiat code from settings provider, not fiat code provider; adds fallback text for null selection.
Localization Additions (EN, ES, IT)
lib/l10n/intl_en.arb, lib/l10n/intl_es.arb, lib/l10n/intl_it.arb
Moves "selectCurrency" string and adds "noCurrencySelected" string in English, Spanish, and Italian localization files.
Exchange Service Provider Refactor
lib/shared/providers/exchange_service_provider.dart
Removes settings provider import; changes selectedFiatCodeProvider to nullable and initializes to null instead of a default.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant AddOrderScreen
    participant SettingsProvider
    participant selectedFiatCodeProvider

    User->>AddOrderScreen: Navigates to Add Order
    AddOrderScreen->>SettingsProvider: Fetch defaultFiatCode
    AddOrderScreen->>selectedFiatCodeProvider: Reset to defaultFiatCode
    User->>AddOrderScreen: Fills order form, submits
    AddOrderScreen->>selectedFiatCodeProvider: Read selectedFiatCode
    AddOrderScreen->>AddOrderScreen: Validate selectedFiatCode (null/empty)
    AddOrderScreen->>Order: Create order with fiatCode
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15 minutes

Possibly related PRs

Suggested reviewers

  • AndreaDiazCorreia

Poem

A hop and a skip through the code we go,
Fiat codes now nullable, defaults in tow.
With "Select Currency" in every tongue,
The screens feel fresh, the UI’s young.
Rabbits rejoice—no more nulls to fear,
Currency selection is crystal clear! 🐇💱

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 873bac0 and 01cbee7.

📒 Files selected for processing (3)
  • lib/l10n/intl_en.arb (1 hunks)
  • lib/l10n/intl_es.arb (1 hunks)
  • lib/l10n/intl_it.arb (1 hunks)
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/remove-usd-default-currency

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 3

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c6b682e and 873bac0.

📒 Files selected for processing (8)
  • lib/features/order/screens/add_order_screen.dart (5 hunks)
  • lib/features/order/widgets/currency_section.dart (2 hunks)
  • lib/features/order/widgets/payment_methods_section.dart (1 hunks)
  • lib/features/settings/settings_screen.dart (2 hunks)
  • lib/l10n/intl_en.arb (1 hunks)
  • lib/l10n/intl_es.arb (1 hunks)
  • lib/l10n/intl_it.arb (1 hunks)
  • lib/shared/providers/exchange_service_provider.dart (1 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
lib/l10n/*.arb

📄 CodeRabbit Inference Engine (CLAUDE.md)

lib/l10n/*.arb: Internationalization must use flutter_intl with ARB files in lib/l10n/
Use proper ARB metadata for parameterized strings

Files:

  • lib/l10n/intl_es.arb
  • lib/l10n/intl_en.arb
  • lib/l10n/intl_it.arb
lib/l10n/intl_{en,es,it}.arb

📄 CodeRabbit Inference Engine (CLAUDE.md)

Add new localization keys to all three ARB files (en, es, it)

Files:

  • lib/l10n/intl_es.arb
  • lib/l10n/intl_en.arb
  • lib/l10n/intl_it.arb
lib/features/*/{screens,providers,notifiers,widgets}/**/*.dart

📄 CodeRabbit Inference Engine (CLAUDE.md)

Feature-based organization: features/{feature}/{screens|providers|notifiers|widgets}/

Files:

  • lib/features/order/widgets/payment_methods_section.dart
  • lib/features/order/widgets/currency_section.dart
  • lib/features/order/screens/add_order_screen.dart
lib/**/*.dart

📄 CodeRabbit Inference Engine (CLAUDE.md)

lib/**/*.dart: Use S.of(context).yourKey for all user-facing strings
Always use localized strings instead of hardcoded text
Pass BuildContext to methods that need localization
Always use latest APIs (e.g., withValues() instead of withOpacity())
Always check mounted before using context after async operations

Files:

  • lib/features/order/widgets/payment_methods_section.dart
  • lib/shared/providers/exchange_service_provider.dart
  • lib/features/settings/settings_screen.dart
  • lib/features/order/widgets/currency_section.dart
  • lib/features/order/screens/add_order_screen.dart
**/*.dart

📄 CodeRabbit Inference Engine (CLAUDE.md)

**/*.dart: Remove unused imports and dependencies
Use const constructors where possible

Files:

  • lib/features/order/widgets/payment_methods_section.dart
  • lib/shared/providers/exchange_service_provider.dart
  • lib/features/settings/settings_screen.dart
  • lib/features/order/widgets/currency_section.dart
  • lib/features/order/screens/add_order_screen.dart
lib/shared/**/*.dart

📄 CodeRabbit Inference Engine (CLAUDE.md)

Shared utilities and widgets must be placed in shared/

Files:

  • lib/shared/providers/exchange_service_provider.dart
🧠 Learnings (19)
📚 Learning: applies to lib/l10n/intl_{en,es,it}.arb : add new localization keys to all three arb files (en, es, ...
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-30T14:10:43.895Z
Learning: Applies to lib/l10n/intl_{en,es,it}.arb : Add new localization keys to all three ARB files (en, es, it)

Applied to files:

  • lib/l10n/intl_es.arb
  • lib/l10n/intl_en.arb
  • lib/l10n/intl_it.arb
📚 Learning: applies to lib/l10n/*.arb : use proper arb metadata for parameterized strings...
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-30T14:10:43.895Z
Learning: Applies to lib/l10n/*.arb : Use proper ARB metadata for parameterized strings

Applied to files:

  • lib/l10n/intl_es.arb
  • lib/l10n/intl_en.arb
  • lib/l10n/intl_it.arb
📚 Learning: applies to lib/l10n/*.arb : internationalization must use `flutter_intl` with arb files in `lib/l10n...
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-30T14:10:43.895Z
Learning: Applies to lib/l10n/*.arb : Internationalization must use `flutter_intl` with ARB files in `lib/l10n/`

Applied to files:

  • lib/l10n/intl_es.arb
  • lib/l10n/intl_en.arb
  • lib/l10n/intl_it.arb
📚 Learning: applies to lib/**/*.dart : pass buildcontext to methods that need localization...
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-30T14:10:43.895Z
Learning: Applies to lib/**/*.dart : Pass BuildContext to methods that need localization

Applied to files:

  • lib/features/order/widgets/payment_methods_section.dart
  • lib/features/settings/settings_screen.dart
  • lib/features/order/widgets/currency_section.dart
  • lib/features/order/screens/add_order_screen.dart
📚 Learning: applies to lib/**/*.dart : always use localized strings instead of hardcoded text...
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-30T14:10:43.895Z
Learning: Applies to lib/**/*.dart : Always use localized strings instead of hardcoded text

Applied to files:

  • lib/features/order/widgets/payment_methods_section.dart
  • lib/features/settings/settings_screen.dart
  • lib/features/order/widgets/currency_section.dart
  • lib/features/order/screens/add_order_screen.dart
📚 Learning: applies to lib/features/*/providers/**/*.dart : providers are organized by feature in `features/{fea...
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-30T14:10:43.895Z
Learning: Applies to lib/features/*/providers/**/*.dart : Providers are organized by feature in `features/{feature}/providers/`

Applied to files:

  • lib/shared/providers/exchange_service_provider.dart
  • lib/features/order/widgets/currency_section.dart
  • lib/features/order/screens/add_order_screen.dart
📚 Learning: in the mostro mobile codebase, `eventstorageprovider` is exported from `package:mostro_mobile/shared...
Learnt from: chebizarro
PR: MostroP2P/mobile#74
File: lib/services/mostro_service.dart:70-76
Timestamp: 2025-05-06T15:49:26.443Z
Learning: In the Mostro Mobile codebase, `eventStorageProvider` is exported from `package:mostro_mobile/shared/providers/mostro_service_provider.dart` and not from a separate `event_storage_provider.dart` file.

Applied to files:

  • lib/shared/providers/exchange_service_provider.dart
  • lib/features/order/screens/add_order_screen.dart
📚 Learning: applies to lib/shared/providers/mostro_database_provider.dart : database initialization must occur i...
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-30T14:10:43.895Z
Learning: Applies to lib/shared/providers/mostro_database_provider.dart : Database initialization must occur in `shared/providers/mostro_database_provider.dart`

Applied to files:

  • lib/shared/providers/exchange_service_provider.dart
  • lib/features/order/widgets/currency_section.dart
  • lib/features/order/screens/add_order_screen.dart
📚 Learning: in the mostro mobile codebase, riverpod code generation is used with `@riverpod` annotations. provid...
Learnt from: chebizarro
PR: MostroP2P/mobile#74
File: lib/services/mostro_service.dart:70-76
Timestamp: 2025-05-06T15:49:26.443Z
Learning: In the Mostro Mobile codebase, Riverpod code generation is used with `@Riverpod` annotations. Providers like `eventStorageProvider` are generated in `.g.dart` files from annotated functions in the main provider files. These providers are accessible by importing the main provider file (e.g., `mostro_service_provider.dart`), not by importing a separate provider file.

Applied to files:

  • lib/shared/providers/exchange_service_provider.dart
📚 Learning: applies to lib/data/models.dart : models must be exported through `data/models.dart`...
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-30T14:10:43.895Z
Learning: Applies to lib/data/models.dart : Models must be exported through `data/models.dart`

Applied to files:

  • lib/shared/providers/exchange_service_provider.dart
  • lib/features/order/screens/add_order_screen.dart
📚 Learning: applies to lib/features/*/{screens,providers,notifiers,widgets}/**/*.dart : feature-based organizati...
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-30T14:10:43.895Z
Learning: Applies to lib/features/*/{screens,providers,notifiers,widgets}/**/*.dart : Feature-based organization: `features/{feature}/{screens|providers|notifiers|widgets}/`

Applied to files:

  • lib/features/settings/settings_screen.dart
  • lib/features/order/widgets/currency_section.dart
  • lib/features/order/screens/add_order_screen.dart
📚 Learning: applies to **/*.dart : remove unused imports and dependencies...
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-30T14:10:43.895Z
Learning: Applies to **/*.dart : Remove unused imports and dependencies

Applied to files:

  • lib/features/order/widgets/currency_section.dart
📚 Learning: applies to lib/**/*.dart : use `s.of(context).yourkey` for all user-facing strings...
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-30T14:10:43.895Z
Learning: Applies to lib/**/*.dart : Use `S.of(context).yourKey` for all user-facing strings

Applied to files:

  • lib/features/order/widgets/currency_section.dart
  • lib/features/order/screens/add_order_screen.dart
📚 Learning: applies to lib/main.dart : locales for the timeago package must be configured in `main.dart` with `t...
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-30T14:10:43.895Z
Learning: Applies to lib/main.dart : Locales for the timeago package must be configured in `main.dart` with `timeago.setLocaleMessages()`

Applied to files:

  • lib/features/order/widgets/currency_section.dart
  • lib/features/order/screens/add_order_screen.dart
📚 Learning: applies to test/mocks.mocks.dart : never manually edit `test/mocks.mocks.dart` - it's auto-generated...
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-30T14:10:43.895Z
Learning: Applies to test/mocks.mocks.dart : Never manually edit `test/mocks.mocks.dart` - it's auto-generated by Mockito

Applied to files:

  • lib/features/order/widgets/currency_section.dart
📚 Learning: all changes should pass `flutter analyze` before commit...
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-30T14:10:43.895Z
Learning: All changes should pass `flutter analyze` before commit

Applied to files:

  • lib/features/order/screens/add_order_screen.dart
📚 Learning: applies to lib/shared/**/*.dart : shared utilities and widgets must be placed in `shared/`...
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-30T14:10:43.895Z
Learning: Applies to lib/shared/**/*.dart : Shared utilities and widgets must be placed in `shared/`

Applied to files:

  • lib/features/order/screens/add_order_screen.dart
📚 Learning: applies to lib/services/nostr_service.dart : all nostr protocol interactions must go through `servic...
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-30T14:10:43.895Z
Learning: Applies to lib/services/nostr_service.dart : All Nostr protocol interactions must go through `services/nostr_service.dart`

Applied to files:

  • lib/features/order/screens/add_order_screen.dart
📚 Learning: mostroservice methods like takebuyorder() and takesellorder() return future and trigger side e...
Learnt from: chebizarro
PR: MostroP2P/mobile#110
File: test/notifiers/take_order_notifier_test.dart:72-74
Timestamp: 2025-06-04T19:35:20.209Z
Learning: MostroService methods like takeBuyOrder() and takeSellOrder() return Future<void> and trigger side effects through other mechanisms rather than direct return values. When testing these methods, focus on verifying method calls and testing state changes through the provider system rather than mocking return values.

Applied to files:

  • lib/features/order/screens/add_order_screen.dart
🪛 RuboCop (1.76.1)
lib/l10n/intl_es.arb

[warning] 735-735: Duplicated key in hash literal.

(Lint/DuplicateHashKey)

lib/l10n/intl_en.arb

[warning] 705-705: Duplicated key in hash literal.

(Lint/DuplicateHashKey)

lib/l10n/intl_it.arb

[warning] 743-743: Duplicated key in hash literal.

(Lint/DuplicateHashKey)

🔇 Additional comments (12)
lib/l10n/intl_es.arb (1)

735-736: LGTM: Proper Spanish localization added.

The new localization keys selectCurrency and noCurrencySelected with appropriate Spanish translations support the PR objective to handle null currency states properly.

lib/l10n/intl_en.arb (1)

705-706: LGTM: Appropriate English localization added.

The new localization keys selectCurrency and noCurrencySelected provide clear English text for handling null currency selection states, aligning with the PR objectives.

lib/features/order/widgets/payment_methods_section.dart (1)

30-30: LGTM: Proper null-safety handling.

The null-coalescing operator ensures the localization method paymentMethodsForCurrency always receives a non-null string, preventing runtime errors when selectedFiatCode is null. This aligns well with the PR changes to make currency selection nullable.

lib/shared/providers/exchange_service_provider.dart (1)

30-33: LGTM! Correctly implements nullable fiat code selection.

The change from String to String? with null initialization successfully removes the automatic USD default and allows explicit currency selection. The removal of the settings import is also appropriate since it's no longer used.

lib/features/order/screens/add_order_screen.dart (4)

18-18: LGTM! Proper import added for settings provider.

The settings provider import is correctly added to support the new initialization logic.


65-67: LGTM! Explicit currency initialization from settings.

The initialization logic properly sets the selected fiat code from the user's default settings when the screen loads. This ensures each new order starts with the appropriate currency selected while maintaining the nullable provider pattern.


259-270: LGTM! Improved null safety in validation logic.

The validation now properly handles both null and empty string cases, and the introduction of the fiatCode variable after validation provides type safety for downstream usage. This is a clean approach to null handling.


327-327: LGTM! Using the validated non-null fiatCode variable.

Correctly using the fiatCode variable instead of the potentially null selectedFiatCode ensures type safety in the Order creation.

lib/features/settings/settings_screen.dart (1)

386-421: LGTM! Correctly updated currency display logic.

The changes properly shift from reading selectedFiatCodeProvider to settingsProvider.defaultFiatCode, which makes sense for the settings screen. The null handling with localized fallback text (noCurrencySelected) is well implemented and follows the localization guidelines.

lib/features/order/widgets/currency_section.dart (3)

35-45: LGTM! Proper nullable currency handling implemented.

The initialization of name with the localized selectCurrency string and the conditional currency lookup only when selectedFiatCode is not null demonstrates good null safety practices. The logic correctly handles both the selected and unselected states.


64-64: LGTM! Key generation handles null case appropriately.

The key now properly handles the null case by using 'none' as a fallback, ensuring consistent widget identity management.


69-69: LGTM! Improved display text logic.

The conditional display logic elegantly shows either the full "CODE - Name" format when a currency is selected or just the localized "Select Currency" text when none is selected.

Comment thread lib/l10n/intl_en.arb
Comment thread lib/l10n/intl_es.arb
Comment thread lib/l10n/intl_it.arb
@grunch grunch merged commit ccb4757 into main Aug 2, 2025
1 of 2 checks passed
@grunch grunch deleted the fix/remove-usd-default-currency branch August 2, 2025 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant