Skip to content

Commit 96e5caa

Browse files
CharlVSsmk762
authored andcommitted
Show skeleton for assets list addresses (#2990)
* feat(ui): show loading skeleton for coin addresses * Reduce address placeholder items from 3 to 1
1 parent d2d0014 commit 96e5caa

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

lib/views/wallet/wallet_page/common/expandable_coin_list_item.dart

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,19 @@ class _ExpandableCoinListItemState extends State<ExpandableCoinListItem> {
7676
? (List.of(widget.pubkeys!.keys)
7777
..sort((a, b) => b.balance.spendable.compareTo(a.balance.spendable)))
7878
: null;
79+
final children = sortedAddresses != null
80+
? sortedAddresses
81+
.map(
82+
(pubkey) => _AddressRow(
83+
pubkey: pubkey,
84+
coin: widget.coin,
85+
isSwapAddress: pubkey == sortedAddresses.first,
86+
onTap: widget.onTap,
87+
onCopy: () => copyToClipBoard(context, pubkey.address),
88+
),
89+
)
90+
.toList()
91+
: [SkeletonListTile()];
7992

8093
// Match GroupedAssetTickerItem: 16 horizontal, 16 vertical for both (mobile)
8194
// For desktop, set vertical padding to achieve 78px height
@@ -104,17 +117,7 @@ class _ExpandableCoinListItemState extends State<ExpandableCoinListItem> {
104117
maintainState: true,
105118
childrenDivider: const Divider(height: 1, indent: 16, endIndent: 16),
106119
trailing: CoinMoreActionsButton(coin: widget.coin),
107-
children: sortedAddresses
108-
?.map(
109-
(pubkey) => _AddressRow(
110-
pubkey: pubkey,
111-
coin: widget.coin,
112-
isSwapAddress: pubkey == sortedAddresses.first,
113-
onTap: widget.onTap,
114-
onCopy: () => copyToClipBoard(context, pubkey.address),
115-
),
116-
)
117-
.toList(),
120+
children: children,
118121
);
119122
}
120123

0 commit comments

Comments
 (0)