Remove fiat api icon and show an error icon next to fiat balance instead
What changed, and why it matters
This commit is a user-interface polish change for a cryptocurrency wallet app. It removes a small status icon that showed whether the fiat-price API was working and instead shows a red warning icon next to the dollar (or other fiat) balance when that price feed fails. There is no security bug being fixed here.
No security action required. Treat as a routine UI/UX improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch changes the wallet home screen to stop rendering a dedicated fiat API status icon in the top status-icon area and to add a red warning icon beside the fiat balance when fiatRate.hasFailed is true. It also updates localization strings for the new tooltip (‘Error connecting to fiat API’) and bumps the Dart SDK constraint from 3.10.7 to 3.10.8. No logic for API calls, authentication, cryptography, or network handling is modified.
Changed components
lib/screens/wallet_home.dartlib/l10n/app_en.arblib/l10n/app_localizations.dartlib/l10n/app_localizations_en.dartlib/l10n/app_localizations_pt.dartlib/l10n/app_pt.arbpubspec.yamlpubspec.lockInspect captured patch +35 / −35
diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb
index c093690..b6052a5 100644
--- a/lib/l10n/app_en.arb
+++ b/lib/l10n/app_en.arb
@@ -68,6 +68,7 @@
"homeIncomingTxSemanticLabel": "Incoming Transaction",
"homeTransactionConfirmed": "Confirmed",
"homeNoTransactions": "No transactions",
+ "homeFiatApiError": "Error connecting to fiat API",
"receiveTitle": "Receive",
"receivePrimaryAddressWarn": "Warning: Unless you know what you're doing, please consider using subaddresses for better privacy.",
"receiveShareButton": "Share",
diff --git a/lib/l10n/app_localizations.dart b/lib/l10n/app_localizations.dart
index c6062b6..cd29f94 100644
--- a/lib/l10n/app_localizations.dart
+++ b/lib/l10n/app_localizations.dart
@@ -501,6 +501,12 @@ abstract class AppLocalizations {
/// **'No transactions'**
String get homeNoTransactions;
+ /// No description provided for @homeFiatApiError.
+ ///
+ /// In en, this message translates to:
+ /// **'Error connecting to fiat API'**
+ String get homeFiatApiError;
+
/// No description provided for @receiveTitle.
///
/// In en, this message translates to:
diff --git a/lib/l10n/app_localizations_en.dart b/lib/l10n/app_localizations_en.dart
index 0e52042..078de7b 100644
--- a/lib/l10n/app_localizations_en.dart
+++ b/lib/l10n/app_localizations_en.dart
@@ -219,6 +219,9 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get homeNoTransactions => 'No transactions';
+ @override
+ String get homeFiatApiError => 'Error connecting to fiat API';
+
@override
String get receiveTitle => 'Receive';
diff --git a/lib/l10n/app_localizations_pt.dart b/lib/l10n/app_localizations_pt.dart
index ccc2ccd..41ff7c0 100644
--- a/lib/l10n/app_localizations_pt.dart
+++ b/lib/l10n/app_localizations_pt.dart
@@ -219,6 +219,9 @@ class AppLocalizationsPt extends AppLocalizations {
@override
String get homeNoTransactions => 'Sem transações';
+ @override
+ String get homeFiatApiError => 'Erro ao conectar à API de cotação';
+
@override
String get receiveTitle => 'Receber';
diff --git a/lib/l10n/app_pt.arb b/lib/l10n/app_pt.arb
index 9022309..2529197 100644
--- a/lib/l10n/app_pt.arb
+++ b/lib/l10n/app_pt.arb
@@ -68,6 +68,7 @@
"homeIncomingTxSemanticLabel": "Transação de Entrada",
"homeTransactionConfirmed": "Confirmado",
"homeNoTransactions": "Sem transações",
+ "homeFiatApiError": "Erro ao conectar à API de cotação",
"receiveTitle": "Receber",
"receivePrimaryAddressWarn": "Aviso: A menos que saiba o que está fazendo, por favor considere usar subendereços para melhor privacidade.",
"receiveShareButton": "Compartilhar",
diff --git a/lib/screens/wallet_home.dart b/lib/screens/wallet_home.dart
index 5550da1..baabba6 100644
--- a/lib/screens/wallet_home.dart
+++ b/lib/screens/wallet_home.dart
@@ -193,12 +193,7 @@ class _WalletHomeScreenState extends State<WalletHomeScreen> {
).showSnackBar(SnackBar(content: Text(i18n.sendTransactionSuccessfullySent)));
}
- Widget _buildStatusIcons(
- WalletModel wallet,
- StatusIconStatus lwsConnectionIconStatus,
- StatusIconStatus fiatApiIconStatus,
- FiatRateModel fiatRate,
- ) {
+ Widget _buildStatusIcons(WalletModel wallet, StatusIconStatus lwsConnectionIconStatus) {
return Column(
spacing: 10,
children: [
@@ -219,16 +214,6 @@ class _WalletHomeScreenState extends State<WalletHomeScreen> {
),
if (!wallet.usingTor && lwsConnectionIconStatus == StatusIconStatus.fail)
SizedBox(width: 26, height: 26, child: Icon(Icons.cancel, color: Colors.red)),
- if (wallet.usingTor)
- StatusIcon(
- status: lwsConnectionIconStatus,
- child: SvgPicture.asset('assets/icons/tor.svg', width: 22, height: 22),
- ),
- if (!fiatRate.isDisabled)
- StatusIcon(
- status: fiatApiIconStatus,
- child: SvgPicture.asset('assets/icons/tor.svg', width: 22, height: 22),
- ),
],
);
}
@@ -259,10 +244,21 @@ class _WalletHomeScreenState extends State<WalletHomeScreen> {
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.bodySmall,
),
- if (unlockedBalanceFiat == null && !fiatRate.isDisabled)
- Skeletonizer(enabled: true, child: Text('Potato', style: TextStyle(fontSize: 18))),
- if (unlockedBalanceFiat is double && !fiatRate.isDisabled)
- FiatAmount(prefix: fiatSymbol, amount: unlockedBalanceFiat, maxFontSize: 18),
+ Row(
+ mainAxisAlignment: MainAxisAlignment.center,
+ spacing: 4,
+ children: [
+ if (fiatRate.hasFailed)
+ Tooltip(
+ message: i18n.homeFiatApiError,
+ child: Icon(Icons.warning_rounded, size: 18, color: Colors.red),
+ ),
+ if (unlockedBalanceFiat == null && !fiatRate.isDisabled)
+ Skeletonizer(enabled: true, child: Text('Potato', style: TextStyle(fontSize: 18))),
+ if (unlockedBalanceFiat is double && !fiatRate.isDisabled)
+ FiatAmount(prefix: fiatSymbol, amount: unlockedBalanceFiat, maxFontSize: 18),
+ ],
+ ),
],
);
}
@@ -473,12 +469,7 @@ class _WalletHomeScreenState extends State<WalletHomeScreen> {
Positioned(
top: 0,
right: 0,
- child: _buildStatusIcons(
- wallet,
- lwsConnectionIconStatus,
- fiatApiIconStatus,
- fiatRate,
- ),
+ child: _buildStatusIcons(wallet, lwsConnectionIconStatus),
),
Center(
child: _buildBalanceDisplay(
@@ -538,12 +529,7 @@ class _WalletHomeScreenState extends State<WalletHomeScreen> {
Positioned(
top: 0,
left: 0,
- child: _buildStatusIcons(
- wallet,
- lwsConnectionIconStatus,
- fiatApiIconStatus,
- fiatRate,
- ),
+ child: _buildStatusIcons(wallet, lwsConnectionIconStatus),
),
Column(
children: [
diff --git a/pubspec.lock b/pubspec.lock
index 99166c1..a4547c7 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -522,7 +522,7 @@ packages:
description:
path: "impls/monero.dart"
ref: lwsf
- resolved-ref: "e3645fc466b429c976aa5c4e6abc94db65aebcf1"
+ resolved-ref: e3645fc466b429c976aa5c4e6abc94db65aebcf1
url: "https://github.com/vtnerd/monero_c"
source: git
version: "0.0.0"
@@ -1141,5 +1141,5 @@ packages:
source: hosted
version: "3.1.3"
sdks:
- dart: "3.10.7"
+ dart: "3.10.8"
flutter: ">=3.35.0"
diff --git a/pubspec.yaml b/pubspec.yaml
index a838f8c..881b9bb 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -19,7 +19,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
version: 1.0.7+12
environment:
- sdk: 3.10.7
+ sdk: 3.10.8
flutter_launcher_icons:
android: true
Why this scored 15/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.