fix naming on wallet type page (#3279)
* fix naming on wallet type page * add long press copy to tx history amount
malik1004x committed
Jun 2, 2026 at 16:55 UTC
371c063bc6ff02ea4b57598437bc609f24d543d7
5 files changed
+68
-55
cw_core/lib/wallet_type.dart
+45
-44
@@ -238,50 +238,51 @@ String walletTypeToString(WalletType type) {
238
}
239
}
240
241
-String walletTypeToDisplayName(WalletType type) {
242
- switch (type) {
243
- case WalletType.monero:
244
- return 'Monero (XMR)';
245
- case WalletType.bitcoin:
246
- return 'Bitcoin (BTC)';
247
- case WalletType.litecoin:
248
- return 'Litecoin (LTC)';
249
- case WalletType.haven:
250
- return 'Haven (XHV)';
251
- case WalletType.ethereum:
252
- return 'Ethereum (ETH)';
253
- case WalletType.bitcoinCash:
254
- return 'Bitcoin Cash (BCH)';
255
- case WalletType.nano:
256
- return 'Nano (XNO)';
257
- case WalletType.banano:
258
- return 'Banano (BAN)';
259
- case WalletType.polygon:
260
- return 'Polygon (POL)';
261
- case WalletType.solana:
262
- return 'Solana (SOL)';
263
- case WalletType.tron:
264
- return 'Tron (TRX)';
265
- case WalletType.wownero:
266
- return 'Wownero (WOW)';
267
- case WalletType.zano:
268
- return 'Zano (ZANO)';
269
- case WalletType.decred:
270
- return 'Decred (DCR)';
271
- case WalletType.dogecoin:
272
- return 'Dogecoin (DOGE)';
273
- case WalletType.base:
274
- return 'Base';
275
- case WalletType.arbitrum:
276
- return 'Arbitrum (ARB)';
277
- case WalletType.zcash:
278
- return 'Zcash (ZEC)';
279
- case WalletType.bsc:
280
- return 'BNB Smart Chain (BNB)';
281
- case WalletType.none:
282
- return '';
283
- }
284
-}
241
+String walletTypeToDisplayName(WalletType type) => switch (type) {
242
+ WalletType.monero => 'Monero',
243
+ WalletType.bitcoin => 'Bitcoin',
244
+ WalletType.litecoin => 'Litecoin',
245
+ WalletType.haven => 'Haven',
246
+ WalletType.ethereum => 'Ethereum',
247
+ WalletType.bitcoinCash => 'Bitcoin Cash',
248
+ WalletType.nano => 'Nano',
249
+ WalletType.banano => 'Banano',
250
+ WalletType.polygon => 'Polygon',
251
+ WalletType.solana => 'Solana',
252
+ WalletType.tron => 'Tron',
253
+ WalletType.wownero => 'Wownero',
254
+ WalletType.zano => 'Zano',
255
+ WalletType.decred => 'Decred',
256
+ WalletType.dogecoin => 'Dogecoin',
257
+ WalletType.base => 'Base',
258
+ WalletType.arbitrum => 'Arbitrum',
259
+ WalletType.zcash => 'Zcash',
260
+ WalletType.bsc => 'BNB Smart Chain',
261
+ WalletType.none => ''
262
+ };
263
+
264
+String walletTypeToDisplayTicker(WalletType type) => switch (type) {
265
+ WalletType.monero => 'XMR',
266
+ WalletType.bitcoin => 'BTC',
267
+ WalletType.litecoin => 'LTC',
268
+ WalletType.haven => 'XHV',
269
+ WalletType.ethereum => 'ETH',
270
+ WalletType.bitcoinCash => 'BCH',
271
+ WalletType.nano => 'XNO',
272
+ WalletType.banano => 'BAN',
273
+ WalletType.polygon => 'POL',
274
+ WalletType.solana => 'SOL',
275
+ WalletType.tron => 'TRX',
276
+ WalletType.wownero => 'WOW',
277
+ WalletType.zano => 'ZANO',
278
+ WalletType.decred => 'DCR',
279
+ WalletType.dogecoin => 'DOGE',
280
+ WalletType.base => '',
281
+ WalletType.arbitrum => 'ARB',
282
+ WalletType.zcash => 'ZEC',
283
+ WalletType.bsc => 'BNB',
284
+ WalletType.none => ''
285
+ };
286
287
WalletType? _cryptoCurrencyToWalletType(CryptoCurrency type) {
288
switch (type) {
cw_monero/pubspec.lock
+4
-4
@@ -982,8 +982,8 @@ packages:
982
dependency: "direct main"
983
description:
984
path: trezor-flutter
985
- ref: "4bf54339a1caefd4c53a4a8873a9686ec13a9107"
986
- resolved-ref: "4bf54339a1caefd4c53a4a8873a9686ec13a9107"
985
+ ref: becd18ac474d343d94b6191d89fad43270d2a02e
986
+ resolved-ref: becd18ac474d343d94b6191d89fad43270d2a02e
987
url: "https://github.com/cake-tech/trezor-flutter.git"
988
source: git
989
version: "0.1.0"
@@ -991,8 +991,8 @@ packages:
991
dependency: transitive
992
description:
993
path: trezor_usb_transport
994
- ref: "4bf54339a1caefd4c53a4a8873a9686ec13a9107"
995
- resolved-ref: "4bf54339a1caefd4c53a4a8873a9686ec13a9107"
994
+ ref: becd18ac474d343d94b6191d89fad43270d2a02e
995
+ resolved-ref: becd18ac474d343d94b6191d89fad43270d2a02e
996
url: "https://github.com/cake-tech/trezor-flutter.git"
997
source: git
998
version: "0.0.1"
lib/new-ui/widgets/coins_page/assets_history/transaction_details_modal.dart
+12
-3
@@ -1,6 +1,7 @@
1
import 'package:cake_wallet/entities/new_ui_entities/list_item/list_item.dart';
2
import 'package:cake_wallet/entities/new_ui_entities/list_item/list_item_regular_row.dart';
3
import 'package:cake_wallet/generated/i18n.dart';
4
+import 'package:cake_wallet/new-ui/widgets/copy_wrapper.dart';
5
import 'package:cake_wallet/new-ui/widgets/receive_page/receive_top_bar.dart';
6
import 'package:cake_wallet/routes.dart';
7
import 'package:cake_wallet/src/screens/transaction_details/confirmations_list_item.dart';
@@ -81,9 +82,17 @@ class _TransactionDetailsModalState extends State<TransactionDetailsModal> {
82
widget.transactionDetailsViewModel.formattedStatus,
83
style: TextStyle(fontSize: 20, fontWeight: FontWeight.w500),
84
),
84
- Text(
85
- widget.transactionDetailsViewModel.formattedCryptoAmount,
86
- style: TextStyle(fontSize: 28),
85
+ CopyWrapper(
86
+ requireLongPress: true,
87
+ data: ClipboardData(text: widget.transactionDetailsViewModel.formattedCryptoAmount),
88
+ builder: (context, copied)=> AnimatedSwitcher(
89
+ duration: Duration(milliseconds: 300),
90
+ child: Text(
91
+ key: ValueKey(copied),
92
+ copied ? S.of(context).copied : widget.transactionDetailsViewModel.formattedCryptoAmount,
93
+ style: TextStyle(fontSize: 28, color: copied ? Theme.of(context).colorScheme.primary : Theme.of(context).colorScheme.onSurface),
94
+ ),
95
+ ),
96
),
97
Padding(
98
padding: const EdgeInsets.all(16.0),
lib/new-ui/widgets/copy_wrapper.dart
+4
-1
@@ -9,12 +9,14 @@ class CopyWrapper extends StatefulWidget {
9
const CopyWrapper(
10
{super.key,
11
this.data,
12
+ this.requireLongPress = false,
13
this.isSensitive = false,
14
required this.builder,
15
this.duration = const Duration(milliseconds: 1200)});
16
17
final ClipboardData? data;
18
final bool isSensitive;
19
+ final bool requireLongPress;
20
final Widget Function(BuildContext, bool) builder;
21
final Duration duration;
22
@@ -40,7 +42,8 @@ class _CopyWrapperState extends State<CopyWrapper> {
42
Widget build(BuildContext context) {
43
return GestureDetector(
44
behavior: HitTestBehavior.translucent,
43
- onTap: handleCopy,
45
+ onTap: widget.requireLongPress ? null : handleCopy,
46
+ onLongPress: !widget.requireLongPress ? null : handleCopy,
47
child: widget.builder(context, copied),
48
);
49
}
lib/src/screens/new_wallet/new_wallet_type_page.dart
+3
-3
@@ -137,7 +137,7 @@ class WalletTypeFormState extends State<WalletTypeForm> {
137
),
138
Flexible(
139
child: Padding(
140
- padding: const EdgeInsets.symmetric(horizontal: 18),
140
+ padding: const EdgeInsets.only(left: 18, right: 18, bottom: 12),
141
child: Container(
142
decoration: BoxDecoration(
143
color: Theme.of(context).colorScheme.surfaceContainer,
@@ -172,10 +172,10 @@ class WalletTypeFormState extends State<WalletTypeForm> {
172
imageUrl: curr.iconPath,
173
),
174
const SizedBox(width: 12),
175
- Text(curr.fullName ?? curr.name),
175
+ Text(walletTypeToDisplayName(item)),
176
const SizedBox(width: 4),
177
Text(
178
- curr.title,
178
+ walletTypeToDisplayTicker(item),
179
style: TextStyle(
180
color: Theme.of(context).colorScheme.onSurfaceVariant,
181
),