What changed, and why it matters
This commit is a routine UI polish/fix. It swaps plain text widgets for specialized money/currency widgets in buy/sell screens and fixes indentation in a hardware-wallet connection callback. There is no clear security-relevant change.
No security action required; treat as normal UI refactoring.
Security signals we found
No security-relevant code paths changed
Only UI widget substitutions and indentation cleanup
No changes to parsing, validation, authentication, or secrets handling
Evidence from the diff
The diff replaces direct Text(amount.toStringWithPrecision(…)) and Text(currency.symbol) calls with MoneyText, MoneyText.optional, and CurrencySymbolText wrappers across buy/sell amount, provider, and floating amount input pages. It also corrects whitespace/indentation in connect_device_page.dart’s addPostFrameCallback block. No input validation, crypto, networking, or permission logic is modified.
Changed components
lib/new-ui/pages/buy_sell/buy_sell_amount_page.dartlib/new-ui/pages/buy_sell/buy_sell_provider_page.dartlib/new-ui/widgets/floating_amount_input.dartlib/src/screens/connect_device/connect_device_page.dartInspect captured patch +13 / −13
diff --git a/lib/new-ui/pages/buy_sell/buy_sell_amount_page.dart b/lib/new-ui/pages/buy_sell/buy_sell_amount_page.dart
index 41c276cb..f9fec1fd 100644
--- a/lib/new-ui/pages/buy_sell/buy_sell_amount_page.dart
+++ b/lib/new-ui/pages/buy_sell/buy_sell_amount_page.dart
@@ -10,6 +10,8 @@ import "package:cake_wallet/new-ui/widgets/currency_picker/currency_picker_args.
import "package:cake_wallet/new-ui/widgets/currency_picker/currency_picker_sheet.dart";
import "package:cake_wallet/new-ui/widgets/currency_picker/fiat_currency_picker_sheet.dart";
import "package:cake_wallet/new-ui/widgets/floating_amount_input.dart";
+import "package:cake_wallet/new-ui/widgets/money/currency_symbol_text.dart";
+import "package:cake_wallet/new-ui/widgets/money/money_text.dart";
import "package:cake_wallet/new-ui/widgets/new_primary_button.dart";
import "package:cake_wallet/new-ui/widgets/receive_page/receive_top_bar.dart";
import "package:cake_wallet/new-ui/widgets/token_chain_display.dart";
@@ -374,8 +376,8 @@ class BuySellAmountPill extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (amount != null)
- Text(
- amount!.toStringWithPrecision(fractionalDigits: 0),
+ MoneyText(
+ amount!,
style: const TextStyle(fontSize: 18, fontWeight: FontWeight.w600),
),
Text(
@@ -444,8 +446,8 @@ class BuySellCurrencyPickerPill extends StatelessWidget {
Text(
curr.fullName ?? curr.symbol,
),
- Text(
- curr.symbol,
+ CurrencySymbolText(
+ curr,
style: TextStyle(
fontSize: 12,
color: Theme.of(context).colorScheme.onSurfaceVariant,
diff --git a/lib/new-ui/pages/buy_sell/buy_sell_provider_page.dart b/lib/new-ui/pages/buy_sell/buy_sell_provider_page.dart
index 4a563e3b..99c91c13 100644
--- a/lib/new-ui/pages/buy_sell/buy_sell_provider_page.dart
+++ b/lib/new-ui/pages/buy_sell/buy_sell_provider_page.dart
@@ -7,6 +7,7 @@ import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/new-ui/pages/buy_sell/buy_sell_confirmation_page.dart';
import 'package:cake_wallet/new-ui/pages/buy_sell/buy_sell_payment_method_page.dart';
import 'package:cake_wallet/new-ui/widgets/buy_sell/buy_sell_selector_modal.dart';
+import "package:cake_wallet/new-ui/widgets/money/money_text.dart";
import 'package:cake_wallet/new-ui/widgets/receive_page/receive_top_bar.dart';
import 'package:cake_wallet/src/widgets/new_list_row/new_list_section.dart';
import 'package:cake_wallet/view_model/buy/buy_sell_view_model.dart';
@@ -160,10 +161,7 @@ class _BuySellProviderPageState extends State<BuySellProviderPage> {
mainAxisAlignment: MainAxisAlignment.center,
spacing: 4,
children: [
- Text(widget.buySellViewModel
- .amountForQuote(quote)
- ?.toStringWithSymbol(fractionalDigits: 8) ??
- ""),
+ MoneyText.optional(widget.buySellViewModel.amountForQuote(quote)),
if (fiatAmount != null)
Text(
"= ${fiatAmount.toStringWithSymbol(fractionalDigits: 2, trimZeros: false)}",
diff --git a/lib/new-ui/widgets/floating_amount_input.dart b/lib/new-ui/widgets/floating_amount_input.dart
index 7fb23045..237f8582 100644
--- a/lib/new-ui/widgets/floating_amount_input.dart
+++ b/lib/new-ui/widgets/floating_amount_input.dart
@@ -1,3 +1,4 @@
+import "package:cake_wallet/new-ui/widgets/money/currency_symbol_text.dart";
import 'package:cw_core/currency.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@@ -80,8 +81,8 @@ class _FloatingAmountInputState extends State<FloatingAmountInput> {
),
),
const SizedBox(width: 8),
- Text(
- widget.currency.symbol,
+ CurrencySymbolText(
+ widget.currency,
maxLines: 1,
overflow: TextOverflow.ellipsis,
style: Theme.of(context).textTheme.displayMedium?.copyWith(
diff --git a/lib/src/screens/connect_device/connect_device_page.dart b/lib/src/screens/connect_device/connect_device_page.dart
index 4a049993..74691034 100644
--- a/lib/src/screens/connect_device/connect_device_page.dart
+++ b/lib/src/screens/connect_device/connect_device_page.dart
@@ -195,9 +195,8 @@ class ConnectDevicePageBodyState extends State<ConnectDevicePageBody> {
final isConnected = await widget.hardwareWalletVM.connectDevice(device, widget.walletType);
_isConnectPressed = false;
- WidgetsBinding.instance.addPostFrameCallback((_) {
- if (isConnected)
- {
+ WidgetsBinding.instance.addPostFrameCallback((_) {
+ if (isConnected) {
widget.onConnectDevice(navigatorKey.currentContext!, widget.hardwareWalletVM);
}
});
Why this scored 18/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.